summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-10-19 16:15:12 -0700
committerGitHub <noreply@github.com>2020-10-19 16:15:12 -0700
commit854be3f236bdb5aa88af306d8a3649e7ac593965 (patch)
tree7a9aff31fe8025a4fdb1d6c93dce9ef4feb07698
parent3808a192536970524cac4aab51b60143453d72e4 (diff)
parentbdf5a3c5cc2bf32285fd9981816d25823cfec728 (diff)
downloadchef-854be3f236bdb5aa88af306d8a3649e7ac593965.tar.gz
Merge pull request #10533 from chef/native_resource
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/provider/ifconfig/debian.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/chef/provider/ifconfig/debian.rb b/lib/chef/provider/ifconfig/debian.rb
index baab06128b..9b359d7c54 100644
--- a/lib/chef/provider/ifconfig/debian.rb
+++ b/lib/chef/provider/ifconfig/debian.rb
@@ -83,10 +83,9 @@ iface <%= new_resource.device %> <%= new_resource.family %> static
# on ubuntu 18.04+ there's no interfaces file and it uses interfaces.d by default
return if ::File.directory?(INTERFACES_DOT_D_DIR) && !::File.exist?(INTERFACES_FILE)
- # create /etc/network/interfaces.d via dir resource (to get reporting, etc)
- dir = Chef::Resource::Directory.new(INTERFACES_DOT_D_DIR, run_context)
- dir.run_action(:create)
- new_resource.updated_by_last_action(true) if dir.updated_by_last_action?
+ # create /etc/network/interfaces.d via dir if it's missing
+ directory INTERFACES_DOT_D_DIR
+
# roll our own file_edit resource, this will not get reported until we have a file_edit resource
interfaces_dot_d_for_regexp = INTERFACES_DOT_D_DIR.gsub(/\./, '\.') # escape dots for the regexp
regexp = %r{^\s*source\s+#{interfaces_dot_d_for_regexp}/\*\s*$}