Hadron / carthage

Carthage is an Infrastructure as Code (IAC) framework
Other
8 stars 4 forks source link

plugins: only respects base_dir and checkout_dir set in the same configfile #47

Closed kdienes closed 1 year ago

kdienes commented 1 year ago

If I do:

<[local.yml>

checkout_dir: /XXX include: [config.yml]

plugins: - git+ssh://host/repo.git ... then repo.git will get checked out into .carthage and not into /XXX This can be fixed by the patch at the end, but the problem with the patch is that it will override values in local.yml with the values from the includes, which is probably the opposite of what we want. I think we just need to set early_key items a bit more often but think Sam has a better sense of how he wants to specify this so I'm reporting this and tapping out. ``` @@ -106,13 +106,12 @@ class ConfigLayout(ConfigAccessor, Injectable): p = base_path.joinpath(p) enable_plugin(p) del d['plugins'] - if 'include' in d: - for include in d['include']: - include = base_path.joinpath(include) - with include.open("rt") as include_file: - self.load_yaml(include_file) - del d['include'] + includes = d.pop('include', []) self._load(d, injector, self._schema, "") + for include in includes: + include = base_path.joinpath(include) + with include.open("rt") as include_file: + self.load_yaml(include_file) ```