Skip to content

Commit fb8e840

Browse files
olivierHascotty-c
authored andcommitted
Fix systemd escaping issue #124 (#125)
* Fix systemd escaping issue #124 * Fix test spec/defines/run_spec.rb issue #124
1 parent e6fc7b6 commit fb8e840

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/puppet/parser/functions/docker_run_flags.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module Puppet::Parser::Functions
6060
['--link %s', 'links'],
6161
['--lxc-conf="%s"', 'lxc_conf'],
6262
['--volumes-from %s', 'volumes_from'],
63-
['-e %s', 'env'],
63+
['-e "%s"', 'env'],
6464
['--env-file %s', 'env_file'],
6565
['-p %s', 'ports'],
6666
['-l %s', 'labels'],

spec/defines/run_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,12 @@
320320

321321
context 'when passing serveral environment variables' do
322322
let(:params) { {'command' => 'command', 'image' => 'base', 'env' => ['FOO=BAR', 'FOO2=BAR2']} }
323-
it { should contain_file(initscript).with_content(/-e FOO=BAR/).with_content(/-e FOO2=BAR2/) }
323+
it { should contain_file(initscript).with_content(/-e "FOO=BAR"/).with_content(/-e "FOO2=BAR2"/) }
324324
end
325325

326326
context 'when passing an environment variable' do
327327
let(:params) { {'command' => 'command', 'image' => 'base', 'env' => 'FOO=BAR'} }
328-
it { should contain_file(initscript).with_content(/-e FOO=BAR/) }
328+
it { should contain_file(initscript).with_content(/-e "FOO=BAR"/) }
329329
end
330330

331331
context 'when passing serveral environment files' do

0 commit comments

Comments
 (0)