yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #59829
[Bug 1648663] Re: Nova instance or other resource tags are allowed as empty string
Reviewed: https://review.openstack.org/408879
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7cad745ebac9e054ebc220d464c277f404f261e3
Submitter: Jenkins
Branch: master
commit 7cad745ebac9e054ebc220d464c277f404f261e3
Author: ghanshyam <ghanshyam.mann@xxxxxxxxxxxxxxxxxx>
Date: Fri Dec 9 10:33:35 2016 +0900
Stop allowing tags as empty string
Nova support tagging of instance or other resource like device etc.
But those tags are allowed to be as empty string which does not make
much sense or any real use case.
Updating single tag with empty string is not possible as it will
be 404 due to url itself has single tag as id.
But updating all tags with few or all of them as empty string
does not complain. In those cases, empty tags are being accepted and
stored as same.
Main issue with those is that empty tag cannot be deleted/show as single
tag as it will again 404 with url not found. Only way to delete/show
such tag is to delete all together.
Empty tag should not be allowed at first.
This commit makes empty string request to 400 which are
currently 200. Doing for server and device tags and same can
be adopted for other resource tagging also if any in future.
Fixing this as bug fix hoping no backward incompatibility
logically. If such tag could have been deleted alone then we could have
fix this with microversion.
Change-Id: I18a81f19205b2a40ca470067a9576f2f72ff0f13
Closes-Bug: #1648663
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1648663
Title:
Nova instance or other resource tags are allowed as empty string
Status in OpenStack Compute (nova):
Fix Released
Bug description:
Nova support tagging of instance or other resource like device etc.
But those tags are allowed to be as empty string which does not make
much sense or any use case.
[root@faydevnt ~] # curl -g -i -X PUT http://9.60.18.229:8774/v2.1/78649a9e795f4c42b1975a1f1d923c64/servers/57c948ae-753a-4549-b62e-b763e775e50f/tags -H "Accept: application/json" -H "User-Agent: python-novaclient" -H "OpenStack-API-Version: compute 2.37" -H "X-OpenStack-Nova-API-Version: 2.37" -H "X-Auth-Token: 4451f4afd5e54914984b621a2ffe2e68" -H "Content-Type: application/json" -d '{"tags": ["", ""]}'
HTTP/1.1 200 OK
Content-Length: 14
Content-Type: application/json
Openstack-Api-Version: compute 2.37
X-Openstack-Nova-Api-Version: 2.37
Vary: OpenStack-API-Version
Vary: X-OpenStack-Nova-API-Version
X-Compute-Request-Id: req-ae45d4fc-ba91-4863-ab35-590b287de631
Date: Thu, 08 Dec 2016 11:12:51 GMT
{"tags": [""]}[root@nova server-tag-list 57c948ae-753a-4549-b62e-b763e775e50f
+-----+
| Tag |
+-----+
| |
+-----+
Nova should 400 if any tag is requested with empty string. that can be
done easily visa json schema with minLength as 1.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1648663/+subscriptions
References