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 webob import exc
|
||||||
|
|
||||||
from quantum.api import faults
|
|
||||||
from quantum import wsgi
|
from quantum import wsgi
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# Port Status
|
||||||
|
PORT_STATUS_UP = "UP"
|
||||||
|
PORT_STATUS_DOWN = "DOWN"
|
||||||
|
|
||||||
|
|
||||||
class QuantumController(object):
|
class QuantumController(object):
|
||||||
""" Base controller class for Quantum API """
|
""" Base controller class for Quantum API """
|
||||||
|
@ -303,7 +303,7 @@ def set_port_status(port_id, status):
|
|||||||
try:
|
try:
|
||||||
port = session.query(models_v2.Port).filter_by(id=port_id).one()
|
port = session.query(models_v2.Port).filter_by(id=port_id).one()
|
||||||
port['status'] = status
|
port['status'] = status
|
||||||
if status == api_common.OperationalStatus.DOWN:
|
if status == api_common.PORT_STATUS_DOWN:
|
||||||
port['device_id'] = ''
|
port['device_id'] = ''
|
||||||
session.merge(port)
|
session.merge(port)
|
||||||
session.flush()
|
session.flush()
|
||||||
|
@ -64,7 +64,7 @@ class LinuxBridgeRpcCallbacks():
|
|||||||
'port_id': port['id'],
|
'port_id': port['id'],
|
||||||
'admin_state_up': port['admin_state_up']}
|
'admin_state_up': port['admin_state_up']}
|
||||||
# Set the port status to 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:
|
else:
|
||||||
entry = {'device': device}
|
entry = {'device': device}
|
||||||
LOG.debug("%s can not be found in database", device)
|
LOG.debug("%s can not be found in database", device)
|
||||||
@ -81,7 +81,7 @@ class LinuxBridgeRpcCallbacks():
|
|||||||
entry = {'device': device,
|
entry = {'device': device,
|
||||||
'exists': True}
|
'exists': True}
|
||||||
# Set port status to DOWN
|
# 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:
|
else:
|
||||||
entry = {'device': device,
|
entry = {'device': device,
|
||||||
'exists': False}
|
'exists': False}
|
||||||
|
Loading…
Reference in New Issue
Block a user