Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Use hook template from layers instead of embedding #75
Conversation
bcsaller
reviewed
Dec 8, 2015
| + self.target, target_config, template)) | ||
| + | ||
| + def plan_storage(self, layers, output_files, plan): | ||
| + # Interface includes don't directly map to output files |
marcoceppi
reviewed
Dec 8, 2015
| @@ -119,6 +115,7 @@ class Builder(object): | ||
| Handle the processing of overrides, implements the policy of BuildConfig | ||
| """ | ||
| PHASES = ['lint', 'read', 'call', 'sign', 'build'] | ||
| + HOOK_TEMPLATE_FILE = path('hooks/hook.template') |
marcoceppi
Dec 8, 2015
Owner
It seems odd that we define this several times. Here, L12 & L202 of tactics.py, etc
bcsaller
reviewed
Dec 8, 2015
| @@ -253,6 +235,40 @@ def __str__(self): | ||
| return "Bind Interface {}".format(self.interface.name) | ||
| +class StorageBind(Tactic): |
bcsaller
Dec 8, 2015
Contributor
Should this share a baseclass with interface bind and share code. replicating things like sign() happen too much already in the code base. I won't insist, but if you agree that is a good idea we can make an issue.
bcsaller
reviewed
Dec 8, 2015
| @@ -520,3 +520,7 @@ def prefix_lines(lines, lineno): | ||
| m=message) | ||
| i += 1 | ||
| return i == 0 | ||
| + | ||
| + | ||
| +class BuildError(Exception): |
bcsaller
Dec 8, 2015
Contributor
maybe move this to an exceptions module, it isn't really a utility, just a nitpick though
johnsca
Dec 9, 2015
Member
I didn't actually mean to move this since I didn't end up using it in tactics.py like I thought I might need to.
johnsca
added some commits
Dec 9, 2015
marcoceppi
added this to the
NEXT milestone
Dec 9, 2015
bcsaller
reviewed
Dec 9, 2015
| + return "{}: {}".format(self.__class__.__name__, self.name) | ||
| + | ||
| + | ||
| +class InterfaceBind(DynamicHookBind): |
johnsca
added
the
charm-build
label
Dec 11, 2015
|
From what i see here wrt the storage hook generators, this looks +1 to me, however i haven't verified by attempting to build a charm w/ storage hooks using this branch. YMMV w/ that +1 |
I won't have time to test until next week, but if someone wants to test storage, just add the following to a charm's metadata.yaml:
This will create a required filesystem store called "whatever". Deploying without storage constraints should create a directory in the root filesystem that will be used for that store. Just deploying a generated charm that has required storage currently fails, as noted in #70. |
johnsca
referenced this pull request
in juju-solutions/layer-basic
Dec 11, 2015
Merged
Refactor bootstrap code and provide hook.template #16
|
This can be tested with juju-solutions/reactive-base-layer#16. That PR can be merged before this one. Together, they fix #70 |
johnsca commentedDec 8, 2015
Implement #74. This will allow iteration on the hooks w/o release of charm-tools, as well as non-Python base layers.