mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Generalize "grub only on partitioned volumes" err
(move it into base manifest validation)
This commit is contained in:
parent
0a2cd86b4b
commit
7958950d19
5 changed files with 6 additions and 11 deletions
|
@ -71,6 +71,12 @@ class Manifest(object):
|
||||||
from . import validate_manifest
|
from . import validate_manifest
|
||||||
# Validate the manifest with the base validation function in __init__
|
# Validate the manifest with the base validation function in __init__
|
||||||
validate_manifest(self.data, self.schema_validator, self.validation_error)
|
validate_manifest(self.data, self.schema_validator, self.validation_error)
|
||||||
|
# Check the bootloader/partitioning configuration.
|
||||||
|
# Doing this via the schema is a pain and does not output a useful error message.
|
||||||
|
# This should be put into a separat function if there is more that should be checked like this.
|
||||||
|
if self.data['system']['bootloader'] == 'grub' and self.data['volume']['partitions']['type'] == 'none':
|
||||||
|
self.validation_error('Grub cannot boot from unpartitioned disks', ['system', 'bootloader'])
|
||||||
|
|
||||||
# Run the provider validation
|
# Run the provider validation
|
||||||
self.modules['provider'].validate_manifest(self.data, self.schema_validator, self.validation_error)
|
self.modules['provider'].validate_manifest(self.data, self.schema_validator, self.validation_error)
|
||||||
# Run the validation function for any plugin that has it
|
# Run the validation function for any plugin that has it
|
||||||
|
|
|
@ -20,9 +20,6 @@ def validate_manifest(data, validator, error):
|
||||||
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
|
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
|
||||||
validator(data, schema_path)
|
validator(data, schema_path)
|
||||||
|
|
||||||
if data['volume']['partitions']['type'] == 'none' and data['system']['bootloader'] != 'extlinux':
|
|
||||||
error('Only extlinux can boot from unpartitioned disks', ['system', 'bootloader'])
|
|
||||||
|
|
||||||
|
|
||||||
def resolve_tasks(taskset, manifest):
|
def resolve_tasks(taskset, manifest):
|
||||||
taskset.update(task_groups.get_standard_groups(manifest))
|
taskset.update(task_groups.get_standard_groups(manifest))
|
||||||
|
|
|
@ -43,8 +43,6 @@ def validate_manifest(data, validator, error):
|
||||||
error('Paravirtualized AMIs only support pvgrub as a bootloader', ['system', 'bootloader'])
|
error('Paravirtualized AMIs only support pvgrub as a bootloader', ['system', 'bootloader'])
|
||||||
if data['virtualization'] == 'hvm' and data['system']['bootloader'] == 'pvgrub':
|
if data['virtualization'] == 'hvm' and data['system']['bootloader'] == 'pvgrub':
|
||||||
error('HVM AMIs only support extlinux as a bootloader', ['system', 'bootloader'])
|
error('HVM AMIs only support extlinux as a bootloader', ['system', 'bootloader'])
|
||||||
if data['volume']['partitions']['type'] == 'none' and data['system']['bootloader'] == 'grub':
|
|
||||||
error('Grub cannot boot from unpartitioned disks', ['system', 'bootloader'])
|
|
||||||
|
|
||||||
|
|
||||||
def resolve_tasks(taskset, manifest):
|
def resolve_tasks(taskset, manifest):
|
||||||
|
|
|
@ -18,9 +18,6 @@ def validate_manifest(data, validator, error):
|
||||||
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
|
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
|
||||||
validator(data, schema_path)
|
validator(data, schema_path)
|
||||||
|
|
||||||
if data['volume']['partitions']['type'] == 'none' and data['system']['bootloader'] != 'extlinux':
|
|
||||||
error('Only extlinux can boot from unpartitioned disks', ['system', 'bootloader'])
|
|
||||||
|
|
||||||
|
|
||||||
def resolve_tasks(taskset, manifest):
|
def resolve_tasks(taskset, manifest):
|
||||||
taskset.update(task_groups.get_standard_groups(manifest))
|
taskset.update(task_groups.get_standard_groups(manifest))
|
||||||
|
|
|
@ -16,9 +16,6 @@ def validate_manifest(data, validator, error):
|
||||||
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
|
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
|
||||||
validator(data, schema_path)
|
validator(data, schema_path)
|
||||||
|
|
||||||
if data['volume']['partitions']['type'] == 'none' and data['system']['bootloader'] != 'extlinux':
|
|
||||||
error('Only extlinux can boot from unpartitioned disks', ['system', 'bootloader'])
|
|
||||||
|
|
||||||
|
|
||||||
def resolve_tasks(taskset, manifest):
|
def resolve_tasks(taskset, manifest):
|
||||||
taskset.update(task_groups.get_standard_groups(manifest))
|
taskset.update(task_groups.get_standard_groups(manifest))
|
||||||
|
|
Loading…
Add table
Reference in a new issue