mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
oracle: update schema and validation
This commit is contained in:
parent
12dbc6a07e
commit
c07f56b796
2 changed files with 21 additions and 3 deletions
|
@ -10,8 +10,16 @@ import tasks.packages
|
||||||
|
|
||||||
def validate_manifest(data, validator, error):
|
def validate_manifest(data, validator, error):
|
||||||
import os.path
|
import os.path
|
||||||
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
|
validator(data, os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
|
||||||
validator(data, schema_path)
|
|
||||||
|
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):
|
def resolve_tasks(taskset, manifest):
|
||||||
|
|
|
@ -3,6 +3,17 @@ $schema: http://json-schema.org/draft-04/schema#
|
||||||
title: Oracle manifest
|
title: Oracle manifest
|
||||||
type: object
|
type: object
|
||||||
properties:
|
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:
|
system:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
@ -21,7 +32,6 @@ properties:
|
||||||
type:
|
type:
|
||||||
type: string
|
type: string
|
||||||
enum:
|
enum:
|
||||||
- none
|
|
||||||
- msdos
|
- msdos
|
||||||
- gpt
|
- gpt
|
||||||
required: [backing]
|
required: [backing]
|
||||||
|
|
Loading…
Add table
Reference in a new issue