diff --git a/bootstrapvz/providers/oracle/__init__.py b/bootstrapvz/providers/oracle/__init__.py index 09ef0c7..5ff37bd 100644 --- a/bootstrapvz/providers/oracle/__init__.py +++ b/bootstrapvz/providers/oracle/__init__.py @@ -10,8 +10,16 @@ import tasks.packages def validate_manifest(data, validator, error): import os.path - schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml')) - validator(data, schema_path) + validator(data, os.path.join(os.path.dirname(__file__), 'manifest-schema.yml')) + + keys = ['username', 'password', 'identity-domain'] + if 'credentials' in data['provider']: + if not all(key in data['provider']['credentials'] for key in keys): + msg = 'All Oracle Compute Cloud credentials should be specified in the manifest' + error(msg, ['provider', 'credentials']) + if not data['provider'].get('container'): + msg = 'The container to which the image will be uploaded should be specified' + error(msg, ['provider']) def resolve_tasks(taskset, manifest): diff --git a/bootstrapvz/providers/oracle/manifest-schema.yml b/bootstrapvz/providers/oracle/manifest-schema.yml index 32da5d5..16b4068 100644 --- a/bootstrapvz/providers/oracle/manifest-schema.yml +++ b/bootstrapvz/providers/oracle/manifest-schema.yml @@ -3,6 +3,17 @@ $schema: http://json-schema.org/draft-04/schema# title: Oracle manifest type: object properties: + provider: + type: object + properties: + credentials: + type: object + properties: + username: {type: string} + password: {type: string} + identity-domain: {type: string} + container: {type: string} + verify: {type: boolean} system: type: object properties: @@ -21,7 +32,6 @@ properties: type: type: string enum: - - none - msdos - gpt required: [backing]