From: Sumit Naiksatam Date: Mon, 8 Aug 2011 18:54:19 +0000 (-0700) Subject: Making a check for the presence of UCS/Nexus plugin (earlier it was not in certain... X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=71dc75bb7bb33a71529b17a28ac149e03770c950;p=openstack-build%2Fneutron-build.git Making a check for the presence of UCS/Nexus plugin (earlier it was not in certain cases). With this change, if the UCS/Nexus plugins are not enabled, the core API tests can be run even on Ubuntu (and RHEL without the requirement of any specific network hardware). --- diff --git a/quantum/plugins/cisco/README b/quantum/plugins/cisco/README index 5467fb03a..a5d3146a9 100644 --- a/quantum/plugins/cisco/README +++ b/quantum/plugins/cisco/README @@ -60,9 +60,9 @@ mysql -uroot -p nova -e 'create table ports (port_id VARCHA ** Execute the Test cases * The unit tests are located at quantum/plugins/cisco/tests/unit. They are executed from quantum/plugins/cisco/ using the runtests.py script. (Note that to execute the test cases one currently requires the environment setup as outlined in the pre-requisites.) -* Execution of the runtests.py script. +* Execution of the run_tests.py script. All unit tests - python runtests.py unit + python run_tests.py unit Specific Plugin unit test - python runtests.py unit. - e.g. python run_tests.py unit.test_coreApi + python run_tests.py unit. + e.g. python run_tests.py unit.test_l2networkApi diff --git a/quantum/plugins/cisco/l2network_model.py b/quantum/plugins/cisco/l2network_model.py index 3fa986b2a..e24e0a372 100644 --- a/quantum/plugins/cisco/l2network_model.py +++ b/quantum/plugins/cisco/l2network_model.py @@ -47,12 +47,14 @@ class L2NetworkModel(L2NetworkModelBase): getattr(pluginObjRef, function_name)(*args, **kwargs) def _invokeUCSPlugin(self, function_name, args, kwargs): - getattr(self._plugins[const.UCS_PLUGIN], - function_name)(*args, **kwargs) + if const.UCS_PLUGIN in self._plugins.keys(): + getattr(self._plugins[const.UCS_PLUGIN], + function_name)(*args, **kwargs) def _invokeNexusPlugin(self, function_name, args, kwargs): - getattr(self._plugins[const.NEXUS_PLUGIN], - function_name)(*args, **kwargs) + if const.NEXUS_PLUGIN in self._plugins.keys(): + getattr(self._plugins[const.NEXUS_PLUGIN], + function_name)(*args, **kwargs) def get_all_networks(self, args): pass