wrong parse of 'port-type' parameter in nimbleclient

Bug #1652551 reported by Liusheng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-moganclient
Fix Released
Undecided
Liusheng

Bug Description

when creating a server with 'port-type' parameter specified, the parameter 'port-type' will be passed to API side, but nimble need the parameter should be 'port_type'.

root@liusheng:/opt/stack/python-nimbleclient# openstack baremetal server create --flavor small --image 8377ecfe-a868-429e-94eb-19f8659e1141 --nic uuid=552a7db7-a3c4-4a44-bb2e-f75c64049678,port-type=test test3
Bad Request (HTTP 400)

logs in nimble-api.log:

2016-12-26 10:24:07.866 6895 DEBUG wsme.api [req-28614a8b-616d-48d1-99a6-ca756ee9c4e9 428e2cc46aa1462aad5ffe765d0ba291 f8e959fc9cdc4072a9ae0a8d64336aca default - -] Client-side error: Invalid create body: Additional properties are not allowed ('port-type' was unexpected)

Failed validating 'additionalProperties' in schema['properties']['networks']['items']:
    {'additionalProperties': False,
     'properties': {'port_type': {'maxLength': 255,
                                  'minLength': 1,
                                  'type': 'string'},
                    'uuid': {'format': 'uuid', 'type': 'string'}},
     'required': ['uuid'],
     'type': 'object'}

On instance['networks'][0]:
    {'port-type': 'test', 'uuid': '552a7db7-a3c4-4a44-bb2e-f75c64049678'} format_exception /usr/local/lib/python2.7/dist-packages/wsme/api.py:221

Liusheng (liusheng)
Changed in python-nimbleclient:
assignee: nobody → Liusheng (liusheng)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-nimbleclient (master)

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

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

Reviewed: https://review.openstack.org/414787
Committed: https://git.openstack.org/cgit/openstack/python-nimbleclient/commit/?id=925de8b965b6d2251786d3c88afb833ddc66db33
Submitter: Jenkins
Branch: master

commit 925de8b965b6d2251786d3c88afb833ddc66db33
Author: liusheng <email address hidden>
Date: Mon Dec 26 10:37:03 2016 +0800

    Change 'port-type' to 'port_type' when pass the parameter to API

    The nimble api require 'port_type' when creating a server with port type
    specified, but currently the client pass a 'port-type' parameter.

    Change-Id: I4be883d41e5b8174f1870f2ed41f1d325a01537d
    Closes-Bug: #1652551

Changed in python-nimbleclient:
status: In Progress → Fix Released
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.