Change in vdsm[master]: openstack_net hook: search for ovs_vsctl only when needed

danken at redhat.com danken at redhat.com
Wed Mar 19 11:30:04 UTC 2014


Dan Kenigsberg has uploaded a new change for review.

Change subject: openstack_net hook: search for ovs_vsctl only when needed
......................................................................

openstack_net hook: search for ovs_vsctl only when needed

Change-Id: I397e17782f61a94f734cf060d5ecad768379abcc
Bug-Url: https://bugzilla.redhat.com/1074628
Signed-off-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm_hooks/openstacknet/after_device_destroy.py
M vdsm_hooks/openstacknet/before_device_create.py
M vdsm_hooks/openstacknet/openstacknet_utils.py
3 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/25889/1

diff --git a/vdsm_hooks/openstacknet/after_device_destroy.py b/vdsm_hooks/openstacknet/after_device_destroy.py
index 8e13412..3cc7261 100755
--- a/vdsm_hooks/openstacknet/after_device_destroy.py
+++ b/vdsm_hooks/openstacknet/after_device_destroy.py
@@ -19,7 +19,6 @@
 import hooking
 from openstacknet_utils import EXT_BRCTL
 from openstacknet_utils import EXT_IP
-from openstacknet_utils import EXT_OVS_VSCTL
 from openstacknet_utils import INTEGRATION_BRIDGE
 from openstacknet_utils import OPENSTACK_NET_PROVIDER_TYPE
 from openstacknet_utils import PLUGIN_TYPE_KEY
@@ -29,6 +28,7 @@
 from openstacknet_utils import deviceExists
 from openstacknet_utils import devName
 from openstacknet_utils import executeOrExit
+from openstacknet_utils import ovs_vsctl
 
 
 def disconnectVnic(portId):
@@ -40,7 +40,7 @@
         executeOrExit([EXT_BRCTL, 'delif', brName, vethBr])
         executeOrExit([EXT_IP, 'link', 'set', brName, 'down'])
         executeOrExit([EXT_BRCTL, 'delbr', brName])
-        executeOrExit([EXT_OVS_VSCTL, 'del-port', INTEGRATION_BRIDGE, vethOvs])
+        executeOrExit([ovs_vsctl.cmd, 'del-port', INTEGRATION_BRIDGE, vethOvs])
         executeOrExit([EXT_IP, 'link', 'delete', vethOvs])
 
 
diff --git a/vdsm_hooks/openstacknet/before_device_create.py b/vdsm_hooks/openstacknet/before_device_create.py
index 74f4671..e322ec3 100755
--- a/vdsm_hooks/openstacknet/before_device_create.py
+++ b/vdsm_hooks/openstacknet/before_device_create.py
@@ -40,7 +40,6 @@
 from openstacknet_utils import DUMMY_BRIDGE
 from openstacknet_utils import EXT_BRCTL
 from openstacknet_utils import EXT_IP
-from openstacknet_utils import EXT_OVS_VSCTL
 from openstacknet_utils import INTEGRATION_BRIDGE
 from openstacknet_utils import OPENSTACK_NET_PROVIDER_TYPE
 from openstacknet_utils import PLUGIN_TYPE_KEY
@@ -52,6 +51,7 @@
 from openstacknet_utils import deviceExists
 from openstacknet_utils import devName
 from openstacknet_utils import executeOrExit
+from openstacknet_utils import ovs_vsctl
 
 HELP_ARG = "-h"
 TEST_ARG = "-t"
@@ -117,7 +117,7 @@
         executeOrExit([EXT_BRCTL, 'addif', brName, vethBr])
 
         mac = iface.getElementsByTagName('mac')[0].getAttribute('address')
-        executeOrExit([EXT_OVS_VSCTL, '--', '--may-exist', 'add-port',
+        executeOrExit([ovs_vsctl.cmd, '--', '--may-exist', 'add-port',
                       INTEGRATION_BRIDGE, vethOvs,
                       '--', 'set', 'Interface', vethOvs,
                       'external-ids:iface-id=%s' % portId,
diff --git a/vdsm_hooks/openstacknet/openstacknet_utils.py b/vdsm_hooks/openstacknet/openstacknet_utils.py
index 686e4a0..e919908 100644
--- a/vdsm_hooks/openstacknet/openstacknet_utils.py
+++ b/vdsm_hooks/openstacknet/openstacknet_utils.py
@@ -21,9 +21,9 @@
 
 EXT_BRCTL = CommandPath('brctl', '/sbin/brctl', '/usr/sbin/brctl').cmd
 EXT_IP = CommandPath('ip', '/sbin/ip').cmd
-EXT_OVS_VSCTL = CommandPath('ovs-vsctl',
-                            '/usr/sbin/ovs-vsctl',
-                            '/usr/bin/ovs-vsctl').cmd
+ovs_vsctl = CommandPath('ovs-vsctl',
+                        '/usr/sbin/aovs-vsctl',
+                        '/usr/bin/aovs-vsctl')
 
 # Make pyflakes happy
 DUMMY_BRIDGE


-- 
To view, visit http://gerrit.ovirt.org/25889
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I397e17782f61a94f734cf060d5ecad768379abcc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list