Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions lib/puppet/type/file/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,7 @@ def handle_response_error(response)
defaultto :ignore
newvalues(:use, :use_when_creating, :ignore)
munge do |value|
value = value ? value.to_sym : :ignore
if @resource.file && @resource.line && value != :ignore
# TRANSLATORS "source_permissions" is a parameter name and should not be translated
Puppet.puppet_deprecation_warning(_("The `source_permissions` parameter is deprecated. Explicitly set `owner`, `group`, and `mode`."), file: @resource.file, line: @resource.line)
end

value
value ? value.to_sym : :ignore
end
end
end
15 changes: 0 additions & 15 deletions spec/integration/type/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1309,21 +1309,6 @@ def build_path(dir)
end

describe "when sourcing" do
it "should give a deprecation warning when the user sets source_permissions" do
expect(Puppet).to receive(:puppet_deprecation_warning).with(
'The `source_permissions` parameter is deprecated. Explicitly set `owner`, `group`, and `mode`.',
{:file => 'my/file.pp', :line => 5})

catalog.add_resource described_class.new(:path => path, :content => 'this is content', :source_permissions => :use_when_creating)
catalog.apply
end

it "should not give a deprecation warning when the user does not set source_permissions" do
expect(Puppet).not_to receive(:puppet_deprecation_warning)
catalog.add_resource described_class.new(:path => path, :content => 'this is content')
catalog.apply
end

with_checksum_types "source", "default_values" do
before(:each) do
set_mode(0770, checksum_file)
Expand Down
5 changes: 0 additions & 5 deletions spec/unit/configurer/downloader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,6 @@ def generate_file_resource(options = {})
expect(@dler.catalog.host_config).to eq(false)
end

it "should not issue a deprecation warning for source_permissions" do
expect(Puppet).not_to receive(:puppet_deprecation_warning)
catalog = @dler.catalog
expect(catalog.resources.size).to eq(1) # Must consume catalog to fix warnings
end
end

describe "when downloading" do
Expand Down