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

Fix a comparison with a string and a byte in flatpak_remote (#44835)

* flatpak_remote: Fix the comparison between string and bytes for the remote_exists function

* Use to_text instead a new compare function

* Compare bytes to bytes
This commit is contained in:
Stéphane Wirtel 2018-08-30 22:36:34 +02:00 committed by Sviatoslav Sydorenko
parent 074aeeadff
commit 711944aa97

View file

@ -205,9 +205,11 @@ def main():
if not binary:
module.fail_json(msg="Executable '%s' was not found on the system." % executable, **result)
if state == 'present' and not remote_exists(module, binary, name, method):
remote_already_exists = remote_exists(module, binary, bytes(name, 'utf-8'), method)
if state == 'present' and not remote_already_exists:
add_remote(module, binary, name, flatpakrepo_url, method)
elif state == 'absent' and remote_exists(module, binary, name, method):
elif state == 'absent' and remote_already_exists:
remove_remote(module, binary, name, method)
module.exit_json(**result)