Skip to content

Commit

Permalink
Fixes #37010 - Support safe navigation operator in safemode
Browse files Browse the repository at this point in the history
Safemode 1.4.0 has added support for this. This makes sure that version
is included.
  • Loading branch information
ekohl authored and evgeni committed Jan 3, 2024
1 parent a1142ab commit 93ac254
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ gem 'deep_cloneable', '>= 3', '< 4'
gem 'validates_lengths_from_database', '~> 0.5'
gem 'friendly_id', '>= 5.4.2', '< 6'
gem 'secure_headers', '~> 6.3'
gem 'safemode', '>= 1.3.5', '< 2'
gem 'safemode', '>= 1.4', '< 2'
gem 'fast_gettext', '~> 1.4'
gem 'gettext_i18n_rails', '~> 1.8'
gem 'rails-i18n', '~> 7.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ description: |
options.push('fips=1')
end

nic_delay = subnet4 ? subnet4.nic_delay : nil
nic_delay ||= subnet6 ? subnet6.nic_delay : nil
nic_delay = subnet4&.nic_delay || subnet6&.nic_delay
if nic_delay && rhel_compatible && major >= 7
["dhcp", "iflink", "ifup", "route", "ipv6dad", "ipv6auto", "carrier"].each do |type|
options.push("rd.net.timeout.#{type}=#{nic_delay}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ description: |
:interface => bond,
:subnet => bond.subnet,
:subnet6 => bond.subnet6,
:dhcp => bond.subnet.nil? ? false : bond.subnet.dhcp_boot_mode? }) -%>
:dhcp => bond.subnet&.dhcp_boot_mode? }) -%>
<%= save_to_file('/etc/sysconfig/network-scripts/ifcfg-$sanitized_real', ifcfg) %>

<%- @host.interfaces_with_identifier(bond.attached_devices_identifiers).each do |interface| -%>
Expand Down Expand Up @@ -47,7 +47,7 @@ description: |
:subnet => interface.subnet,
:subnet6 => interface.subnet6,
:bonding_interfaces => bonding_interfaces,
:dhcp => interface.subnet.nil? ? false : interface.subnet.dhcp_boot_mode?,
:dhcp => interface.subnet&.dhcp_boot_mode?,
:attached_to_bond => interface_identifier.present? }) %>
<%= save_to_file('/etc/sysconfig/network-scripts/ifcfg-$sanitized_real', ifcfg) %>
<%- end %>
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ oses:
:interface => bond,
:subnet => bond.subnet,
:subnet6 => bond.subnet6,
:dhcp => bond.subnet.nil? ? false : bond.subnet.dhcp_boot_mode?,
:dhcp6 => bond.subnet6.nil? ? false : bond.subnet.dhcp_boot_mode? }) -%>
:dhcp => bond.subnet&.dhcp_boot_mode?,
:dhcp6 => bond.subnet&.dhcp_boot_mode? }) -%>
<%= result -%>
interfaces: <%= bond.attached_devices_identifiers %>
parameters:
Expand All @@ -60,8 +60,8 @@ oses:
:interface => bridge,
:subnet => bridge.subnet,
:subnet6 => bridge.subnet6,
:dhcp => bridge.subnet.nil? ? false : bridge.subnet.dhcp_boot_mode?,
:dhcp6 => bridge.subnet6.nil? ? false : bridge.subnet.dhcp_boot_mode? }) -%>
:dhcp => bridge.subnet&.dhcp_boot_mode?,
:dhcp6 => bridge.subnet6&.dhcp_boot_mode? }) -%>
<%= result -%>
<%- end -%>
<%#
Expand All @@ -81,8 +81,8 @@ oses:
:interface => vlan,
:subnet => vlan.subnet,
:subnet6 => vlan.subnet6,
:dhcp => vlan.subnet.nil? ? false : vlan.subnet.dhcp_boot_mode?,
:dhcp6 => vlan.subnet6.nil? ? false : vlan.subnet.dhcp_boot_mode? }) -%>
:dhcp => vlan.subnet&.dhcp_boot_mode?,
:dhcp6 => vlan.subnet6&.dhcp_boot_mode? }) -%>
<%= result -%>
id: <%= vlan.tag %>
link: <%= vlan.attached_to %>
Expand All @@ -104,8 +104,8 @@ oses:
:interface => interface,
:subnet => interface.subnet,
:subnet6 => interface.subnet6,
:dhcp => interface.subnet.nil? ? false : interface.subnet.dhcp_boot_mode?,
:dhcp6 => interface.subnet6.nil? ? false : interface.subnet.dhcp_boot_mode? }) -%>
:dhcp => interface.subnet.dhcp_boot_mode?,
:dhcp6 => interface.subnet6&.dhcp_boot_mode? }) -%>
<%= result -%>
<%- end -%>
<%- end -%>

0 comments on commit 93ac254

Please sign in to comment.