diff options
author | Casey Fitzpatrick <kcghost@gmail.com> | 2014-06-08 19:59:44 -0400 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2014-06-09 14:14:09 -0500 |
commit | fadf02d0c6bc981d9e4c06ce5cf3998a248f17fb (patch) | |
tree | 95c44bbdcba371626f6a11fa3a46317885663985 /library | |
parent | 3ebecdd1edd5d19a4a3c63a1520712efeda3b7bf (diff) | |
download | ansible-fadf02d0c6bc981d9e4c06ce5cf3998a248f17fb.tar.gz |
fix for svr4pkg module failure reporting, issue #7645
Diffstat (limited to 'library')
-rw-r--r-- | library/packaging/svr4pkg | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/library/packaging/svr4pkg b/library/packaging/svr4pkg index 4e790b46c5..6a79497e6b 100644 --- a/library/packaging/svr4pkg +++ b/library/packaging/svr4pkg @@ -152,7 +152,7 @@ def package_install(module, name, src, proxy, response_file, zone, category): os.unlink(adminfile) return (rc, out, err) -def package_uninstall(module, name, src): +def package_uninstall(module, name, src, category): adminfile = create_admin_file() if category: cmd = [ 'pkgrm', '-na', adminfile, '-Y', name ] @@ -209,10 +209,18 @@ def main(): (rc, out, err) = package_uninstall(module, name, src, category) out = out[:75] - if rc is None: + #Success,Warning,Interruption,Reboot all,Reboot this return codes + if rc is 0 or rc is 2 or rc is 3 or rc is 10 or rc is 20: + result['changed'] = True + #no install nor uninstall, or failed + else: result['changed'] = False + + #Fatal error,Administration,Administration Interaction return codes + if rc is 1 or rc is 4 or rc is 5: + result['failed'] = True else: - result['changed'] = True + result['failed'] = False if out: result['stdout'] = out |