Change in vdsm[master]: hooks: ovs: use network lib instead of hardcoded path hack

phoracek at redhat.com phoracek at redhat.com
Mon Dec 7 10:29:13 UTC 2015


Petr Horáček has uploaded a new change for review.

Change subject: hooks: ovs: use network lib instead of hardcoded path hack
......................................................................

hooks: ovs: use network lib instead of hardcoded path hack

vdsm.network has been changed into a separate library, now we
can drop hardcoded path hack.

Change-Id: I788e9e071ccf394022c754e33850b74aef2cad8a
Signed-off-by: Petr Horáček <phoracek at redhat.com>
---
M vdsm_hooks/ovs/ovs_before_network_setup.py
M vdsm_hooks/ovs/ovs_before_network_setup_ip.py
M vdsm_hooks/ovs/ovs_before_network_setup_libvirt.py
M vdsm_hooks/ovs/ovs_before_network_setup_ovs.py
4 files changed, 8 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/49967/1

diff --git a/vdsm_hooks/ovs/ovs_before_network_setup.py b/vdsm_hooks/ovs/ovs_before_network_setup.py
index fa8cfb5..42671b4 100755
--- a/vdsm_hooks/ovs/ovs_before_network_setup.py
+++ b/vdsm_hooks/ovs/ovs_before_network_setup.py
@@ -33,6 +33,7 @@
 import six
 
 from vdsm.netconfpersistence import RunningConfig
+from vdsm.network.configurators import libvirt
 
 from hooking import execCmd
 import hooking
@@ -46,10 +47,6 @@
 from ovs_setup_libvirt import (create_libvirt_nets, remove_libvirt_nets,
                                prepare_libvirt)
 import ovs_utils
-
-# TODO: move required modules into vdsm/lib
-sys.path.append('/usr/share/vdsm')
-from network.configurators import libvirt
 
 log = partial(ovs_utils.log, tag='ovs_before_network_setup: ')
 
diff --git a/vdsm_hooks/ovs/ovs_before_network_setup_ip.py b/vdsm_hooks/ovs/ovs_before_network_setup_ip.py
index f15857e..3567c83 100644
--- a/vdsm_hooks/ovs/ovs_before_network_setup_ip.py
+++ b/vdsm_hooks/ovs/ovs_before_network_setup_ip.py
@@ -20,21 +20,17 @@
 from collections import namedtuple
 from functools import partial
 import os
-import sys
 
 import six
 
 from vdsm import ipwrapper, sysctl
+from vdsm.network.configurators.dhclient import DhcpClient, kill_dhclient
+from vdsm.network.configurators.iproute2 import Iproute2
+from vdsm.network.models import NetDevice, IPv4, IPv6
+from vdsm.network.sourceroute import DynamicSourceRoute
 
 from ovs_utils import suppress, BRIDGE_NAME
 import ovs_utils
-
-# TODO: move required modules into vdsm/lib
-sys.path.append('/usr/share/vdsm')
-from network.configurators.dhclient import DhcpClient, kill_dhclient
-from network.configurators.iproute2 import Iproute2
-from network.models import NetDevice, IPv4, IPv6
-from network.sourceroute import DynamicSourceRoute
 
 log = partial(ovs_utils.log, tag='ovs_before_network_setup_ip: ')
 
diff --git a/vdsm_hooks/ovs/ovs_before_network_setup_libvirt.py b/vdsm_hooks/ovs/ovs_before_network_setup_libvirt.py
index c2fd776..99fe0cd 100644
--- a/vdsm_hooks/ovs/ovs_before_network_setup_libvirt.py
+++ b/vdsm_hooks/ovs/ovs_before_network_setup_libvirt.py
@@ -17,16 +17,12 @@
 #
 # Refer to the README and COPYING files for full details of the license
 #
-import sys
-
 from libvirt import libvirtError
 import six
 
-from ovs_utils import suppress
+from vdsm.network.configurators import libvirt
 
-# TODO: move required modules into vdsm/lib
-sys.path.append('/usr/share/vdsm')
-from network.configurators import libvirt
+from ovs_utils import suppress
 
 
 def prepare_libvirt(nets, running_config):
diff --git a/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py b/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py
index 5f38773..8877a14 100644
--- a/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py
+++ b/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py
@@ -18,11 +18,11 @@
 # Refer to the README and COPYING files for full details of the license
 #
 from functools import partial
-import sys
 
 import six
 
 from vdsm.netinfo import NetInfo
+from vdsm.network.configurators import libvirt
 
 import hooking
 
@@ -30,10 +30,6 @@
                        iter_ovs_bonds, rget, suppress, destroy_ovs_bridge,
                        BRIDGE_NAME, EXT_OVS_VSCTL)
 import ovs_utils
-
-# TODO: move required modules into vdsm/lib
-sys.path.append('/usr/share/vdsm')
-from network.configurators import libvirt
 
 log = partial(ovs_utils.log, tag='ovs_before_network_setup_ovs: ')
 


-- 
To view, visit https://gerrit.ovirt.org/49967
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I788e9e071ccf394022c754e33850b74aef2cad8a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>


More information about the vdsm-patches mailing list