type not throwing any error message when repeated twice while creating record

Bug #1675719 reported by Rahul Yadav
8
This bug affects 1 person
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-24T10:13:39.000000 |
| description | None |
| id | 73c8839e-5437-4ecb-b50f-e224cb895ef8 |
| name | www.abc.fff.com. |
| project_id | 5cde049b52484f30b858507f152b3220 |
| records | 10.0.0.4 |
| status | PENDING |
| ttl | None |
| type | A |
| updated_at | None |
| version | 1 |
| zone_id | 103cace3-c25a-4e7f-bd24-98e2d6d321ec |
| 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,table,value,yaml}]
                                  [-c COLUMN] [--max-width <integer>]
                                  [--print-empty] [--noindent]
                                  [--prefix PREFIX] --records RECORDS
                                  [RECORDS ...] --type TYPE [--ttl TTL]
                                  [--description DESCRIPTION] [--all-projects]
                                  [--edit-managed]
                                  [--sudo-project-id SUDO_PROJECT_ID]
                                  zone_id name
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-24T10:19:02.000000 |
| description | None |
| id | 0cb610c0-c213-416a-81be-a1471c39b87a |
| name | www.xyz.fff.com. |
| project_id | 5cde049b52484f30b858507f152b3220 |
| records | 10.0.0.4 |
| status | PENDING |
| ttl | 50 |
| type | A |
| updated_at | None |
| version | 1 |
| zone_id | 103cace3-c25a-4e7f-bd24-98e2d6d321ec |
| 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-24T10:19:32.000000 |
| description | None |
| id | 83a3cec6-3ca3-438d-9a5b-ee509f82246c |
| name | www.xyxz.fff.com. |
| project_id | 5cde049b52484f30b858507f152b3220 |
| records | 10.0.0.5 |
| status | PENDING |
| ttl | 50 |
| type | A |
| updated_at | None |
| version | 1 |
| zone_id | 103cace3-c25a-4e7f-bd24-98e2d6d321ec |
| 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-24T10:22:18.000000 |
| description | iam fine |
| id | 543a74a1-ccba-4273-be04-b4e1e6901ad9 |
| name | www.xyxzz.fff.com. |
| project_id | 5cde049b52484f30b858507f152b3220 |
| records | 10.0.0.5 |
| status | PENDING |
| ttl | 50 |
| type | A |
| updated_at | None |
| version | 1 |
| zone_id | 103cace3-c25a-4e7f-bd24-98e2d6d321ec |
| 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-24T10:22:42.000000 |
| description | iam fine |
| id | a8264e4a-744e-4629-b935-8929d2a38146 |
| name | www.check.fff.com. |
| project_id | 5cde049b52484f30b858507f152b3220 |
| records | 10.0.0.4 |
| status | PENDING |
| ttl | 40 |
| type | A |
| updated_at | None |
| version | 1 |
| zone_id | 103cace3-c25a-4e7f-bd24-98e2d6d321ec |
| zone_name | fff.com. |
+-------------+--------------------------------------+
rahul-vm1@vm1:~$

Tim Simmons (timsim)
affects: designate → python-designateclient
Changed in python-designateclient:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

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.

Changed in python-designateclient:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.