]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Changes to incorporate earlier review comments, also for multiport resource
authorSumit Naiksatam <snaiksat@cisco.com>
Tue, 30 Aug 2011 23:12:49 +0000 (16:12 -0700)
committerSumit Naiksatam <snaiksat@cisco.com>
Tue, 30 Aug 2011 23:12:49 +0000 (16:12 -0700)
quantum/plugins/cisco/README
quantum/plugins/cisco/client/cli.py
quantum/plugins/cisco/l2network_plugin.py
quantum/plugins/cisco/models/l2network_multi_blade.py
quantum/plugins/cisco/models/l2network_single_blade.py
quantum/plugins/cisco/nova/quantum_port_aware_scheduler.py [moved from quantum/plugins/cisco/nova/quantum_aware_scheduler.py with 98% similarity]
quantum/plugins/cisco/ucs/cisco_ucs_inventory.py
quantum/plugins/cisco/ucs/cisco_ucs_plugin.py

index ef8a49afb3f84eed5c37392bc1caf259cee5f665..29ebea720a86d9124734fc5eda6bbe6538355108 100755 (executable)
@@ -84,11 +84,13 @@ Then run "yum install python-routes".
 Module Structure:\r
 -----------------\r
 * quantum/plugins/cisco/       - Contains the L2-Network Plugin Framework\r
+                       /client - CLI module for core and extensions\r
                        /common - Modules common to the entire plugin\r
                        /conf   - All configuration files\r
                        /db     - Persistence framework\r
                        /models - Class(es) which tie the logical abstractions\r
                                  to the physical topology\r
+                       /nova   - Scheduler and VIF-driver to be used by Nova\r
                        /nexus  - Nexus-specific modules\r
                        /segmentation - Implementation of segmentation manager,\r
                                        e.g. VLAN Manager\r
@@ -109,7 +111,7 @@ provider = quantum.plugins.cisco.l2network_plugin.L2Network
     Quantum-aware scheduler by editing the /etc/nova/nova.conf file with the\r
     following entries:\r
 \r
---scheduler_driver=quantum.plugins.cisco.nova.quantum_aware_scheduler.QuantumScheduler\r
+--scheduler_driver=quantum.plugins.cisco.nova.quantum_port_aware_scheduler.QuantumPortAwareScheduler\r
 --quantum_host=127.0.0.1\r
 --quantum_port=9696\r
 --libvirt_vif_driver=quantum.plugins.cisco.nova.vifdirect.Libvirt802dot1QbhDriver\r
@@ -187,7 +189,7 @@ password=mySecretPasswordForNexus
 \r
 7.  Configure the UCS systems' information in your deployment by editing the\r
     quantum/plugins/cisco/conf/ucs_inventory.ini file. You can configure multiple\r
-    UCSMs per deployment, multiple chasses per UCSM, and multiple blades per\r
+    UCSMs per deployment, multiple chassis per UCSM, and multiple blades per\r
     chassis. Chassis ID and blade ID can be obtained from the UCSM (they will\r
     typically numbers like 1, 2, 3, etc.\r
 \r
index 834cef4d41bd79b9d5c774221556d6c4708bd07e..c1dee388c728bee4af21f8fdeb13b48bd155ff43 100644 (file)
@@ -124,15 +124,15 @@ def schedule_host(tenant_id, instance_id, user_id=None):
     print("Quantum service returned host: %s" % hostname)
 
 
-def create_ports(tenant_id, net_id_list, *args):
+def create_multiport(tenant_id, net_id_list, *args):
     """Creates ports on a single host"""
     net_list = net_id_list.split(",")
     ports_info = {'multiport': \
                   {'status': 'ACTIVE',
                    'net_id_list': net_list,
-                   'ports_desc': {}}}
+                   'ports_desc': {'key': 'value'}}}
 
-    request_url = "/multiport/create_ports"
+    request_url = "/multiport"
     client = Client(HOST, PORT, USE_SSL, format='json', tenant=tenant_id,
                     action_prefix=ACTION_PREFIX_CSCO)
     data = client.do_request('POST', request_url, body=ports_info)
