diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-22 19:22:33 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-22 19:22:33 +0000 |
| commit | ccc4d95dd28164f6f10763a758db85db0d48984c (patch) | |
| tree | f1f799db506e64b27518cd9f271e282be1b342dc /lib | |
| parent | e64bd22abed67399fd888964d6a18af60c1f3993 (diff) | |
| download | puppet-ccc4d95dd28164f6f10763a758db85db0d48984c.tar.gz puppet-ccc4d95dd28164f6f10763a758db85db0d48984c.tar.xz puppet-ccc4d95dd28164f6f10763a758db85db0d48984c.zip | |
Modifying non-existent-package test to make sure syncing fails, and modified ports package type to check the error output instead of the return code, because the portinstall command returns 0 even on failure.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1133 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/puppet/type/package/ports.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/puppet/type/package/ports.rb b/lib/puppet/type/package/ports.rb index b748ffb3e..972aa90be 100755 --- a/lib/puppet/type/package/ports.rb +++ b/lib/puppet/type/package/ports.rb @@ -13,7 +13,12 @@ module Puppet cmd = "/usr/local/sbin/portupgrade -p -N -P #{self[:name]}" self.debug "Executing %s" % cmd.inspect - output = %x{#{cmd} 2>&1} + output = %x{#{cmd} 2>&1 1>/dev/null} + + if output =~ /\*\* No such / + raise Puppet::PackageError, "Could not find package %s" % self[:name] + end + #output = %x{#{cmd} 2>&1} unless $? == 0 raise Puppet::PackageError.new(output) |
