|
|
|
|
|
|
|
|
data = 'Schema is valid' |
|
|
data = 'Schema is valid' |
|
|
except SchemaError as exc: |
|
|
except SchemaError as exc: |
|
|
LOG.error("SchemaError:{}".format(exc)) |
|
|
LOG.error("SchemaError:{}".format(exc)) |
|
|
data = repr(exc) |
|
|
|
|
|
|
|
|
raise Exception("SchemaError") |
|
|
return {'{}-{}'.format(service, role): data} |
|
|
return {'{}-{}'.format(service, role): data} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data = 'Model is valid' |
|
|
data = 'Model is valid' |
|
|
except SchemaError as exc: |
|
|
except SchemaError as exc: |
|
|
LOG.error("SchemaError:{}".format(exc)) |
|
|
LOG.error("SchemaError:{}".format(exc)) |
|
|
data = repr(exc) |
|
|
|
|
|
|
|
|
raise Exception("SchemaError") |
|
|
except ValidationError as exc: |
|
|
except ValidationError as exc: |
|
|
LOG.error("ValidationError:{}\nInstance:{}\n" |
|
|
LOG.error("ValidationError:{}\nInstance:{}\n" |
|
|
"SchemaPath:{}".format(exc.message, exc.instance, |
|
|
|
|
|
|
|
|
"Schema title:{}\n" |
|
|
|
|
|
"SchemaPath:{}".format(exc.message, |
|
|
|
|
|
exc.instance, |
|
|
|
|
|
exc.schema.get( |
|
|
|
|
|
"title", |
|
|
|
|
|
"Schema title not set!"), |
|
|
exc.schema_path)) |
|
|
exc.schema_path)) |
|
|
raise Exception("ValidationError") |
|
|
raise Exception("ValidationError") |
|
|
return {'{}-{}'.format(service, role): data} |
|
|
return {'{}-{}'.format(service, role): data} |
|
|
|
|
|
|
|
|
data = 'Model is valid' |
|
|
data = 'Model is valid' |
|
|
except SchemaError as exc: |
|
|
except SchemaError as exc: |
|
|
LOG.error("SchemaError:{}".format(exc)) |
|
|
LOG.error("SchemaError:{}".format(exc)) |
|
|
data = str(exc) |
|
|
|
|
|
|
|
|
raise Exception("SchemaError") |
|
|
except ValidationError as exc: |
|
|
except ValidationError as exc: |
|
|
LOG.error("ValidationError:{}\nInstance:{}\n" |
|
|
LOG.error("ValidationError:{}\nInstance:{}\n" |
|
|
"SchemaPath:{}".format(exc.message, exc.instance, |
|
|
|
|
|
|
|
|
"Schema title:{}\n" |
|
|
|
|
|
"SchemaPath:{}".format(exc.message, |
|
|
|
|
|
exc.instance, |
|
|
|
|
|
exc.schema.get( |
|
|
|
|
|
"title", |
|
|
|
|
|
"Schema title not set!"), |
|
|
exc.schema_path)) |
|
|
exc.schema_path)) |
|
|
raise Exception("ValidationError") |
|
|
raise Exception("ValidationError") |
|
|
return data |
|
|
return data |
|
|
|
|
|
|
|
|
except Exception as exc: |
|
|
except Exception as exc: |
|
|
LOG.error('{}: {}'.format(pillar, repr(exc))) |
|
|
LOG.error('{}: {}'.format(pillar, repr(exc))) |
|
|
if service not in raw_data.keys(): |
|
|
if service not in raw_data.keys(): |
|
|
raise Exception( |
|
|
|
|
|
"Could not find applicable data " |
|
|
|
|
|
"for:{}\n at:{}".format(service, _get_base_dir())) |
|
|
|
|
|
|
|
|
LOG.error("Could not find applicable data " |
|
|
|
|
|
"for:{}\n at:{}".format(service, _get_base_dir())) |
|
|
|
|
|
raise Exception("DataError") |
|
|
|
|
|
|
|
|
data = raw_data[service] |
|
|
data = raw_data[service] |
|
|
output = {} |
|
|
output = {} |
|
|
for role_name, role in data.items(): |
|
|
for role_name, role in data.items(): |