linux bridge fixes following v1 code removal.
Change-Id: I4ad84421757db271904c8704a12b2e7abdfa8a0e
This commit is contained in:
parent
ab9d1b8c7a
commit
a8d9ed9181
@ -19,12 +19,15 @@ import logging
|
||||
|
||||
from webob import exc
|
||||
|
||||
from quantum.api import faults
|
||||
from quantum import wsgi
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
# Port Status
|
||||
PORT_STATUS_UP = "UP"
|
||||
PORT_STATUS_DOWN = "DOWN"
|
||||
|
||||
|
||||
class QuantumController(object):
|
||||
""" Base controller class for Quantum API """
|
||||
|
@ -303,7 +303,7 @@ def set_port_status(port_id, status):
|
||||
try:
|
||||
port = session.query(models_v2.Port).filter_by(id=port_id).one()
|
||||
port['status'] = status
|
||||
if status == api_common.OperationalStatus.DOWN:
|
||||
if status == api_common.PORT_STATUS_DOWN:
|
||||
port['device_id'] = ''
|
||||
session.merge(port)
|
||||
session.flush()
|
||||
|
@ -64,7 +64,7 @@ class LinuxBridgeRpcCallbacks():
|
||||
'port_id': port['id'],
|
||||
'admin_state_up': port['admin_state_up']}
|
||||
# Set the port status to UP
|
||||
cdb.set_port_status(port['id'], api_common.OperationalStatus.UP)
|
||||
cdb.set_port_status(port['id'], api_common.PORT_STATUS_UP)
|
||||
else:
|
||||
entry = {'device': device}
|
||||
LOG.debug("%s can not be found in database", device)
|
||||
@ -81,7 +81,7 @@ class LinuxBridgeRpcCallbacks():
|
||||
entry = {'device': device,
|
||||
'exists': True}
|
||||
# Set port status to DOWN
|
||||
cdb.set_port_status(port['id'], api_common.OperationalStatus.DOWN)
|
||||
cdb.set_port_status(port['id'], api_common.PORT_STATUS_UP)
|
||||
else:
|
||||
entry = {'device': device,
|
||||
'exists': False}
|
||||
|
Loading…
Reference in New Issue
Block a user