Ironic should raise an error when updating unsupported field

Bug #1626977 reported by Kyrylo Romanenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Expired
High
Unassigned

Bug Description

Ironic should raise an error when updating unsupported field.

Try to update port LLC data field using a version of API that does not support llc.

$ ironic --ironic-api-version 1.6 port-update 9abc4e9a-e5a5-4184-b9b5-3e287f64a6c9 replace local_link_connection/switch_id='aa:bb:cc:dd:ee:ff'
+-----------------------+--------------------------------------+
| Property | Value |
+-----------------------+--------------------------------------+
| address | 52:54:00:f4:f3:e6 |
| created_at | 2016-09-22T15:08:37+00:00 |
| extra | {} |
| internal_info | |
| local_link_connection | |
| node_uuid | ba805435-0bc3-4dcf-b637-87d04f672d25 |
| pxe_enabled | |
| updated_at | 2016-09-23T10:29:39+00:00 |
| uuid | 9abc4e9a-e5a5-4184-b9b5-3e287f64a6c9 |
+-----------------------+--------------------------------------+

Ironic client silently accepted local_link_connection data. Of course it was not saved with unsupported api, but expected to get at least some warning.

Ironic API and Conductor logs for this operation:

API:
2016-09-23 06:59:23.909 10958 INFO eventlet.wsgi.server [req-b51261e2-cdef-4f37-8684-a67bb48a34dd admin admin - - -] 127.0.0.1 "PATCH /v1/ports/9abc4e9a-e5a5-4184-b9b5-3e287f64a6c9 HTTP/1.1" status: 200 len: 776 time: 0.230253

Conductor:

2016-09-23 06:59:00.962 11140 DEBUG ironic.conductor.manager [req-3f420ca8-7c9e-4961-a18d-18cfda3342ce - - - - -] RPC update_port called for port 9abc4e9a-e5a5-4184-b9b5-3e287f64a6c9. update_port /opt/stack/new/ironic/ironic/conductor/manager.py:1667
2016-09-23 06:59:00.965 11140 DEBUG ironic.conductor.task_manager [req-3f420ca8-7c9e-4961-a18d-18cfda3342ce - - - - -] Attempting to get exclusive lock on node 1 (for port update) __init__ /opt/stack/new/ironic/ironic/conductor/task_manager.py:209
2016-09-23 06:59:00.997 11140 DEBUG ironic.conductor.task_manager [req-3f420ca8-7c9e-4961-a18d-18cfda3342ce - - - - -] Node ba805435-0bc3-4dcf-b637-87d04f672d25 successfully reserved for port update (took 0.03 seconds) reserve_node /opt/stack/new/ironic/ironic/conductor/task_manager.py:251
2016-09-23 06:59:01.039 11140 DEBUG ironic.conductor.task_manager [req-3f420ca8-7c9e-4961-a18d-18cfda3342ce - - - - -] Successfully released exclusive lock for port update on node ba805435-0bc3-4dcf-b637-87d04f672d25 (lock was held 0.04 sec) release_resources /opt/stack/new/ironic/ironic/conductor/task_manager.py:330

Dmitry Tantsur (divius)
Changed in ironic:
importance: Undecided → High
status: New → Triaged
tags: added: low-hanging-fruit
Vadim Hmyrov (vhmyrov)
Changed in ironic:
assignee: nobody → Vadim Hmyrov (vhmyrov)
Revision history for this message
Vadim Hmyrov (vhmyrov) wrote :

CNR on latest master branch.

Revision history for this message
Varun Gadiraju (varun-gadiraju) wrote :

CNR on latest master branch for me as well. When I tried the command, the following error was raised

"Couldn't apply patch '[{'path': '/local_link_connection/switch_id', 'value': u'aa:bb:cc:dd:ee:ff', 'op': 'replace'}]'. Reason: can't replace non-existent object 'switch_id' (HTTP 400)"

 I think this bug can be closed.

Revision history for this message
Jay Faulkner (jason-oldos) wrote :

I'm marking this incomplete. Please let us know if you're still experiencing the bug. If so, please give us very specific reproduction instructions, including the release of Ironic you're experiencing this issue on.

If you also believe the issue is gone, let us know as well and we'll close the bug.

Thanks,
Jay

Changed in ironic:
status: Triaged → Incomplete
assignee: Vadim Hmyrov (vhmyrov) → nobody
Revision history for this message
Kyrylo Romanenko (kromanenko) wrote :

I reproduced it on Devstack with additional patches in localrc configuration related to portgroups:

enable_plugin ironic git://git.openstack.org/openstack/ironic refs/changes/47/360647/10
and
IRONICCLIENT_BRANCH=refs/changes/30/362130/9

Revision history for this message
Galyna Zholtkevych (gzholtkevych) wrote :

I reproduced it on master devstack and got the following
ironic@iron:~/devstack$ ironic port-show a7196a00-3316-4df4-9419-a2b6e57fbe19
+-----------------------+--------------------------------------+
| Property | Value |
+-----------------------+--------------------------------------+
| address | 52:54:00:d0:1c:e2 |
| created_at | 2016-10-07T12:37:58+00:00 |
| extra | {u'foo': u'val1'} |
| internal_info | |
| local_link_connection | |
| node_uuid | 0c8f0101-96c6-46f2-8b2a-fd6376fa715d |
| pxe_enabled | |
| updated_at | 2016-10-10T08:09:47+00:00 |
| uuid | a7196a00-3316-4df4-9419-a2b6e57fbe19 |
+-----------------------+--------------------------------------+
ironic@iron:~/devstack$ ironic --ironic-api-version 1.6 port-update a7196a00-3316-4df4-9419-a2b6e57fbe19 replace local_link_connection/switch_id='aa:bb:cc:dd:ee:ff'
Couldn't apply patch '[{'path': '/local_link_connection/switch_id', 'value': u'aa:bb:cc:dd:ee:ff', 'op': 'replace'}]'. Reason: can't replace non-existent object 'switch_id' (HTTP 400)

So it indeed raises appropriate error message

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Ironic because there has been no activity for 60 days.]

Changed in ironic:
status: Incomplete → Expired
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.