diff --git a/bootstrapvz/base/manifest.py b/bootstrapvz/base/manifest.py index ed0b8ac..75d6ae1 100644 --- a/bootstrapvz/base/manifest.py +++ b/bootstrapvz/base/manifest.py @@ -71,6 +71,12 @@ class Manifest(object): from . import validate_manifest # Validate the manifest with the base validation function in __init__ 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 self.modules['provider'].validate_manifest(self.data, self.schema_validator, self.validation_error) # Run the validation function for any plugin that has it diff --git a/bootstrapvz/providers/azure/__init__.py b/bootstrapvz/providers/azure/__init__.py index 688991e..6c10ab0 100644 --- a/bootstrapvz/providers/azure/__init__.py +++ b/bootstrapvz/providers/azure/__init__.py @@ -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')) 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): taskset.update(task_groups.get_standard_groups(manifest)) diff --git a/bootstrapvz/providers/ec2/__init__.py b/bootstrapvz/providers/ec2/__init__.py index b5cb505..3e91096 100644 --- a/bootstrapvz/providers/ec2/__init__.py +++ b/bootstrapvz/providers/ec2/__init__.py @@ -43,8 +43,6 @@ def validate_manifest(data, validator, error): error('Paravirtualized AMIs only support pvgrub as a bootloader', ['system', 'bootloader']) if data['virtualization'] == 'hvm' and data['system']['bootloader'] == 'pvgrub': 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): diff --git a/bootstrapvz/providers/kvm/__init__.py b/bootstrapvz/providers/kvm/__init__.py index 254fe95..1efc41f 100644 --- a/bootstrapvz/providers/kvm/__init__.py +++ b/bootstrapvz/providers/kvm/__init__.py @@ -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')) 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): taskset.update(task_groups.get_standard_groups(manifest)) diff --git a/bootstrapvz/providers/virtualbox/__init__.py b/bootstrapvz/providers/virtualbox/__init__.py index 26faf45..b22cc08 100644 --- a/bootstrapvz/providers/virtualbox/__init__.py +++ b/bootstrapvz/providers/virtualbox/__init__.py @@ -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')) 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): taskset.update(task_groups.get_standard_groups(manifest))