Skip to content

Commit

Permalink
Hound fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewoliver committed Feb 4, 2019
1 parent d3492a8 commit 3ffcf4c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion chef/cookbooks/dhcp/libraries/helpers.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module DhcpHelper
def self.config_filename(base, ip_version, extension=".conf")
def self.config_filename(base, ip_version, extension = ".conf")
if ip_version == "4"
"#{base}#{extension}"
else
Expand Down
5 changes: 3 additions & 2 deletions chef/cookbooks/dhcp/providers/subnet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
filename = "/etc/dhcp3/subnets.d/#{new_resource.subnet}.conf"
template filename do
cookbook "dhcp"
source "#{subnet_template}"
source subnet_template
variables(
network: new_resource.network,
options: new_resource.options,
Expand All @@ -32,9 +32,10 @@
notifies :restart, resources(service: "dhcp3-server"), :delayed
end
end
subnet_file = DhcpHelper.config_filename("subnet_list", new_resource.ip_version)
utils_line "include \"#{filename}\";" do
action :add
file "/etc/dhcp3/subnets.d/#{DhcpHelper.config_filename("subnet_list", new_resource.ip_version)}"
file "/etc/dhcp3/subnets.d/#{subnet_file}"
if node[:provisioner][:enable_pxe]
notifies :restart, resources(service: "dhcp3-server"), :delayed
end
Expand Down
2 changes: 1 addition & 1 deletion chef/cookbooks/dhcp/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@

service "dhcp3-server" do
if %w(suse rhel).include?(node[:platform_family])
service_name "#{DhcpHelper.config_filename("dhcpd", admin_network.ip_version, "")}"
service_name DhcpHelper.config_filename("dhcpd", admin_network.ip_version, "")
elsif node[:platform] == "ubuntu"
case node[:lsb][:codename]
when "maverick"
Expand Down

0 comments on commit 3ffcf4c

Please sign in to comment.