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
pull/44929/head
Stéphane Wirtel 6 years ago committed by Sviatoslav Sydorenko
parent 074aeeadff
commit 711944aa97

@ -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)

Loading…
Cancel
Save