Pep8, pylint fixes.

This commit is contained in:
Sumit Naiksatam 2011-08-20 21:07:30 -07:00
commit 5186e6de11
2 changed files with 14 additions and 0 deletions

View File

@ -41,6 +41,7 @@ PPDEFAULT = 'default'
VLANID = 'vlan_id'
VLANNAME = 'vlan_name'
PORTPROFILENAME = 'portprofile_name'
QOS='qos'
ATTACHMENT = 'attachment'
PORT_ID = 'port-id'

View File

@ -371,3 +371,16 @@ def update_portbinding(port_id, blade_intf_dn=None, portprofile_name=None,
return port_binding
except exc.NoResultFound:
raise c_exc.PortVnicNotFound(port_id=port_id)
def get_portbinding_dn(blade_intf_dn):
"""Lists a port binding"""
LOG.debug("get_portbinding_dn() called")
session = db.get_session()
try:
port_binding = session.query(ucs_models.PortBinding).\
filter_by(blade_intf_dn=blade_intf_dn).\
one()
return port_binding
except exc.NoResultFound:
return []