From: Sumit Naiksatam Date: Mon, 22 Aug 2011 23:17:33 +0000 (-0700) Subject: Code clean up as per reviewr's request; documentation strings, unused code, etc. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4ee1ac41453dbc800740da1a59320f79a01c4946;p=openstack-build%2Fneutron-build.git Code clean up as per reviewr's request; documentation strings, unused code, etc. --- diff --git a/quantum/plugins/cisco/common/cisco_exceptions.py b/quantum/plugins/cisco/common/cisco_exceptions.py index a50e2c86b..3d4a819b2 100644 --- a/quantum/plugins/cisco/common/cisco_exceptions.py +++ b/quantum/plugins/cisco/common/cisco_exceptions.py @@ -1,4 +1,3 @@ -""" # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2011 Cisco Systems, Inc. All rights reserved. @@ -17,7 +16,7 @@ # # @author: Sumit Naiksatam, Cisco Systems, Inc. # @author: Rohit Agarwalla, Cisco Systems, Inc. -""" + """ Exceptions used by the Cisco plugin """ @@ -86,21 +85,24 @@ class VlanIDNotFound(exceptions.QuantumException): 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") diff --git a/quantum/plugins/cisco/db/nexus_models.py b/quantum/plugins/cisco/db/nexus_models.py index 51a210990..bd6c765ec 100644 --- a/quantum/plugins/cisco/db/nexus_models.py +++ b/quantum/plugins/cisco/db/nexus_models.py @@ -27,8 +27,6 @@ class NexusPortBinding(BASE, L2NetworkBase): 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): diff --git a/quantum/plugins/cisco/l2network_plugin.py b/quantum/plugins/cisco/l2network_plugin.py index 6a0f7a568..717419352 100644 --- a/quantum/plugins/cisco/l2network_plugin.py +++ b/quantum/plugins/cisco/l2network_plugin.py @@ -462,7 +462,7 @@ class L2Network(QuantumPluginBase): 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) @@ -528,13 +528,13 @@ class L2Network(QuantumPluginBase): 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 @@ -542,7 +542,7 @@ class L2Network(QuantumPluginBase): 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), diff --git a/quantum/plugins/cisco/l2network_plugin_configuration.py b/quantum/plugins/cisco/l2network_plugin_configuration.py index acbca503b..3fffd1d72 100644 --- a/quantum/plugins/cisco/l2network_plugin_configuration.py +++ b/quantum/plugins/cisco/l2network_plugin_configuration.py @@ -29,6 +29,9 @@ CONF_PARSER_OBJ = confp.\ 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'] @@ -52,6 +55,9 @@ CONF_PARSER_OBJ = confp.\ 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" @@ -60,6 +66,9 @@ CONF_PARSER_OBJ = confp.\ 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']