yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #44874
[Bug 1535209] Re: No error raised when exec router-gateway-update with wrong attr
@Bo chi : That may be because Neutron Client is passing the value as an extra argument.
NeutronClient has the provision to pass attributes to the neutron server, even if the attributes are not listed for the specified CLI.
You can try to execute the above CLI with -v.
That is how the NeutronClient CLI has been defined.
For example :
On executing the following CLI
-> neutron -v router-list --Ok
I get the following request URI:
DEBUG: keystoneauth.session REQ: curl -g -i -X GET http://10.0.2.15:9696/v2.0/routers.json?Ok=True -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}9b464b1b710560c3c08a216337e472b24b8a724f"
Even though --Ok is not an attribute in the router-list CLI
usage: neutron router-list [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]
[--max-width <integer>] [--noindent]
[--quote {all,minimal,none,nonnumeric}]
[--request-format {json}] [-D] [-F FIELD] [-P SIZE]
[--sort-key FIELD] [--sort-dir {asc,desc}]
In the above CLI, --fix-ip or --wrong-argument is not parsed.
For example, please find the pasted output here.(http://paste.openstack.org/show/484220/)
You can see how the --wrong_attr is sent to the NeutronClient and it is
accepted and but not passed as that is expected behaviour from
NeutronClient for extra attributes ( beginning with --)
** Project changed: neutron => python-neutronclient
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1535209
Title:
No error raised when exec router-gateway-update with wrong attr
Status in python-neutronclient:
New
Bug description:
Tested on Devstack environment and master version.
When running `neutron router-gateway-set` command, if the attribute is wrong, there will be no error printed, update will success, and corresponding field is not updated
Here the right attribute is `--fixed-ip`, but if you type `--fix-ip` or `--wrong attribute` in `neutron router-gateway-set`, no error shows.
$ neutron router-gateway-set 1c87da7d-f0d7-42a8-964a-8c916ffbd1b4 public --fix-ip subnet_id=7ebd8fc9-def1-47f1-97e0-e28c51dc591c,ip_address=172.24.4.8
Set gateway for router 1c87da7d-f0d7-42a8-964a-8c916ffbd1b4
bochi@stack: ~(admin)$ neutron router-list
+--------------------------------------+---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------+
| id | name | external_gateway_info | distributed | ha |
+--------------------------------------+---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------+
| 1c87da7d-f0d7-42a8-964a-8c916ffbd1b4 | router1 | {"network_id": "b92781fe-2d31-49a6-b648-98d937faf0b8", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "7ebd8fc9-def1-47f1-97e0-e28c51dc591c", "ip_address": "172.24.4.8"}]} | False | False |
Summary:
- If run `neutron router-gateway-set router net --wrong` which has a wrong
attribute, update will success
+ run `router-gateway-set` with wrong attribute should print an error
To manage notifications about this bug go to:
https://bugs.launchpad.net/python-neutronclient/+bug/1535209/+subscriptions
References