]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fixed issue with creating new port profiles (one configuration parameter got left...
authorSumit Naiksatam <snaiksat@cisco.com>
Fri, 5 Aug 2011 19:45:28 +0000 (12:45 -0700)
committerSumit Naiksatam <snaiksat@cisco.com>
Fri, 5 Aug 2011 19:45:28 +0000 (12:45 -0700)
quantum/plugins/cisco/conf/l2network_plugin.ini
quantum/plugins/cisco/l2network_plugin.py
quantum/plugins/cisco/l2network_plugin_configuration.py

index f6ac8613bfe74ff7386bc877ce911d3f0fd5fb8e..5a0d7d7a93265af40aacaf3242ee7a8f0174b7cc 100644 (file)
@@ -1,5 +1,4 @@
 [VLANS]
-#Change the following to reflect the VLAN range in your system
 vlan_start=100
 vlan_end=3000
 vlan_name_prefix=q-
@@ -7,5 +6,8 @@ vlan_name_prefix=q-
 [PORTS]
 max_ports=100
 
+[PORTPROFILES]
+max_port_profiles=65568
+
 [NETWORKS]
 max_networks=65568
index b9ada4d5fd8bf283b79310ea2a551f9a736edaaf..e3642515ce852a6faefad0cade82a00fc055d816 100644 (file)
@@ -375,10 +375,23 @@ class L2Network(object):
         self._portprofile_counter += 1
         self._portprofile_counter %= int(conf.MAX_PORT_PROFILES)
         id = tenant_id[:3] + "-pp-" + \
-        ("0" * (6 - len(str(self._net_counter)))) + str(self._net_counter)
+                ("0" * (6 - len(str(self._net_counter)))) \
+                + str(self._portprofile_counter)
         # TODO (Sumit): Need to check if the ID has already been allocated
         # ID will be generated by DB
         return id
 
-# TODO (Sumit):
-    # (1) Persistent storage
+
+def main():
+    client = L2Network()
+    client.create_portprofile("12345", "tpp1", "2")
+    client.create_portprofile("12345", "tpp2", "3")
+    print ("%s\n") % client.get_all_portprofiles("12345")
+
+if __name__ == '__main__':
+    main()
+
+"""
+TODO (Sumit):
+(1) Persistent storage
+"""
index e0fe786a515c724751f68f60d978bd0826c1edb1..fe619ddfcd860631ab79f26de5d89c245ad1e180 100644 (file)
@@ -34,6 +34,9 @@ VLAN_END = section['vlan_end']
 section = cp['PORTS']
 MAX_PORTS = section['max_ports']
 
+section = cp['PORTPROFILES']
+MAX_PORT_PROFILES = section['max_port_profiles']
+
 section = cp['NETWORKS']
 MAX_NETWORKS = section['max_networks']