Replace all --param yes/no with boolean param! #313
Labels
No labels
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: ungleich-public/cdist#313
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: telmich
Deprecate the older ones, keep for some versions and then switch to boolean?
Types:
__rvm_gemset
Created by: telmich
Already done! yeah!
Created by: telmich
Last Missing: __jail (blocker for 2.1)
Created by: jdguffey
Err...Implement in types should be 2. Apparently I can't count. :/
Created by: jdguffey
Aha. I like this. Perhaps it could be solved in one of a couple ways (that would work alongside my previous suggestion).
Since cdist already makes use of argparse and store_const, set const in boolean params to "true," then proceed as previously described in gencode-*.
emulator.py:
This one is harder but stays out of the core (I'd probably not prefer this method, but I'll include it for the sake of completeness):
Eh?
Created by: telmich
Good morning Jake,
Jake Guffey [Wed, Sep 12, 2012 at 06:32:55PM -0700]:
Good point - especially not breaking the user is a great idea.
Though what I was thinking about a different syntax, which may not be
usable with the current setup:
__directory /my/id --parents --mode 0700
As the parent parameter being present/absent, this is already enough to
distinguish betweeen true/false.
This has been added to cdist in version 2.0.8 already and the included
types should use this to encourage users to use this standardised way as well.
You could then check if it in the type is present with
if [ -f $__object/parameter/parents ]; ...
PGP key: 7ED9 F7D3 6B10 81D7 0EC5 5C09 D7DC C8E4 3187 7DF0
Created by: jdguffey
What if, rather than forcing everything to always be true/false (which is, of course, a legitimate option), we refactor types to allow all yes/no/true/false parameters to be (yes|true|1)|(no|false|0), like so many configuration file syntaxes in *NIX-land? Then, the user could choose whatever format made the most sense to him, while it would mean the same thing to cdist types on the back end? Something as simple as
or
This also has the added benefit of not breaking pre-existing manifests that use yes/no rather than true/false without refactoring of each manifest.
Just my $0.02. Thoughts?