[node-patches] Change in ovirt-node[master]: net: Use ip instead of brctl

fabiand at fedoraproject.org fabiand at fedoraproject.org
Fri Apr 5 13:12:49 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: net: Use ip instead of brctl
......................................................................

net: Use ip instead of brctl

Previously brctl was used to gather informations about bridges, now the
ip command is used to do the same.
The intention is that we can drop bridge-utils once NetworkManager can
do the bridge stuff as well.

rhbz#920125

Change-Id: I2022ce794ee2792e949457ad7664649c91702813
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M recipe/common-pkgs.ks
M scripts/ovirtnode/network.py
M scripts/ovirtnode/ovirtfunctions.py
3 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/35/13635/1

diff --git a/recipe/common-pkgs.ks b/recipe/common-pkgs.ks
index 82b6ced..e041eab 100644
--- a/recipe/common-pkgs.ks
+++ b/recipe/common-pkgs.ks
@@ -113,5 +113,3 @@
 glusterfs-rdma
 
 NetworkManager-glib
-
-bridge-utils
diff --git a/scripts/ovirtnode/network.py b/scripts/ovirtnode/network.py
index 03fac99..fc77085 100644
--- a/scripts/ovirtnode/network.py
+++ b/scripts/ovirtnode/network.py
@@ -407,7 +407,8 @@
             _functions.system_closefds("service network stop &> /dev/null")
             _functions.system_closefds("service ntpd stop &> /dev/null")
             # XXX eth assumed in breth
-            brctl_cmd = "brctl show| awk 'NR>1 && /^br[ep]/ {print $1}'"
+            brctl_cmd = "ip --details --oneline link " \
+                "| awk -F':' 'NR>1 && /^[0-9]: br[ep]/ {print $2}'"
             brctl = _functions.subprocess_closefds(brctl_cmd, shell=True,
                                                    stdout=subprocess.PIPE,
                                         stderr=subprocess.STDOUT)
@@ -415,7 +416,7 @@
             for i in brctl_output.split():
                 if_down_cmd = "ifconfig %s down &> /dev/null" % i
                 _functions.system_closefds(if_down_cmd)
-                del_br_cmd = "brctl delbr %s &> /dev/null" % i
+                del_br_cmd = "ip link delete %s type bridge &> /dev/null" % i
                 _functions.system_closefds(del_br_cmd)
             logger.info("Starting Network service")
             _functions.system_closefds("service network start &> /dev/null")
diff --git a/scripts/ovirtnode/ovirtfunctions.py b/scripts/ovirtnode/ovirtfunctions.py
index d7cdde9..299108d 100644
--- a/scripts/ovirtnode/ovirtfunctions.py
+++ b/scripts/ovirtnode/ovirtfunctions.py
@@ -1675,7 +1675,8 @@
     >>> bridge_file is bridge_test
     True
     '''
-    if system_closefds("brctl show | egrep -iq 'ovirtmgmt|rhevm'") is 0:
+    ip_cmd = "ip --details --oneline link | egrep -iq 'ovirtmgmt|rhevm'"
+    if system_closefds(ip_cmd) is 0:
         return True
     else:
         return False


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2022ce794ee2792e949457ad7664649c91702813
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list