Handle empty output in remote_exists (backport of #52010 to 2.7) (#54103)

* flatpak_remote: Handle empty output in remote_exists (#52010)

`flatpak remote-list -d` can return an empty output on Fedora 29 (version 1.2.0).

(cherry picked from commit fcb6f136cd)

* Adds changelog fragment for 52010 backport
This commit is contained in:
Alexander Bethke 2019-03-22 19:30:21 +01:00 committed by Toshio Kuratomi
parent 3d5bf87b9d
commit 9173941100
2 changed files with 4 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- flatpak_remote - Handle empty output in remote_exists, fixes https://github.com/ansible/ansible/issues/51481

View file

@ -169,6 +169,8 @@ def remote_exists(module, binary, name, method):
output = _flatpak_command(module, False, command)
for line in output.splitlines():
listed_remote = line.split()
if len(listed_remote) == 0:
continue
if listed_remote[0] == to_native(name):
return True
return False