1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix module

This commit is contained in:
Amin Vakil 2021-02-26 17:03:41 +03:30
parent f8eeda3776
commit 5936da3198
No known key found for this signature in database
GPG key ID: AE2ED731CF227C72

View file

@ -96,7 +96,8 @@ class YumVersionLock:
def ensure_state(self, package, command):
""" Ensure package state """
packages = " ".join(package)
rc, out, err = self.module.run_command([self.yum_bin, "-q", "versionlock", command, packages])
cmd = "%s -q versionlock %s %s" % (self.yum_bin, command, packages)
rc, out, err = self.module.run_command(cmd)
if rc == 0:
return True
self.module.fail_json(msg="Error: " + to_native(err) + to_native(out))