[Ovirt-devel] [PATCH node] Moved functionality to o-process-config.
Perry Myers
pmyers at redhat.com
Wed Jan 7 17:20:22 UTC 2009
Darryl L. Pierce wrote:
> 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.
Conceptual Ack... If this has been adequately tested go ahead and push it.
Perry
> 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
--
|=- Red Hat, Engineering, Emerging Technologies, Boston -=|
|=- Email: pmyers at redhat.com -=|
|=- Office: +1 412 474 3552 Mobile: +1 703 362 9622 -=|
|=- GnuPG: E65E4F3D 88F9 F1C9 C2F3 1303 01FE 817C C5D2 8B91 E65E 4F3D -=|
More information about the ovirt-devel
mailing list