mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-08 13:07:19 +00:00
* Fix linting errors.
* Fix bugs.
* Another linter error ignored.
* More fixes.
* Ignore sanity errors with older versions.
ci_complete
* Forgot to commit more changes.
(cherry picked from commit a54af8909c)
This commit is contained in:
parent
54bf6ef6de
commit
e4eead189b
52 changed files with 115 additions and 94 deletions
|
|
@ -97,13 +97,13 @@ from ansible.module_utils.facts.packages import CLIMgr
|
|||
|
||||
class PIP(CLIMgr):
|
||||
|
||||
def __init__(self, pip):
|
||||
def __init__(self, pip, module):
|
||||
|
||||
self.CLI = pip
|
||||
self.module = module
|
||||
|
||||
def list_installed(self):
|
||||
global module
|
||||
rc, out, err = module.run_command([self._cli, 'list', '-l', '--format=json'])
|
||||
rc, out, err = self.module.run_command([self._cli, 'list', '-l', '--format=json'])
|
||||
if rc != 0:
|
||||
raise Exception("Unable to list packages rc=%s : %s" % (rc, err))
|
||||
return json.loads(out)
|
||||
|
|
@ -116,7 +116,6 @@ class PIP(CLIMgr):
|
|||
def main():
|
||||
|
||||
# start work
|
||||
global module
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
clients=dict(type='list', elements='path', default=['pip']),
|
||||
|
|
@ -133,7 +132,7 @@ def main():
|
|||
module.warn('Skipping invalid pip client: %s' % (pip))
|
||||
continue
|
||||
try:
|
||||
pip_mgr = PIP(pip)
|
||||
pip_mgr = PIP(pip, module)
|
||||
if pip_mgr.is_available():
|
||||
found += 1
|
||||
packages[pip] = pip_mgr.get_packages()
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ class Yarn(object):
|
|||
rc, out, err = self.module.run_command(cmd, check_rc=check_rc, cwd=cwd)
|
||||
return out, err
|
||||
|
||||
return(None, None)
|
||||
return None, None
|
||||
|
||||
def list(self):
|
||||
cmd = ['list', '--depth=0', '--json']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue