Skip to content

Commit

Permalink
Merge pull request skonfig#81 from skonfig/4nd3r/type_manifest_dir
Browse files Browse the repository at this point in the history
type manifest can be dir of manifests
  • Loading branch information
4nd3r authored Dec 7, 2024
2 parents c562872 + 5873985 commit 64c223d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ You can find us in `#skonfig:matrix.org` ([matrix?](https://matrix.org/faq/)).
Most parts of [cdist documentation](https://www.cdi.st/manual/latest/) apply, but there are differences:

* `skonfig` does only `config` (see `skonfig -h`),
* types are managed in sets,
* type manifest can be directory of manifests,
* some types behave differently and it's recommended to consult manuals in *base* and *extra*.

## Split between *base* and *extra*
Expand Down
14 changes: 13 additions & 1 deletion cdist/core/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,21 @@ def env_type_manifest(self, cdist_object):
def run_type_manifest(self, cdist_object):
type_manifest = os.path.join(self.local.type_path,
cdist_object.cdist_type.manifest_path)
type_init_manifest = os.path.join(type_manifest, "init")
if os.path.isfile(type_init_manifest):
type_manifests = [type_init_manifest]
elif os.path.isdir(type_manifest):
type_manifests = []
for m in os.listdir(type_manifest):
type_manifests.append(os.path.join(type_manifest, m))
type_manifests.sort()
elif os.path.isfile(type_manifest):
type_manifests = [type_manifest]
else:
return
message_prefix = cdist_object.name
which = 'manifest'
if os.path.isfile(type_manifest):
for type_manifest in type_manifests:
self.log.verbose("Running type manifest %s for object %s",
type_manifest, cdist_object.name)
if self.local.save_output_streams:
Expand Down

0 comments on commit 64c223d

Please sign in to comment.