Code Review
/
puppet-modules
/
puppetlabs-apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge pull request #743 from smortex/fix-automatic-coercion-warning
[puppet-modules/puppetlabs-apt.git]
/
tasks
/
init.rb
diff --git
a/tasks/init.rb
b/tasks/init.rb
index 5db86ebb0c00b0fca3ca3883e6156129287306cc..d256468b64a739fdaa6446f49b1d5069bc46891d 100755
(executable)
--- a/
tasks/init.rb
+++ b/
tasks/init.rb
@@
-4,9
+4,9
@@
require 'open3'
require 'puppet'
def apt_get(action)
require 'puppet'
def apt_get(action)
- cmd
_string = "apt-get #{action}"
- cmd
_string << ' -y' if
action == 'upgrade'
- stdout, stderr, status = Open3.capture3(
cmd_string
)
+ cmd
= ['apt-get', action]
+ cmd
<< ' -y' if
action == 'upgrade'
+ stdout, stderr, status = Open3.capture3(
*cmd
)
raise Puppet::Error, stderr if status != 0
{ status: stdout.strip }
end
raise Puppet::Error, stderr if status != 0
{ status: stdout.strip }
end