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

rshm_repository: reduce execution time when changed == False (#458)

Co-authored-by: Giovanni Sciortino <gsciorti@redhat.com>
This commit is contained in:
Giovanni Sciortino 2020-06-11 10:00:48 +02:00 committed by GitHub
parent 519162443f
commit 7bdd78b053
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,3 @@
bugfixes:
- rshm_repository - reduce execution time when changed is False
(https://github.com/ansible-collections/community.general/pull/458).

View file

@ -217,7 +217,7 @@ def repository_modify(module, state, name, purge=False):
'before_header': "RHSM repositories",
'after_header': "RHSM repositories"}
if not module.check_mode:
if not module.check_mode and changed:
rc, out, err = run_subscription_manager(module, rhsm_arguments)
results = out.splitlines()
module.exit_json(results=results, changed=changed, repositories=updated_repo_list, diff=diff)