diff --git a/packaging/os/pkgutil.py b/packaging/os/pkgutil.py index 78a7db72bf5..fe0e82a5ab7 100644 --- a/packaging/os/pkgutil.py +++ b/packaging/os/pkgutil.py @@ -162,10 +162,15 @@ def main(): (rc, out, err) = package_uninstall(module, name) out = out[:75] - if rc is None: - result['changed'] = False - else: + if rc == 0: result['changed'] = True + else: + result['changed'] = False + + if rc is not None and rc != 0: + result['failed'] = True + else: + result['failed'] = False if out: result['stdout'] = out