summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorDagobert Michelsen <dam@opencsw.org>2015-05-27 13:35:34 +0200
committerDagobert Michelsen <dam@opencsw.org>2015-05-27 13:35:34 +0200
commit7f74a98451674d1d735ab92295ca64ebd340bf65 (patch)
tree89f1876dda6e7c057de0c47b95aec846eee83d92 /packaging
parent3c8d118b723a04b91c01107b0597d2fdf8e35739 (diff)
downloadansible-modules-extras-7f74a98451674d1d735ab92295ca64ebd340bf65.tar.gz
svr4pkg: assume command worked only on known-to-be-good returncodes
Diffstat (limited to 'packaging')
-rw-r--r--packaging/os/svr4pkg.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/packaging/os/svr4pkg.py b/packaging/os/svr4pkg.py
index 51cda437..5d8bac17 100644
--- a/packaging/os/svr4pkg.py
+++ b/packaging/os/svr4pkg.py
@@ -209,15 +209,25 @@ def main():
(rc, out, err) = package_uninstall(module, name, src, category)
out = out[:75]
- # Success, Warning, Interruption, Reboot all, Reboot this return codes
+ # Returncodes as per pkgadd(1m)
+ # 0 Successful completion
+ # 1 Fatal error.
+ # 2 Warning.
+ # 3 Interruption.
+ # 4 Administration.
+ # 5 Administration. Interaction is required. Do not use pkgadd -n.
+ # 10 Reboot after installation of all packages.
+ # 20 Reboot after installation of this package.
+ # 99 (observed) pkgadd: ERROR: could not process datastream from </tmp/pkgutil.pkg>
if rc in (0, 2, 3, 10, 20):
result['changed'] = True
# no install nor uninstall, or failed
else:
result['changed'] = False
- # Fatal error, Administration, Administration Interaction return codes
- if rc in (1, 4 , 5):
+ # Only return failed=False when the returncode is known to be good as there may be more
+ # undocumented failure return codes
+ if rc not in (0, 2, 10, 20):
result['failed'] = True
else:
result['failed'] = False