summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Timberman <joshua@opscode.com>2013-02-09 10:00:46 -0800
committerJoshua Timberman <joshua@opscode.com>2013-02-09 10:00:46 -0800
commitbafbf837d56f3f408b645997544f8dd8d753e451 (patch)
tree5a18579897f3bc37b2efc13a4b92db30b0620115
parentae1aa99be3345e3fc8bb10783298943e5225b8b9 (diff)
parentd273805b083054683b75814d018f9268257710dc (diff)
downloadmixlib-shellout-bafbf837d56f3f408b645997544f8dd8d753e451.tar.gz
Merge pull request #23 from Nordstrom/COOK-2336
Add success_codes as an array attribute
-rw-r--r--providers/package.rb4
-rw-r--r--resources/package.rb1
2 files changed, 3 insertions, 2 deletions
diff --git a/providers/package.rb b/providers/package.rb
index e94a75b..c7c11ef 100644
--- a/providers/package.rb
+++ b/providers/package.rb
@@ -121,7 +121,7 @@ def install_package(name,version)
install_args = [cached_file(@new_resource.source, @new_resource.checksum), expand_options(unattended_installation_flags), expand_options(@new_resource.options)]
Chef::Log.info("Starting installation...this could take awhile.")
Chef::Log.debug "Install command: #{ sprintf(install_command_template, *install_args) }"
- shell_out!(sprintf(install_command_template, *install_args), {:timeout => @new_resource.timeout, :returns => [0,42,127]})
+ shell_out!(sprintf(install_command_template, *install_args), {:timeout => @new_resource.timeout, :returns => @new_resource.success_codes})
end
def remove_package(name, version)
@@ -136,7 +136,7 @@ def remove_package(name, version)
end
end
Chef::Log.info("Removing #{@new_resource} with uninstall command '#{uninstall_command}'")
- shell_out!(uninstall_command, {:returns => [0,42,127]})
+ shell_out!(uninstall_command, {:returns => @new_resource.success_codes})
end
private
diff --git a/resources/package.rb b/resources/package.rb
index bf80c57..d9b3590 100644
--- a/resources/package.rb
+++ b/resources/package.rb
@@ -29,6 +29,7 @@ attribute :options, :kind_of => String
attribute :installer_type, :kind_of => Symbol, :default => nil, :equal_to => [:msi, :inno, :nsis, :wise, :installshield, :custom]
attribute :checksum, :kind_of => String
attribute :timeout, :kind_of => Integer, :default => 600
+attribute :success_codes, :kind_of => Array, :default => [0, 42, 127]
# TODO