]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
pep8 errors fixed
authorrohitagarwalla <roagarwa@cisco.com>
Fri, 12 Aug 2011 17:52:05 +0000 (10:52 -0700)
committerrohitagarwalla <roagarwa@cisco.com>
Fri, 12 Aug 2011 17:52:05 +0000 (10:52 -0700)
quantum/plugins/cisco/db/api.py
quantum/plugins/cisco/db/l2network_db.py
quantum/plugins/cisco/db/l2network_models.py

index 509583a1d4190a385b6a45bee9d63912b6f23fba..fc9a69ea29058a445f7d730a65e48de372e907a7 100644 (file)
@@ -251,4 +251,3 @@ def port_destroy(net_id, port_id):
         return port
     except exc.NoResultFound:
         raise q_exc.PortNotFound(port_id=port_id)
-
index a25179184b1a5bbb9a64018fd672203d7253ce39..b11c6567765d92746d99d77854b6644c7fa1a28f 100644 (file)
@@ -16,7 +16,6 @@
 # @author: Rohit Agarwalla, Cisco Systems, Inc.
 
 import ConfigParser
-from optparse import OptionParser
 import os
 import logging as LOG
 
@@ -62,6 +61,7 @@ def initialize(configfile=None):
     DB_PASS, DB_HOST, DB_NAME)}
     db.configure_db(options)
 
+
 def create_vlanids():
     """Prepopulates the vlan_bindings table"""
     session = db.get_session()
@@ -77,7 +77,8 @@ def create_vlanids():
             session.add(vlanid)
             start += 1
         session.flush()
-    return 
+    return
+
 
 def get_all_vlanids():
     session = db.get_session()
@@ -86,8 +87,9 @@ def get_all_vlanids():
           all()
         return vlanids
     except exc.NoResultFound:
-        return []       
-    
+        return []
+
+
 def is_vlanid_used(vlan_id):
     session = db.get_session()
     try:
@@ -97,7 +99,8 @@ def is_vlanid_used(vlan_id):
         return vlanid["vlan_used"]
     except exc.NoResultFound:
         raise Exception("No vlan found with vlan-id = %s" % vlan_id)
-     
+
+
 def release_vlanid(vlan_id):
     session = db.get_session()
     try:
@@ -110,8 +113,8 @@ def release_vlanid(vlan_id):
         return vlanid["vlan_used"]
     except exc.NoResultFound:
         raise Exception("Vlan id %s not present in table" % vlan_id)
-        
-    return 
+    return
+
 
 def delete_vlanid(vlan_id):
     session = db.get_session()
@@ -124,7 +127,8 @@ def delete_vlanid(vlan_id):
         return vlanid
     except exc.NoResultFound:
             pass
-    
+
+
 def reserve_vlanid():
     session = db.get_session()
     try:
@@ -141,7 +145,8 @@ def reserve_vlanid():
         return vlanids[0]["vlan_id"]
     except exc.NoResultFound:
         raise Exception("All vlan id's are used")
-     
+
+
 def get_all_vlan_bindings():
     """Lists all the vlan to network associations"""
     session = db.get_session()
index a53c4205aff372280cb48b7582bd7df45d2decdc..d04f7dd6f67543292d81108b5ac26dbbc51fec85 100644 (file)
@@ -60,6 +60,7 @@ class L2NetworkBase(object):
         local.update(joined)
         return local.iteritems()
 
+
 class VlanID(BASE, L2NetworkBase):
     """Represents a vlan_id usage"""
     __tablename__ = 'vlan_ids'
@@ -74,7 +75,7 @@ class VlanID(BASE, L2NetworkBase):
     def __repr__(self):
         return "<VlanBinding(%d,%s)>" % \
           (self.vlan_id, self.vlan_used)
-    
+
 
 class VlanBinding(BASE, L2NetworkBase):
     """Represents a binding of vlan_id to network_id"""