--beta on the commandline does not seem to work #131
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#131
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: matthijskooijman
With 4.8.0:
Printing
parser_args
(at https://github.com/ungleich/cdist/blob/4.8.0/cdist/argparse.py#L439) gives:It seems the problem is that the "beta" parser is listed as a parser of the "inventory" parser as well as of the "list" parser, and the latter seems to overwrite
parser_args['beta']
with its default. This is confirmed by the fact that this does work:Not sure what the proper fix would be, though.
Created by: matthijskooijman
Fix looks good to me and works, thanks!
Created by: darko-poljak
@matthijskooijman Please test fix:
23292e5cad
Created by: matthijskooijman
Looks good for the --beta option, sounds like the right way to fix this.
CDIST_BETA
env doesn't work yet, though.Created by: darko-poljak
Fixed argparse parsers' parent references so options are now fixed/more consistent.
Created by: darko-poljak
@matthijskooijman I think that the right way would be:
instead of
and then for inventory subcommands:
cdist inventory
is just a sub-command sugar for e.g. inventory-add-host subcommand,it has no functionality on its own, without its sub-commands.
Created by: darko-poljak
@matthijskooijman Hi! Thanks for analysis. I am not sure for above, if argparse supports this, I have to check.
And for CDIST_BETA and beta default part, I will check and fix.
Created by: matthijskooijman
It seems that this also breaks the
CDIST_BETA
env var. It is parsed properly, but then overwritten with the default False from the commandline here: https://github.com/ungleich/cdist/blob/4.8.0/cdist/configuration.py#L469I would suspect that removing the default from the beta parser here would fix both problems. This would mean that no 'beta' config is present if it is not given anywhere, but this is already handled here: https://github.com/ungleich/cdist/blob/4.8.0/cdist/argparse.py#L60-L61