[Ovirt-devel] [PATCH server] fixed prov_network_gateway when only using one nic

Joey Boggs jboggs at redhat.com
Tue Feb 10 16:42:33 UTC 2009


---
 installer/bin/ovirt-installer |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer
index f703149..342dc09 100755
--- a/installer/bin/ovirt-installer
+++ b/installer/bin/ovirt-installer
@@ -168,17 +168,18 @@ end
 dhcp_setup = prompt_yes_no("Does your provisioning network already have dhcp?")
 if dhcp_setup == "n"
     dnsdomainname = `/bin/dnsdomainname`
+    default_gw = `route -n | grep 'UG'|awk {'print $2'}`
     dhcp_interface = prov_dev
     dhcp_network = prompt_for_answer("Enter the first 3 octets of the dhcp network you wish to use (example: 192.168.50):", :regex => THREE_OCTETS)
     dhcp_start = prompt_for_answer("Enter the dhcp pool start address (example: 3):", :regex => OCTET)
     dhcp_stop = prompt_for_answer("Enter the dhcp pool end addess (example: 100):", :regex => OCTET)
     dhcp_domain = prompt_for_answer("Enter the dhcp domain you wish to use (example: example.com):", :default => dnsdomainname.chomp, :regex => IP_OR_FQDN)
+    prov_network_gateway = prompt_for_answer("Enter the network gateway for your provisioning network (example: 192.168.50.254):", :default => default_gw.chomp, :regex => IP_OR_FQDN)
     tftp_setup = prompt_yes_no("Provide pxe/tftp capability?")
 
     if sep_networks == "y"
         prov_ip = `ifconfig #{prov_dev}`
         prov_dns_server = prov_ip.scan(/\s*inet addr:([\d.]+)/)
-        prov_network_gateway = prompt_for_answer("Enter the network gateway for your provisioning network (example: 192.168.50.254):", :regex => IP_OR_FQDN)
     end
 end
 
@@ -253,12 +254,12 @@ $dhcp_start = '<%= dhcp_start %>'
 $dhcp_stop = '<%= dhcp_stop %>'
 $dhcp_domain = '<%= dhcp_domain %>'
 $ntp_server = '<%= mgmt_ipaddr %>'
+$prov_network_gateway = '<%= prov_network_gateway %>'
 <% if tftp_setup == "y" %>
 include tftp::bundled
 <% end %>
 <% if sep_networks == "y" %>
 $prov_dns_server = '<%= prov_dns_server %>'
-$prov_network_gateway = '<%= prov_network_gateway %>'
 <% end %>
 <% end %>
 
-- 
1.6.0.6




More information about the ovirt-devel mailing list