-"""
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Cisco Systems, Inc. All rights reserved.
#
# @author: Sumit Naiksatam, Cisco Systems, Inc.
# @author: Rohit Agarwalla, Cisco Systems, Inc.
-"""
+
"""
Exceptions used by the Cisco plugin
"""
class VlanIDNotAvailable(exceptions.QuantumException):
- """VLAN ID is reserved"""
- message = _("No available Vlan ID found")
+ """No VLAN ID available"""
+ message = _("No Vlan ID available")
class QosNotFound(exceptions.QuantumException):
+ """QoS level with this ID cannot be found"""
message = _("QoS level %(qos_id)s could not be found " \
"for tenant %(tenant_id)s")
class QoSLevelInvalidDelete(exceptions.QuantumException):
+ """QoS is associated with a port profile, hence cannot be deleted"""
message = _("QoS level %(qos_id)s could not be deleted " \
"for tenant %(tenant_id)s since association exists")
class CredentialNotFound(exceptions.QuantumException):
+ """Credential with this ID cannot be found"""
message = _("Credential %(credential_id)s could not be found " \
"for tenant %(tenant_id)s")
id = Column(Integer, primary_key=True, autoincrement=True)
port_id = Column(String(255))
- #vlan_id = Column(Integer, ForeignKey("vlan_bindings.vlan_id"), \
- # nullable=False)
vlan_id = Column(Integer, nullable=False)
def __init__(self, port_id, vlan_id):
cred.Store.deleteCredential(credential_id)
def rename_credential(self, tenant_id, credential_id, new_name):
- """Do nothing for this resource"""
+ """Rename the particular credential resource"""
LOG.debug("rename_credential() called\n")
try:
credential = self._get_credential(tenant_id, credential_id)
return inspect.stack()[1 + offset][3]
def _make_net_dict(self, net_id, net_name, ports):
- """Helper funciton"""
+ """Helper funciton to create network resource dictionary"""
res = {const.NET_ID: net_id, const.NET_NAME: net_name}
res[const.NET_PORTS] = ports
return res
def _make_port_dict(self, port_id, port_state, net_id, attachment):
- """Helper funciton"""
+ """Helper function to create port resource dictionary"""
res = {const.PORT_ID: port_id, const.PORT_STATE: port_state}
res[const.NET_ID] = net_id
res[const.ATTACHMENT] = attachment
def _make_portprofile_dict(self, tenant_id, profile_id, profile_name,
qos):
- """Helper funciton"""
+ """Helper funciton to create port-profile resource dictionary"""
profile_associations = self._make_portprofile_assc_list(tenant_id,
profile_id)
res = {const.PROFILE_ID: str(profile_id),
CiscoConfigParser(os.path.dirname(os.path.realpath(__file__)) + \
"/" + CONF_FILE)
+"""
+Reading the conf for the l2network_plugin
+"""
SECTION_CONF = CONF_PARSER_OBJ['VLANS']
VLAN_NAME_PREFIX = SECTION_CONF['vlan_name_prefix']
VLAN_START = SECTION_CONF['vlan_start']
CiscoConfigParser(os.path.dirname(os.path.realpath(__file__)) + \
"/" + CONF_FILE)
+"""
+Reading the config for the device plugins
+"""
PLUGINS = CONF_PARSER_OBJ.walk(CONF_PARSER_OBJ.dummy)
CONF_FILE = "conf/db_conn.ini"
CiscoConfigParser(os.path.dirname(os.path.realpath(__file__)) + \
"/" + CONF_FILE)
+"""
+Reading DB config for the Quantum DB
+"""
SECTION_CONF = CONF_PARSER_OBJ['DATABASE']
DB_NAME = SECTION_CONF['name']
DB_USER = SECTION_CONF['user']