Server PUT update does not reject properties which can't be changed

Bug #1032546 reported by Rajalakshmi Ganesan
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Janis Gengeris

Bug Description

Description :

Updating a booted instance with personality file is not returning Bad Request. Personality file is not allowed to be updated once the instance is booted.

Expected result:
-----------------------
Should raise bad request exception. (Error code 400)

Refernce link:
------------------

http://docs.openstack.org/api/openstack-compute/2/content/ServerUpdate.html

LOG
---------

REQ: curl -i http://15.184.83.251:8774/v2/5e8e6e11adf74ee5b9141d4c6c5fad94/servers/7cb9a448-e3f9-4867-b6ad-aa6bd4f6fed4 PUT -H "X-Auth-Project-Id: nova_auto_project" -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: 424987eba9714778aabc72c3bbf6c747"

novaclient.client: DEBUG: REQ BODY: {"server": {"personality": [{"path": "/etc/banner.txt", "contents": "b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="}]}}

novaclient.client: DEBUG: RESP:{'date': 'Fri, 03 Aug 2012 06:47:55 GMT', 'status': '200', 'x-compute-request-id': 'req-ab7dd9ee-fd76-4058-98d5-5a11017e97b1', 'content-type': 'application/json', 'content-length': '1167'} {"server": {"status": "ACTIVE", "updated": "2012-08-03T06:47:11Z", "hostId": "c84667f0a75102fe2bd55ca8e02baaeb37c4806fba2d57ec9621e98a", "user_id": "c6b7b674f9514f7a94bf5251344042fa", "name": "update_server_active_0", "links": [{"href": "http://15.184.83.251:8774/v2/5e8e6e11adf74ee5b9141d4c6c5fad94/servers/7cb9a448-e3f9-4867-b6ad-aa6bd4f6fed4", "rel": "self"}, {"href": "http://15.184.83.251:8774/5e8e6e11adf74ee5b9141d4c6c5fad94/servers/7cb9a448-e3f9-4867-b6ad-aa6bd4f6fed4", "rel": "bookmark"}], "created": "2012-08-03T06:46:44Z", "tenant_id": "5e8e6e11adf74ee5b9141d4c6c5fad94", "image": {"id": "5509c976-a040-467b-88a8-6a6566202bb0", "links": [{"href": "http://15.184.83.251:8774/5e8e6e11adf74ee5b9141d4c6c5fad94/images/5509c976-a040-467b-88a8-6a6566202bb0", "rel": "bookmark"}]}, "OS-DCF:diskConfig": "MANUAL", "addresses": {"private": [{"version": 4, "addr": "10.0.0.23"}]}, "accessIPv4": "", "accessIPv6": "", "progress": 0, "flavor": {"id": "1", "links": [{"href": "http://15.184.83.251:8774/5e8e6e11adf74ee5b9141d4c6c5fad94/flavors/1", "rel": "bookmark"}]}, "config_drive": "", "id": "7cb9a448-e3f9-4867-b6ad-aa6bd4f6fed4", "metadata": {"meta": "HPCS-0"}}}

Revision history for this message
Mark McLoughlin (markmc) wrote :

I think this is actually intentional

e.g. if you GET a server, change the name and do a PUT, the request should succeed

So, the server update handler doesn't check whether you've specified attributes which cannot be changed

Revision history for this message
Mark McLoughlin (markmc) wrote :

FWIW, I reproduced this with:

 $> python
 >> import os
 >> import httplib2
 >> httplib2.debuglevel = 1
 >> from novaclient.v1_1.client import Client
 >> c = Client(os.environ.get('OS_USERNAME'), os.environ.get('OS_PASSWORD'), os.environ.get('OS_TENANT_NAME'), os.environ.get('OS_AUTH_URL'), service_type='compute', http_log_debug=True)
 >> s = c.servers.list()[0]
 >> s.manager._update('/servers/' + s.id, {'server': { 'personality' : [{'path': '/etc/banner.txt', 'contents': 'b25zLiINCg0KLVJpY2hhcmQgQmFjaA=='}]}})

summary: - Updating an instance with Personality file is not raising bad Request
+ Server PUT update does not reject properties which can't be changed
Changed in nova:
status: New → Won't Fix
Revision history for this message
Brian Waldon (bcwaldon) wrote :

I'm fine with ignoring properties on PUT that are returned as part of a GET request. However, I don't think personality is one of those properties and it should raise an exception.

Changed in nova:
status: Won't Fix → Incomplete
Brian Waldon (bcwaldon)
Changed in nova:
status: Incomplete → Triaged
importance: Undecided → Low
Janis Gengeris (janisg)
Changed in nova:
assignee: nobody → Janis Gengeris (janisg)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/18793

Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/18793
Committed: http://github.com/openstack/nova/commit/86008a67aade0d8830bf353395729fa55e54b8d8
Submitter: Jenkins
Branch: master

commit 86008a67aade0d8830bf353395729fa55e54b8d8
Author: Janis Gengeris <email address hidden>
Date: Tue Jan 1 17:14:18 2013 +0200

    Raise BadRequest when updating 'personality'

    Updating booted server instance through server PUT API call with
    'personality' property set is not returning 'Bad Request', although the
    property is not allowed to be updated once the instance is booted.

    This fixes the described problem.

    Fixes bug #1032546

    Change-Id: Ia086f5ea5176640a9916a3ba42c79d4d5944ce76

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-2 → 2013.1
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.