yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #39741
[Bug 1284986] Re: Filter of port details with field parameter as junk value is not throwing error
** Changed in: neutron
Status: Incomplete => Confirmed
** Changed in: neutron
Importance: Undecided => Medium
** Project changed: neutron => python-neutronclient
** Tags added: released-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/1284986
Title:
Filter of port details with field parameter as junk value is not
throwing error
Status in python-neutronclient:
Confirmed
Bug description:
Description:
neutron port-show <port-id> would give us the details about particular port. When we filter the details of port by mentioning --field parameter, we get details of only mentioned field.
When --field parameter value is given as junk, there is no error code
and proper error message returned. Instead we get 200 as response code
and improper error message
Also if the junk field is mentioned along with one or more valid
fields, it simply neglects the junk field as long as we give at least
one valid field.
Steps to reproduce:
1. Do neutron port-list and get list of ports to note ID of any one port
2. neutron port-show <id> --field JUNK
Actual Result:
Response code 200 and Error message: "need more than 0 values to unpack"
Expected Result:
Must return 400 as response code as the request is a bad request.
and Error message should be " The field parameter value entered is invalid"
LOG:
# A single invalid field
REQ: curl -i http://127.0.0.1:9696/v2.0/ports/023f2108-3524-47b3-aa5a-
ebe10d37deb9.json?fields=dedjfsdgfj -X GET -H "X-Auth-Token: <Token
–Omitted>" -H "Content-Type: application/json" -H "Accept:
application/json" -H "User-Agent: python-neutronclient"
RESP:{'date': 'Wed, 26 Feb 2014 05:22:08 GMT', 'status': '200',
'content-length': '12', 'content-type': 'application/json;
charset=UTF-8', 'content-location':
'http://127.0.0.1:9696/v2.0/ports/023f2108-3524-47b3-aa5a-
ebe10d37deb9.json?fields=dedjfsdgfj'} {"port": {}}
need more than 0 values to unpack
venkater@ravi-tempest-devstack2:~$
---------------------------------------------------------------------
# Interestingly it simply neglects a junk filed as long as you give at
least one valid field! This holds even with more valid fields.
curl -i http://127.0.0.1:9696/v2.0/ports/023f2108-3524-47b3-aa5a-
ebe10d37deb9.json?fields=id&fields=dedjfsdgfj -X GET -H "X-Auth-Token:
<Token –Omitted>" -H "Content-Type: application/json" -H "Accept:
application/json" -H "User-Agent: python-neutronclient"
RESP:{'date': 'Wed, 26 Feb 2014 05:29:16 GMT', 'status': '200',
'content-length': '56', 'content-type': 'application/json;
charset=UTF-8', 'content-location':
'http://127.0.0.1:9696/v2.0/ports/023f2108-3524-47b3-aa5a-
ebe10d37deb9.json?fields=id&fields=dedjfsdgfj'} {"port": {"id":
"023f2108-3524-47b3-aa5a-ebe10d37deb9"}}
# Giving id , junk and another valid field
curl -i http://127.0.0.1:9696/v2.0/ports/023f2108-3524-47b3-aa5a-ebe10d37deb9.json?fields=id&fields=nnnjsj&fields=name -X GET -H "X-Auth-Token: <Token –Omitted>" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-neutronclient"
RESP:{'date': 'Wed, 26 Feb 2014 05:35:01 GMT', 'status': '200',
'content-length': '108', 'content-type': 'application/json;
charset=UTF-8', 'content-location':
'http://127.0.0.1:9696/v2.0/ports/023f2108-3524-47b3-aa5a-
ebe10d37deb9.json?fields=id&fields=nnnjsj&fields=name'} {"port":
{"id": "023f2108-3524-47b3-aa5a-ebe10d37deb9", "name": "vip-
20da0078-e8e0-4ef8-9d65-a03e54850d45"}}
To manage notifications about this bug go to:
https://bugs.launchpad.net/python-neutronclient/+bug/1284986/+subscriptions
References