Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

Commit

Permalink
Fix nil access in kickstart_networking_setup
Browse files Browse the repository at this point in the history
This change fixes issues that might occur when trying to generate
kickstart provisioning scripts on hosts without subnets specified.
  • Loading branch information
ananace authored and mmoll committed Feb 13, 2017
1 parent 8710854 commit 461c1fe
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions snippets/kickstart_networking_setup.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ BOOTPROTO="<%= dhcp ? 'dhcp' : 'none' -%>"
<% unless dhcp -%>
IPADDR="<%= @host.ip -%>"
NETMASK="<%= subnet.mask -%>"
<% if subnet.gateway.present? -%>
<% if subnet && subnet.gateway.present? -%>
GATEWAY="<%= subnet.gateway %>"
<% end -%>
<% if @host.ip6.present? -%>
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=<%= @host.ip6 %>
<% if subnet6.gateway.present? -%>
<% if subnet6 && subnet6.gateway.present? -%>
IPV6_DEFAULTGW=<%= subnet6.gateway %>
<% end -%>
IPV6_PEERDNS=no
Expand All @@ -53,14 +53,14 @@ BOOTPROTO="<%= dhcp ? 'dhcp' : 'none' -%>"
<% unless dhcp || subnet.nil? -%>
IPADDR="<%= bond.ip -%>"
NETMASK="<%= subnet.mask -%>"
<% if subnet.gateway.present? -%>
<% if subnet && subnet.gateway.present? -%>
GATEWAY="<%= subnet.gateway %>"
<% end -%>
<% if bond.ip6.present? -%>
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=<%= bond.ip6 %>
<% if subnet6.gateway.present? -%>
<% if subnet6 && subnet6.gateway.present? -%>
IPV6_DEFAULTGW=<%= subnet6.gateway %>
<% end -%>
IPV6_PEERDNS=no
Expand Down Expand Up @@ -152,7 +152,7 @@ BOOTPROTO="<%= dhcp ? 'dhcp' : 'none' -%>"
<% unless dhcp -%>
IPADDR="<%= interface.ip -%>"
NETMASK="<%= subnet.mask -%>"
<% if subnet.gateway.present? -%>
<% if subnet && subnet.gateway.present? -%>
GATEWAY="<%= subnet.gateway %>"
<% end -%>
<% end -%>
Expand Down Expand Up @@ -180,7 +180,7 @@ DEFROUTE=no
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=<%= @host.ip6 %>
<% if subnet6.gateway.present? -%>
<% if subnet6 && subnet6.gateway.present? -%>
IPV6_DEFAULTGW=<%= subnet6.gateway %>
<% end -%>
IPV6_PEERDNS=no
Expand Down

0 comments on commit 461c1fe

Please sign in to comment.