Public bug reported: Hi colleagues,
Neutron 10.0.0 (as part Ocata) on Ubuntu 16.04 Everything is ok when I use Neutron CLI to update port parameters, but when I'm doing the same using Heat, it fails. Heat's template for the object is: e-secgroup: type: OS::Neutron::SecurityGroup properties: name: SSH_ICMP rules: - direction: ingress - protocol: tcp remote_ip_prefix: 0.0.0.0/0 port_range_min: 22 port_range_max: 22 - protocol: icmp remote_ip_prefix: 0.0.0.0/0 node1-wan: type: OS::Neutron::Port properties: name: jadm-node1-wan network: e-net port_security_enabled: True security_groups: [ default, { get_resource: e-secgroup } ] Heat makes a call to Neutron using neutronclient and provides input parameters in such way: updating port with {'allowed_address_pairs': [], 'binding:vnic_type': None, 'device_owner': None, 'mac_address': None, 'security_groups': [u '53ede63e-b08f-4c95-b5fe-29cd21ed442a', u'0a48c45e-5a6d- 4b80-8226-08d2e8c5bb00'], 'device_id': None} handle_update /usr/lib/python2.7/dist- packages/heat/engine/resources/openstack/neutron/port.py:520 In return, I get the following error: 2017-04-11 09:51:31.809 14474 DEBUG neutronclient.v2_0.client [req- 54a51260-8701-4f94-9141-562443a3ad7e - bush - - -] Error message: {"NeutronError": {"message": "Invalid input for device_owner. Reason: 'None' is not a valid string.", "type": "HTTPBadRequest", "detail": ""}} _handle_fault_response /usr/lib/python2.7/dist- packages/neutronclient/v2_0/client.py:266 If I explicitly set device_owner='' in Heat template, then neutronclient accepts this key-value pair and returns error for the next parameter (e.g. device_id): 2017-04-11 10:45:26.808 14474 DEBUG neutronclient.v2_0.client [req- 3f5c1c53-bec4-418f-bc0e-e04b23474c0e - bush - - -] Error message: {"NeutronError": {"message": "Invalid input for device_id. Reason: 'None' is not a valid string.", "type": "HTTPBadRequest", "detail": ""}} _handle_fault_response /usr/lib/python2.7/dist- packages/neutronclient/v2_0/client.py:266 and this affects not only parameters of OS::Neutron::Port object, but OS::Neutron::SecurityGroup's ones as well: Resource UPDATE failed: BadRequest: resources.e-secgroup: Invalid input for description. Reason: 'None' is not a valid string. Neutron server returns request_ids: ['req-287db7f6-06be-4bc8-a11b-94be203c67da'] So, the problem is general and it seems that something wrong with treatment of 'None' in input parameters: all clients should always treat None values the same as not passing any value, while neutronclient accepts '' and refuses None. Severity: this bug blocks using Heat. Thank you. ** Affects: neutron Importance: Undecided Status: New ** Tags: neutron 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/1681784 Title: neutronclient: incorrect treatment of input parameters Status in neutron: New Bug description: Hi colleagues, Neutron 10.0.0 (as part Ocata) on Ubuntu 16.04 Everything is ok when I use Neutron CLI to update port parameters, but when I'm doing the same using Heat, it fails. Heat's template for the object is: e-secgroup: type: OS::Neutron::SecurityGroup properties: name: SSH_ICMP rules: - direction: ingress - protocol: tcp remote_ip_prefix: 0.0.0.0/0 port_range_min: 22 port_range_max: 22 - protocol: icmp remote_ip_prefix: 0.0.0.0/0 node1-wan: type: OS::Neutron::Port properties: name: jadm-node1-wan network: e-net port_security_enabled: True security_groups: [ default, { get_resource: e-secgroup } ] Heat makes a call to Neutron using neutronclient and provides input parameters in such way: updating port with {'allowed_address_pairs': [], 'binding:vnic_type': None, 'device_owner': None, 'mac_address': None, 'security_groups': [u '53ede63e-b08f-4c95-b5fe-29cd21ed442a', u'0a48c45e-5a6d- 4b80-8226-08d2e8c5bb00'], 'device_id': None} handle_update /usr/lib/python2.7/dist- packages/heat/engine/resources/openstack/neutron/port.py:520 In return, I get the following error: 2017-04-11 09:51:31.809 14474 DEBUG neutronclient.v2_0.client [req- 54a51260-8701-4f94-9141-562443a3ad7e - bush - - -] Error message: {"NeutronError": {"message": "Invalid input for device_owner. Reason: 'None' is not a valid string.", "type": "HTTPBadRequest", "detail": ""}} _handle_fault_response /usr/lib/python2.7/dist- packages/neutronclient/v2_0/client.py:266 If I explicitly set device_owner='' in Heat template, then neutronclient accepts this key-value pair and returns error for the next parameter (e.g. device_id): 2017-04-11 10:45:26.808 14474 DEBUG neutronclient.v2_0.client [req- 3f5c1c53-bec4-418f-bc0e-e04b23474c0e - bush - - -] Error message: {"NeutronError": {"message": "Invalid input for device_id. Reason: 'None' is not a valid string.", "type": "HTTPBadRequest", "detail": ""}} _handle_fault_response /usr/lib/python2.7/dist- packages/neutronclient/v2_0/client.py:266 and this affects not only parameters of OS::Neutron::Port object, but OS::Neutron::SecurityGroup's ones as well: Resource UPDATE failed: BadRequest: resources.e-secgroup: Invalid input for description. Reason: 'None' is not a valid string. Neutron server returns request_ids: ['req-287db7f6-06be-4bc8-a11b- 94be203c67da'] So, the problem is general and it seems that something wrong with treatment of 'None' in input parameters: all clients should always treat None values the same as not passing any value, while neutronclient accepts '' and refuses None. Severity: this bug blocks using Heat. Thank you. To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1681784/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp