-
Notifications
You must be signed in to change notification settings - Fork 86
Bugfix/libtofs crash on files switch lookup list #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix/libtofs crash on files switch lookup list #150
Conversation
|
This should fix #149. This is the output on my test machine: The two lines before the I'm not really happy with putting the |
0c9eadd to
ee0dad6
Compare
Maybe something like diff --git a/kitchen.yml b/kitchen.yml
index 3be550a..d62989d 100644
--- a/kitchen.yml
+++ b/kitchen.yml
@@ -124,8 +124,10 @@ provisioner:
base:
'*':
- template
+ - test
pillars_from_files:
template.sls: pillar.example
+ test.sls: test/salt/pillar/test.sls
verifier:
# https://www.inspec.io/
diff --git a/pillar.example b/pillar.example
index fd8a5b8..1b035ec 100644
--- a/pillar.example
+++ b/pillar.example
@@ -56,7 +56,3 @@ template:
# Just for testing purposes
winner: pillar
added_in_pillar: pillar_value
-
-role:
- - foo
- - bar
diff --git a/test/salt/pillar/test.sls b/test/salt/pillar/test.sls
new file mode 100644
index 0000000..5ac428c
--- /dev/null
+++ b/test/salt/pillar/test.sls
@@ -0,0 +1,4 @@
+# libtofs.jinja must work with tofs.files_switch looked up list
+role:
+ - foo
+ - bar |
|
@baby-gnu Using an extra pillar for testing is definitely a solution we can work with. I've already adapted |
Thanks @myii, I'll integrate this. Where is the |
|
@baby-gnu I'll be sharing it soon! See saltstack-formulas/cert-formula#28 (comment) for a bit more explanation. |
2e6110b to
3eb4ff5
Compare
myii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@baby-gnu Fantastic, this is the same method that was in my mind. Most of my review is just a number of suggestions; the only thing I'd really like to change is role => roles, for the reason I mentioned inline (re: the upstream documentation).
|
@baby-gnu By the way, I forgot to mention that I tested my suggested changes and all is looking good: Furthermore, if you do agree to change to |
3eb4ff5 to
3aaf5b9
Compare
We need to verify that “libtofs” works when the “tofs.files_switch” lookup return a list instead of a single element. * kitchen.yml (provisioner): copy tests specific pillars into the test environment. * pillar.example (template.tofs.files_switch): lookup for “roles” at the end. * test/salt/pillar/test.sls (roles): list of roles to apply during tests. * test/integration/default/controls/config_spec.rb: add “roles” to the list of “tofs.files_switch” items to verify.
We need to process all elements when the “config.get” lookup of “tofs.files_switch” return a list. * template/libtofs.jinja: force the output of the lookup to be a list.
3aaf5b9 to
0979d35
Compare
|
I just fixed the commit messages Thanks @myii for the note in IRC. |
|
Merged, thanks for the important contribution @baby-gnu! |
|
🎉 This PR is included in version 3.0.9 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
semantic-release cross-formula standard structure
saltstack-formulas/postgres-formula#279
No description provided.