[node-patches] Change in ovirt-node[master]: network: No persisten udev rules w/ bisodevname

fabiand at fedoraproject.org fabiand at fedoraproject.org
Mon Oct 8 09:51:40 UTC 2012


Fabian Deutsch has uploaded a new change for review.

Change subject: network: No persisten udev rules w/ bisodevname
......................................................................

network: No persisten udev rules w/ bisodevname

Previosuly Node tried to store the network udev rules even in the case
of biosdevname, but this failed because udev does not generate net rules
in the case of biosdevname.
Now the rules are only persisted when rules are available.

rhbz#863994

Change-Id: I3f06ef3a277cc1e72d2d543c37da753bacaafb82
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/ovirt-init-functions.sh
M scripts/ovirtnode/network.py
2 files changed, 15 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/98/8398/1

diff --git a/scripts/ovirt-init-functions.sh b/scripts/ovirt-init-functions.sh
index 3bce1c4..5ca8a99 100644
--- a/scripts/ovirt-init-functions.sh
+++ b/scripts/ovirt-init-functions.sh
@@ -826,9 +826,11 @@
         fi
     fi
 
-    # Rename the interfaces after bind-mounting the udev rules, rhbz#831658
-    udevadm control --reload-rules
-    udevadm trigger --action=add --subsystem-match=net
+    [[ -f "/etc/udev/rules.d/71-persistent-node-net.rules" ]] && {
+        # Rename the interfaces after bind-mounting the udev rules, rhbz#831658
+        udevadm control --reload-rules
+        udevadm trigger --action=add --subsystem-match=net
+    }
 
     if [ -n "$cim_passwd" ]; then
         log "Setting temporary admin password: $cim_passwd"
diff --git a/scripts/ovirtnode/network.py b/scripts/ovirtnode/network.py
index 50e0dac..2b17494 100644
--- a/scripts/ovirtnode/network.py
+++ b/scripts/ovirtnode/network.py
@@ -374,16 +374,17 @@
 
         # Copy the initial net rules to a file that get's not
         # overwritten at each boot, rhbz#773495
-        _functions.system_closefds("cp" +
-                        " /etc/udev/rules.d/70-persistent-net.rules" +
-                        " /etc/udev/rules.d/71-persistent-node-net.rules" +
-                        " >> /var/log/ovirt.log");
-        _functions.ovirt_store_config("/etc/udev/rules.d/" +
-                                      "71-persistent-node-net.rules")
+        rulesfile = "/etc/udev/rules.d/70-persistent-net.rules"
+        newrulesfile = "/etc/udev/rules.d/71-persistent-node-net.rules"
+        if os.path.exists(rulesfile):
+            _functions.system_closefds("cp %s %s >> /var/log/ovirt.log" % (
+                                                                rulesfile,
+                                                                newrulesfile))
+            _functions.ovirt_store_config(newrulesfile)
 
-        # Eventully it makes sense to rename the NICs
-        #system_closefds("sed -ic 's/NAME=\"eth/NAME=\"eth00/' " +
-        #                 "/etc/udev/rules.d/71-persistent-node-net.rules")
+            # Eventully it makes sense to rename the NICs
+            #system_closefds("sed -ic 's/NAME=\"eth/NAME=\"eth00/' " +
+            #                 "/etc/udev/rules.d/71-persistent-node-net.rules")
 
 
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f06ef3a277cc1e72d2d543c37da753bacaafb82
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