Skip to content

Commit

Permalink
Merge pull request #820 from puppetlabs/GH-819-permission_denied_from…
Browse files Browse the repository at this point in the history
…_mkdir

Fix permission denied issue introduced in v4.2.0
  • Loading branch information
david22swan authored Apr 14, 2022
2 parents d2c44c5 + a34a1e2 commit 8167cd5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 26 deletions.
3 changes: 1 addition & 2 deletions lib/puppet/provider/docker_compose/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
end

has_command(:docker_compose, command(:dockercompose)) do
Dir.mkdir('/tmp_docker') unless Dir.exist?('/tmp_docker')
ENV.store('TMPDIR', '/tmp_docker')
environment(HOME: '/root')
end

def exists?
Expand Down
6 changes: 0 additions & 6 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,6 @@
}
else
it {
# Stub /tmp_docker dir to prevent shelling out during spec test
allow(Dir).to receive(:exist?).and_wrap_original do |original_method, a|
original_method.call(a)
end
allow(Dir).to receive(:exist?).with('/tmp_docker').and_return(true)

is_expected.to contain_class('docker::repos').that_comes_before('Class[docker::install]')
is_expected.to contain_class('docker::install').that_comes_before('Class[docker::config]')
is_expected.to contain_class('docker::config').that_comes_before('Class[docker::service]')
Expand Down
9 changes: 0 additions & 9 deletions spec/defines/registry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

require 'spec_helper'

# Stub /tmp_docker dir to prevent shelling out during spec test
class Dir
class << self
def exist?(var)
return true if var == '/tmp_docker'
end
end
end

tests = {
'with ensure => absent' => {
'ensure' => 'absent',
Expand Down
9 changes: 0 additions & 9 deletions spec/unit/lib/puppet/type/docker_compose_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

require 'spec_helper'

# Stub /tmp_docker dir to prevent shelling out during spec test
class Dir
class << self
def exist?(var)
return true if var == '/tmp_docker'
end
end
end

compose = Puppet::Type.type(:docker_compose)

describe compose do
Expand Down

0 comments on commit 8167cd5

Please sign in to comment.