From e859a2b4e55a14ca83d00618cb33940cc8a33d00 Mon Sep 17 00:00:00 2001 From: David Marthy Date: Fri, 7 Aug 2020 22:36:06 +0200 Subject: [PATCH] ipa module utils can not handle HA FreeIPA with Python3 #71110 (#71112) * BUGFIX 2.9 ipa module utils can not handle HA FreeIPA with Python3 * Resolve comments on other PR --- changelogs/fragments/71112-ipa-python3.yml | 2 ++ lib/ansible/module_utils/ipa.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/71112-ipa-python3.yml diff --git a/changelogs/fragments/71112-ipa-python3.yml b/changelogs/fragments/71112-ipa-python3.yml new file mode 100644 index 00000000000..c4f0fe5d532 --- /dev/null +++ b/changelogs/fragments/71112-ipa-python3.yml @@ -0,0 +1,2 @@ +bugfixes: + - ipa_hostgroup - fix an issue with load-balanced ipa and cookie handling with Python 3 - (https://github.com/ansible/ansible/issues/71110). diff --git a/lib/ansible/module_utils/ipa.py b/lib/ansible/module_utils/ipa.py index e6f959eda11..015131b7c89 100644 --- a/lib/ansible/module_utils/ipa.py +++ b/lib/ansible/module_utils/ipa.py @@ -96,7 +96,7 @@ class IPAClient(object): if status_code not in [200, 201, 204]: self._fail('login', info['msg']) - self.headers = {'Cookie': resp.info().get('Set-Cookie')} + self.headers = {'Cookie': info.get('set-cookie')} except Exception as e: self._fail('login', to_native(e)) if not self.headers: