diff options
author | Yuhui Huang <yuhui.huang@hbo.com> | 2015-07-21 16:07:25 -0700 |
---|---|---|
committer | Toshio Kuratomi <toshio@fedoraproject.org> | 2016-03-07 11:40:01 -0800 |
commit | d6365f9d9d29c4e1e42dad11514b2846ca3f0f5a (patch) | |
tree | d3f0d6df5141b1a9c881fd152765303bbb6e10db | |
parent | 8dc285c7942cd0673fc59d117acf86c96fa38714 (diff) | |
download | ansible-modules-core-d6365f9d9d29c4e1e42dad11514b2846ca3f0f5a.tar.gz |
Checking pip uninstall output in both stdout and stderr
-rw-r--r-- | packaging/language/pip.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packaging/language/pip.py b/packaging/language/pip.py index d9ecc17a..102071bf 100644 --- a/packaging/language/pip.py +++ b/packaging/language/pip.py @@ -147,7 +147,7 @@ def _get_cmd_options(module, cmd): words = stdout.strip().split() cmd_options = [ x for x in words if x.startswith('--') ] return cmd_options - + def _get_full_name(name, version=None): if version is None: @@ -342,7 +342,8 @@ def main(): rc, out_pip, err_pip = module.run_command(cmd, path_prefix=path_prefix, cwd=this_dir) out += out_pip err += err_pip - if rc == 1 and state == 'absent' and 'not installed' in out_pip: + if rc == 1 and state == 'absent' and \ + ('not installed' in out_pip or 'not installed' in err_pip): pass # rc is 1 when attempting to uninstall non-installed package elif rc != 0: _fail(module, cmd, out, err) |