Neutron: Improper error message coming during subnetpool creation with default_quota

Bug #1667286 reported by Puneet Arora
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
Won't Fix
Low
Unassigned

Bug Description

Below scenario showing incorrect error message:

# neutron subnetpool-create --shared --pool-prefix 203.0.113.0/24 --default_quota 100 --default-prefixlen 26 subnetpool
Invalid input for operation: 'subnetpool' is not an integer.
Neutron server returns request_ids: ['req-a754883e-fbd6-4f26-8ee1-fc02926842f8']

Now if I put '--default_quota 100' at the end of the command then no error is coming:
# neutron subnetpool-create --shared --pool-prefix 203.0.113.0/24 --default-prefixlen 26 suabnetpool --default_quota 100
Created a new subnetpool:

So command should throw proper error message if we put --default_quota in the middle of the command.

Detailed commands pasted here:
http://paste.openstack.org/show/600210/

Revision history for this message
Reedip (reedip-banerjee-deactivatedaccount) wrote :

Thanks.
Yes, this is an issue with the NeutronClient, but not in neutron.
Additional Finding : OpenstackClient lacks -default-quotas option from [1].

[1]: https://github.com/openstack/neutron/blob/a0e0e8b6686b847a4963a6aa6a3224b5768544e6/neutron/api/v2/attributes.py#L239

affects: neutron → python-neutronclient
Revision history for this message
Victor Morales (electrocucaracha) wrote :

The same happens with other integer options[1] but given that this has a workaround(changing the order of the arguments) and python-neutronclient is in process to be deprecated, I consider that it has lower impact.

[1] https://github.com/openstack/python-neutronclient/blob/master/neutronclient/neutron/v2_0/subnetpool.py#L33-L41

Changed in python-neutronclient:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Akihiro Motoki (amotoki) wrote :

This is a known problem of neutron CLI behavior.

>>>> Workaround: Specify unknown options at the end of command line <<<<

Neutron CLI has a feature to interpret unknown options (which are not registered as known options) as neutron resource attributes and pass them to a neutron API. However, this feature is not friendly with python argparse (option parsing library) and as a result users will get unexpected behavior.

This is the case. Unknown options are specified in a middle of command line and '26' is interpreted as subnet pool ID and 'subnetpool' is interpreted as a requested quota value.

This neutron CLI behavior is really tricky and should go away, but there is no practical way to fix it without affecting existing behavior. We decided to keep the behavior as is and when we migrate our CLI to OpenStack client we don't have "unknown options" feature anymore.

Changed in python-neutronclient:
status: Confirmed → Won't Fix
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.