[Ovirt-devel] [PATCH node] Moved functionality to o-process-config.

Darryl L. Pierce dpierce at redhat.com
Fri Dec 19 22:11:43 UTC 2008


Code to copy the network configuration files to the config partition and
to restart the network service have been moved out of ovirt-early and
into ovirt-process-config. This will allow the script to be reuseable.

Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
---
 scripts/ovirt-early          |   20 +++++---------------
 scripts/ovirt-process-config |   16 ++++++++++++++++
 2 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/scripts/ovirt-early b/scripts/ovirt-early
index 8bf8928..2d2a96d 100755
--- a/scripts/ovirt-early
+++ b/scripts/ovirt-early
@@ -44,21 +44,11 @@ configure_from_network() {
                     if [ $? -eq 0 ]; then
                         echo "Remote configuration bundle retrieved to $cfgdb"
                         ovirt-process-config $cfgdb $BONDING_MODCONF_FILE $AUGTOOL_CONFIG
-                        if [ -f $AUGTOOL_CONFIG ]; then
-                            echo "Loading remote config"
-                            # avoid bindmount issues with augeas
-                            umount_config /etc/sysconfig/network-scripts/ifcfg-eth*
-                            augtool < $AUGTOOL_CONFIG \
-                                && echo "Remote config applied" \
-                                || echo "Failed applying remote config"
-                        fi
-                        if ls /etc/sysconfig/network-scripts/ifcfg-eth* > /dev/null 2>&1; then
-                            echo "Network interfaces created from remote config"
-                            ovirt_store_config /etc/sysconfig/network-scripts/ifcfg-eth*
-                            return
-                        else
-                            echo "Remote config contained no network interfaces"
-                        fi
+			if [ $? -eq 0 ]; then
+			    echo "Remote configuration retrieved and applied"
+			else
+			    echo "Failure to retrieve or apply remote configuration"
+			fi
                     else
                         echo "Failed to retrieve configuration bundle"
                     fi
diff --git a/scripts/ovirt-process-config b/scripts/ovirt-process-config
index 48068ef..8641fa0 100755
--- a/scripts/ovirt-process-config
+++ b/scripts/ovirt-process-config
@@ -1,4 +1,9 @@
 #!/bin/bash
+#
+# Takes as input a reference to an encoded configuration file
+# and produces from that a kernel module file and a network
+# configuration file. It then restarts the networking service
+# and saves the configuration files.
 
 ME=$(basename "$0")
 warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
@@ -58,3 +63,14 @@ networking=$(awk '/^[ \t]*ifcfg=/ {
 }' $CONFIG)
 
 echo "$networking" > $OVIRT_CONFIG_OUTPUT_FILE
+
+if [ -f $OVIRT_CONFIG_OUTPUT_FILE ]; then
+    umount_config /etc/sysconfig/network-scripts/ifcfg*
+    augtool < $OVIRT_CONFIG_OUTPUT_FILE \
+	&& RESULT=0 || RESULT=1
+    if ls /etc/sysconfig/network-scripts/ifcfg* > /dev/null >2&1; then
+	ovirt_store_config /etc/sysconfig/network-scripts/ifcfg*
+    fi
+fi
+
+exit $RESULT
-- 
1.6.0.4




More information about the ovirt-devel mailing list