-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Milestone
Description
As demonstrated below, the code for checking the choice type does not verify the entire string and will pass if a subset is given.
[click]$ setrackinfo ifcfg-param add 1
Usage: setrackinfo ifcfg-param add [OPTIONS] NODEID INTF PARAM [VALUE]
Error: Missing argument "Choice(['public', 'private'])".
[click]$ setrackinfo ifcfg-param add 1 pub
Usage: setrackinfo ifcfg-param add [OPTIONS] NODEID INTF PARAM [VALUE]
Error: Missing argument "Choice(['mtu', 'xmit_hash_policy'])".
I imagine the convert function should be updated to ensure that the given input is actually in the choices and not just a subset is matched.
class Choice(ParamType):
....
....
def convert(self, value, param, ctx):
# Exact match
if value in self.choices:
return value
Metadata
Metadata
Assignees
Labels
No labels