openstack port set e8dbb90b-4e1d-4f65-a752-804c503ae7f2 --allowed-address ip-address=x.x.x.x does not work.
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Juniper Openstack | Status tracked in Trunk | |||||
R3.2 |
Fix Committed
|
Undecided
|
Keyur R. Golani | |||
R4.0 |
Fix Committed
|
Undecided
|
Keyur R. Golani | |||
Trunk |
Fix Committed
|
Undecided
|
Keyur R. Golani |
Bug Description
Using the openstack client you cannot set an allowed addresspair when a port has been created without an allowed address pair.
e.g.:
# openstack port create --network xxx-xxx-xxx bla
# openstack port set xxx-xxxx-
'NoneType' object is not iterable
This is because the neutron/contrail plugin (3.2.1) will not return a value for allowed_
Example response body from contrail neutron:
RESP BODY: {"port": {"status": "ACTIVE", "name": "XXXXXX", "admin_state_up": true, "network_id": "XXXXXX", "tenant_id": "XXXXXX", "binding:
While regular neutron will include an emply list for allowed_
Example response body from regular, non-contrail, neutron:
RESP BODY: {"port": {"status": "ACTIVE", "binding:host_id": "", "allowed_
As you can see "allowed_
My guess is that other fields missing default values will have the same issue (like extra_dhcp_opts)
Note that the command will work with the old "neutron cli" but that is deprecated.
information type: | Public → Public Security |
tags: | added: config |
tags: | added: att-aic-contrail |
"openstack port create" was introduced in Newton.
Could it be fixed here in https:/ /github. com/Juniper/ contrail- neutron- plugin/ blob/master/ neutron_ plugin_ contrail/ plugins/ opencontrail/ vnc_client/ vmi_res_ handler. py?
def _get_allowed_ adress_ pairs(vmi_ obj):
allowed_ address_ pairs = (
vmi_ obj.get_ virtual_ machine_ interface_ allowed_ address_ pairs() ) address_ pairs and
allowed_ address_ pairs.allowed_ address_ pair):
address_ pairs = [] address_ pairs.allowed_ address_ pair:
pair = {}
pair[ 'mac_address' ] = aap.mac get_ip_ prefix_ len() == 32:
pair[ 'ip_address' ] = '%s' % (aap.ip. get_ip_ prefix( ))
else:
pair[ 'ip_address' ] = '%s/%s' % (aap.ip. get_ip_ prefix( ),
aap. ip.get_ ip_prefix_ len())
address_ pairs.append( pair)
if (allowed_
for aap in allowed_
if aap.ip.
return address_pairs
by moving address_pairs = [] before the if clause "if (allowed_ address_ pairs and
allowed_ address_ pairs.allowed_ address_ pair):"
and "return address_pairs" out of the if clause
This could make it returning allowed_ address_ pairs[] in the vmi response even if it's not set.