Resolve #65: Add support for layer options in layer.yaml #68

Merged
merged 1 commit into from Dec 14, 2015

Conversation

Projects
None yet
3 participants
Member

johnsca commented Dec 5, 2015

For #65. Add support for jsonschema defined and validated options in layer.yaml for configuring included layers.

@marcoceppi marcoceppi added this to the NEXT milestone Dec 7, 2015

@johnsca johnsca added the charm-build label Dec 7, 2015

+ def lint(self):
+ if 'options' not in self.data:
+ return True
+ validator = extend_with_default(jsonschema.Draft4Validator)(self.schema)
@bcsaller

bcsaller Dec 7, 2015

Contributor

It looks like in this case 'lint' is preforming a now needed mutation of the object which is a bit odd conceptually in that other tactics would be expected to do something similar. Can we do this in 'read' which should be related to loading the version of that data we expect to use in processing (maybe read should be 'load' or 'process' or 'parse' but that is another papercut).

@johnsca

johnsca Dec 8, 2015

Member

@bcsaller I agree that it's not ideal to do modification of the target values during validation, but that's unfortunately what the jsonschema library recommended. Ideally, the default setting behavior would be handled just after combine but I'm not clear on how to implement that without a lot of manual processing of the schema.

marcoceppi added a commit that referenced this pull request Dec 14, 2015

Merge pull request #68 from johnsca/layeropt
Resolve #65: Add support for layer options in layer.yaml

@marcoceppi marcoceppi merged commit 4ac3db3 into juju:master Dec 14, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment