summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoser, Kevin <Kevin.Moser@nordstrom.com>2013-02-04 09:58:41 -0800
committerMoser, Kevin <Kevin.Moser@nordstrom.com>2013-02-04 09:58:41 -0800
commitd273805b083054683b75814d018f9268257710dc (patch)
tree5a18579897f3bc37b2efc13a4b92db30b0620115
parentae1aa99be3345e3fc8bb10783298943e5225b8b9 (diff)
downloadmixlib-shellout-d273805b083054683b75814d018f9268257710dc.tar.gz
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