ensure neutron port usable by port status

Change-Id: Ib156999c860d777f75ed69a47d2320c3cfbb1c11
This commit is contained in:
WangChangyu
2018-01-31 17:03:20 +08:00
parent 5a776a2a33
commit e7ff789ec4

View File

@@ -89,7 +89,7 @@ class NeutronAPI(object):
if port.get('device_id'):
raise exception.PortInUse(port=port['id'])
if port.get('status') == (n_const.PORT_STATUS_ACTIVE,
if port.get('status') in (n_const.PORT_STATUS_ACTIVE,
n_const.PORT_STATUS_BUILD,
n_const.PORT_STATUS_ERROR):
raise exception.PortNotUsable(port=port['id'])