Change in vdsm[ovirt-3.4]: openstack_net hook: search for ovs_vsctl only when needed
danken at redhat.com
danken at redhat.com
Wed Mar 19 15:10:50 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/1077283
Signed-off-by: Dan Kenigsberg <danken at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/25889
Reviewed-by: Moti Asayag <masayag at redhat.com>
Tested-by: Martin Pavlik <xpavli44 at gmail.com>
(cherry picked from commit 89362adee054696d41377a4d8ad6cf993ced91a9)
---
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/00/25900/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..5a75fb6 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/ovs-vsctl',
+ '/usr/bin/ovs-vsctl')
# Make pyflakes happy
DUMMY_BRIDGE
--
To view, visit http://gerrit.ovirt.org/25900
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I397e17782f61a94f734cf060d5ecad768379abcc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>
More information about the vdsm-patches
mailing list