[Ovirt-devel] [PATCH node] A gateway is not required to configure networking.

Darryl L. Pierce dpierce at redhat.com
Wed Apr 29 19:52:55 UTC 2009


If during configuration the user enters an address and netmask, but not
gateway, this patch doesn't attempt to write on to the augeas
configuration file.

Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
---
 scripts/ovirt-config-networking |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking
index b8601a4..46f74da 100755
--- a/scripts/ovirt-config-networking
+++ b/scripts/ovirt-config-networking
@@ -65,7 +65,9 @@ function configure_interface
                     BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/BOOTPROTO none"
                     BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPADDR $IPADDR"
                     BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/NETMASK $NETMASK"
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/GATEWAY $GATEWAY"
+                    if [ -n "${GATEWAY}" ]; then
+                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/GATEWAY $GATEWAY"
+                    fi
                     ;;
                 A|a) return ;;
             esac
-- 
1.6.0.6




More information about the ovirt-devel mailing list