@@ -141,8 +141,8 @@ def create_ports(tenant_id, net_id_list, *args):
 
 
 COMMANDS = {
-  "create_ports": {
-    "func": create_ports,
+  "create_multiport": {
+    "func": create_multiport,
     "args": ["tenant-id",
              "net-id-list (comma separated list of netword IDs)"]},
   "list_extensions": {
index 832c6c22dbf5690153a33ed26e3464c5a1f96ad1..8ffcdf84d794c7bedab02e7810d974db7b36a205 100644 (file)
@@ -41,8 +41,9 @@ LOG.getLogger(const.LOGGER_COMPONENT_NAME)
 
 class L2Network(QuantumPluginBase):
     """ L2 Network Framework Plugin """
-    supported_extension_aliases = ["Cisco Credential", "Cisco Port Profile",
-                                   "Cisco qos", "Cisco Nova Tenant"]
+    supported_extension_aliases = ["Cisco Multiport", "Cisco Credential",
+                                   "Cisco Port Profile", "Cisco qos",
+                                   "Cisco Nova Tenant"]
 
     def __init__(self):
         cdb.initialize()
@@ -470,7 +471,7 @@ class L2Network(QuantumPluginBase):
                                                                instance_id,
                                                                instance_desc])
 
-    def create_ports(self, tenant_id, net_id_list, port_state, ports_desc):
+    def create_multiport(self, tenant_id, net_id_list, port_state, ports_desc):
         """
         Creates multiple ports on the specified Virtual Network.
         """
index 598c588c2f1d86d3173c5b43a3d1747f16c064e2..d74ac2d601581fcc1f096a6f6270a30253866c0a 100644 (file)
@@ -172,7 +172,7 @@ class L2NetworkMultiBlade(L2NetworkModelBase):
         return self._invoke_inventory(const.UCS_PLUGIN, self._func_name(),
                                       args)
 
-    def create_ports(self, args):
+    def create_multiport(self, args):
         """Support for extension  API call"""
         self._invoke_plugin_per_device(const.UCS_PLUGIN, self._func_name(),
                                        args)
index 3b0f62e31459f283b1d6a0e058c4c741375d79c4..5636c066527f306685fd1bd227739f010c561367 100644 (file)
@@ -163,7 +163,7 @@ class L2NetworkSingleBlade(L2NetworkModelBase):
         return self._invoke_inventory(const.UCS_PLUGIN, self._func_name(),
                                       args)
 
-    def create_ports(self, args):
+    def create_multiport(self, args):
         """Support for extension  API call"""
         self._invoke_plugin_per_device(const.UCS_PLUGIN, self._func_name(),
                                        args)
similarity index 98%
rename from quantum/plugins/cisco/nova/quantum_aware_scheduler.py
rename to quantum/plugins/cisco/nova/quantum_port_aware_scheduler.py
index 4394980dfa17b8a9300dd60593ff595a556b8dd8..27b56bf97146552e5bbf494c3a122779e7a951c9 100644 (file)
@@ -43,7 +43,7 @@ CSCO_EXT_NAME = 'Cisco Nova Tenant'
 ACTION = '/schedule_host'
 
 
-class QuantumScheduler(driver.Scheduler):
+class QuantumPortAwareScheduler(driver.Scheduler):
     """
     Quantum network service dependent scheduler
     Obtains the hostname from Quantum using an extension API
index ccc409a2c723fd8617b60f6e7bb99f7be8d09408..cb4ab9f4ffc935075afb3a1fe650b8b52bbb6e4d 100644 (file)
@@ -692,7 +692,7 @@ class UCSInventory(L2NetworkDeviceInventoryBase):
         LOG.debug("vif_desc is: %s" % vif_desc)
         return vif_desc
 
-    def create_ports(self, args):
+    def create_multiport(self, args):
         """
         Create multiple ports for a VM
         """
index 7ce896549f21ea2102d654f3182a1ebdd9ad5dbc..1019413bcabc3dfeaac52982a7052ca0ee670660 100644 (file)
@@ -297,7 +297,7 @@ class UCSVICPlugin(L2DevicePluginBase):
         self._ucsm_username = cred.Store.getUsername(conf.UCSM_IP_ADDRESS)
         self._ucsm_password = cred.Store.getPassword(conf.UCSM_IP_ADDRESS)
 
-    def create_ports(self, tenant_id, net_id_list, ports_num, port_id_list,
+    def create_multiport(self, tenant_id, net_id_list, ports_num, port_id_list,
                      **kwargs):
         """
         Creates a port on the specified Virtual Network.