The records option gobbles up all trailing parameters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-designateclient |
Fix Released
|
Undecided
|
Dr. Jens Harbott |
Bug Description
Looking at the help output, the following commands should work fine, instead an error is raised:
openstack recordset create --type A --records 10.11.12.13 zone. test1.zone.
usage: openstack recordset create [-h] [-f {json,shell,
openstack recordset create: error: too few arguments
In order for the command to succeed, the "--records" parameter needs to be the final parameter.
Changed in python-designateclient: | |
assignee: | nobody → Dr. Jens Harbott (j-harbott) |
status: | New → In Progress |
So the "--records" option is defined with "nargs='+'", making it indeed use up any arguments that follow it. IMO this is very bad UI, the proper solution would be instead to use "action='append'" so that
a) the command as shown above would work, making it comply with what the help output indicates
b) one could still specify multiple records by repeating the "--records RECORD" option
The one question I'm not sure about is how we deal with backwards compatibility. One way of dealing is we say that this is so broken that we just fix it. More conservative approach would be to deprecate the "--records" option and add a new one, possibly called "--record" with the append action.