Unexpected behavior when "-d" is specified twice on ironic chassis-create

Bug #1645194 reported by abdul nizamuddin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-ironicclient
Triaged
Medium
Unassigned

Bug Description

when the user enters a command "ironic chassis-create -d "test" -d "testing", it takes "testing" as a description and it avoids "test".So its avoiding the first argument and even it is not showing any erros messages.

# ironic chassis-create -d "test" -d "testing"
+-------------+--------------------------------------+
| Property | Value |
+-------------+--------------------------------------+
| description | testing |
| extra | {} |
| uuid | 306acc4b-e6b9-4cd6-b582-553c2d86e61f |
+-------------+--------------------------------------+

So we can do some changes in code so that when user enters this type of commands ,ironic client should give a error messages to restrict the usage of "-d" option twice in a command.

This problem is exist for ironic port-create too, for -n and -a options.

Changed in python-ironicclient:
assignee: nobody → abdul nizamuddin (abdul-nizamuddin)
description: updated
summary: - option -d is not throwing any erros if user uses -d option twice
+ Unexpected behavior when "-d" is specified twice on ironic chassis-
+ create
Changed in python-ironicclient:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Vadim Hmyrov (vhmyrov) wrote :

Hi Abdul, are you still working on this?

M V P Nitesh (m-nitesh)
Changed in python-ironicclient:
assignee: abdul nizamuddin (abdul-nizamuddin) → M V P Nitesh (m-nitesh)
M V P Nitesh (m-nitesh)
Changed in python-ironicclient:
assignee: M V P Nitesh (m-nitesh) → nobody
Changed in python-ironicclient:
assignee: nobody → Thomas Maddox (thomas-maddox)
Revision history for this message
Thomas Maddox (thomas-maddox) wrote :

It's standard behavior for a CLI to use the last specified value for any particular option if you set more than once. I propose we don't make the proposed changes and set this bug to "invalid". I don't know of any tools that error because you specify an option multiple times like this. For options that are meant to have a single value, it's supposed to use the last one specified; for those that are expecting a multiple values, it's supposed to append. This is the standard way Python's argparse handles arguments, and I see no reason to diverge from that as seems consistent with behavior of most other CLIs.

Changed in python-ironicclient:
assignee: Thomas Maddox (thomas-maddox) → nobody
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.