Skip to content

Commit 1e8bde6

Browse files
committed
Should only get from a local cookbook if you are solo
1 parent cf8bf1b commit 1e8bde6

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

chef/lib/chef/provider/remote_file.rb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,18 @@ def get_from_server(source, current_checksum)
106106
end
107107

108108
def get_from_local_cookbook(source)
109-
filename = find_preferred_file(
110-
@new_resource.cookbook_name.to_s,
111-
:remote_file,
112-
source,
113-
@node[:fqdn],
114-
@node[:platform],
115-
@node[:platform_version]
116-
)
117-
Chef::Log.debug("Using local file for remote_file:#{filename}")
118-
::File.open(filename)
109+
if Chef::Config[:solo]
110+
filename = find_preferred_file(
111+
@new_resource.cookbook_name.to_s,
112+
:remote_file,
113+
source,
114+
@node[:fqdn],
115+
@node[:platform],
116+
@node[:platform_version]
117+
)
118+
Chef::Log.debug("Using local file for remote_file:#{filename}")
119+
::File.open(filename)
120+
end
119121
end
120122

121123
end

0 commit comments

Comments
 (0)