Darryl L. Pierce
2008-Dec-19 22:11 UTC
[Ovirt-devel] [PATCH node] Moved functionality to o-process-config.
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
Darryl L. Pierce
2008-Dec-23 13:12 UTC
[Ovirt-devel] Re: [PATCH node] Moved functionality to o-process-config.
On Fri, Dec 19, 2008 at 05:11:43PM -0500, 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.Can I get some feedback or an ACK on this patch, please? -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Virtual Machine Management - http://www.ovirt.org/ "What do you care what other people think, Mr. Feynman?" -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20081223/c9a08354/attachment.sig>
Darryl L. Pierce
2009-Jan-07 13:02 UTC
[Ovirt-devel] Re: [PATCH node] Moved functionality to o-process-config.
On Tue, Dec 23, 2008 at 08:12:11AM -0500, Darryl L. Pierce wrote:> On Fri, Dec 19, 2008 at 05:11:43PM -0500, 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. > > Can I get some feedback or an ACK on this patch, please?Still waiting on an ACK here. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Virtual Machine Management - http://www.ovirt.org/ "What do you care what other people think, Mr. Feynman?" -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090107/1ee8913b/attachment.sig>
Perry Myers
2009-Jan-07 17:20 UTC
[Ovirt-devel] [PATCH node] Moved functionality to o-process-config.
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 -=|