Silly me, putting things where they don't belong

This commit is contained in:
Anders Ingemann 2014-05-04 19:09:34 +02:00
parent 6302d5d962
commit 3cc84c95e8
2 changed files with 5 additions and 5 deletions

View file

@ -15,3 +15,8 @@ def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
validator(data, schema_path)
# Check the bootloader/partitioning configuration.
# Doing this via the schema is a pain and does not output a useful error message.
if data['system']['bootloader'] == 'grub' and data['volume']['partitions']['type'] == 'none':
error('Grub cannot boot from unpartitioned disks', ['system', 'bootloader'])

View file

@ -71,11 +71,6 @@ 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)