mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
rhsm_repository: Properly handle no repos (#51938)
When no repos are defined, the `repo` variable is undefined. Therefore append it only to the result if a repo was found. Otherwise Ansible will fail with an UnboundLocalError.
This commit is contained in:
@@ -160,7 +160,7 @@ def get_repository_list(module, list_parameter):
|
||||
"enabled": True if repo_enabled == '1' else False
|
||||
}
|
||||
|
||||
repo_result.append(repo)
|
||||
repo_result.append(repo)
|
||||
|
||||
return repo_result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user