]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Code clean up as per reviewr's request; documentation strings, unused code, etc.
authorSumit Naiksatam <snaiksat@cisco.com>
Mon, 22 Aug 2011 23:17:33 +0000 (16:17 -0700)
committerSumit Naiksatam <snaiksat@cisco.com>
Mon, 22 Aug 2011 23:17:33 +0000 (16:17 -0700)
quantum/plugins/cisco/common/cisco_exceptions.py
quantum/plugins/cisco/db/nexus_models.py
quantum/plugins/cisco/l2network_plugin.py
quantum/plugins/cisco/l2network_plugin_configuration.py

index a50e2c86b253f1080a3f7f876e557b0958248ad8..3d4a819b28e88aea6cecc96d59d41482b946d9c7 100644 (file)
@@ -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")
 
index 51a210990d13c84079471e72cfcf05f2dba7ca4b..bd6c765ec94fce513f0a8c30c8df41cbd70cc574 100644 (file)
@@ -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):
index 6a0f7a5686e3a2aabecb51cf9c4b7a436007d757..71741935238fd5b5c9c7741e1fe5dbf668be18b3 100644 (file)
@@ -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),
index acbca503b363ee283672786781070705cc432058..3fffd1d72031ae86f9c9b70b4de1a3d63624500e 100644 (file)
@@ -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']