type not throwing any error message when repeated twice while creating record
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-designateclient |
Invalid
|
Low
|
Unassigned |
Bug Description
while creating records if --type (mandatory field) is repeated twice system throw an error message but when another mandatory field i.e records is repeated twice
system accepting it and not give any error.
--type A www.abc --type A www.abc -------------error
--records 10.0.4.3 --records 10.0.0.4 -------------no error (record created with 10.0.0.4)
--ttl 10 --ttl 20 -------------no error (record created with ttl 20)
--description "hello hows u" --description "iam fine" -----no error (record created with description iam fine )
eg: RECORDS TWICE
+++++++++++++++++
+++++++++++++++++
Records filed entered twice and it is executed without any error.
rahul-vm1@vm1:~$ openstack recordset create fff.com. --type A www.abc --records 10.0.0.3 --records 10.0.0.4
+------
| Field | Value |
+------
| action | CREATE |
| created_at | 2017-03-
| description | None |
| id | 73c8839e-
| name | www.abc.fff.com. |
| project_id | 5cde049b52484f3
| records | 10.0.0.4 |
| status | PENDING |
| ttl | None |
| type | A |
| updated_at | None |
| version | 1 |
| zone_id | 103cace3-
| zone_name | fff.com. |
+------
eg: TYPE TWICE
++++++++++++++
++++++++++++++
Here, when --type is entered twice system return back erro .
rahul-vm1@vm1:~$ openstack recordset create fff.com. --type A www.xyz --type A www.xyz --records 10.0.0.4
usage: openstack recordset create [-h] [-f {json,shell,
openstack recordset create: error: unrecognized arguments: www.xyz
eg: TTL TWICE
+++++++++++++
+++++++++++++
rahul-vm1@vm1:~$ openstack recordset create fff.com. --type A www.xyz --records 10.0.0.4 --ttl 40 --ttl 50
+------
| Field | Value |
+------
| action | CREATE |
| created_at | 2017-03-
| description | None |
| id | 0cb610c0-
| name | www.xyz.fff.com. |
| project_id | 5cde049b52484f3
| records | 10.0.0.4 |
| status | PENDING |
| ttl | 50 |
| type | A |
| updated_at | None |
| version | 1 |
| zone_id | 103cace3-
| zone_name | fff.com. |
+------
rahul-vm1@vm1:~$ openstack recordset create fff.com. --type A www.xyxz --records 10.0.0.4 --records 10.0.0.5 --ttl 40 --ttl 50
+------
| Field | Value |
+------
| action | CREATE |
| created_at | 2017-03-
| description | None |
| id | 83a3cec6-
| name | www.xyxz.fff.com. |
| project_id | 5cde049b52484f3
| records | 10.0.0.5 |
| status | PENDING |
| ttl | 50 |
| type | A |
| updated_at | None |
| version | 1 |
| zone_id | 103cace3-
| zone_name | fff.com. |
+------
rahul-vm1@vm1:~$
eg: DESCRIPTION TWICE
+++++++
+++++++
rahul-vm1@vm1:~$ openstack recordset create fff.com. --type A www.xyxzz --records 10.0.0.4 --records 10.0.0.5 --ttl 40 --ttl 50 --description "hello hows u" --description "iam fine "
+------
| Field | Value |
+------
| action | CREATE |
| created_at | 2017-03-
| description | iam fine |
| id | 543a74a1-
| name | www.xyxzz.fff.com. |
| project_id | 5cde049b52484f3
| records | 10.0.0.5 |
| status | PENDING |
| ttl | 50 |
| type | A |
| updated_at | None |
| version | 1 |
| zone_id | 103cace3-
| zone_name | fff.com. |
+------
rahul-vm1@vm1:~$ openstack recordset create fff.com. --type A www.check --records 10.0.0.4 --ttl 40 --description "hello hows u" --description "iam fine " +------
| Field | Value |
+------
| action | CREATE |
| created_at | 2017-03-
| description | iam fine |
| id | a8264e4a-
| name | www.check.fff.com. |
| project_id | 5cde049b52484f3
| records | 10.0.0.4 |
| status | PENDING |
| ttl | 40 |
| type | A |
| updated_at | None |
| version | 1 |
| zone_id | 103cace3-
| zone_name | fff.com. |
+------
rahul-vm1@vm1:~$
affects: | designate → python-designateclient |
Changed in python-designateclient: | |
status: | New → Confirmed |
importance: | Undecided → Low |
The failing command that is shown repeats the sequence " --type A www.xyz" twice, which is a combination of the type option and a positional parameter. As the command only takes two positional parameters, specifying a third one leads to the error that is seen. Specifying just "--type A" twice doesn't raise an error for me.
Having the second occurrence of a parameter override the first one is just working as designed.