From 0951833a6c72980f1520a799e2430c1d0e36ff6f Mon Sep 17 00:00:00 2001 From: David Marthy Date: Fri, 7 Aug 2020 08:26:38 +0200 Subject: [PATCH] =?UTF-8?q?ipa=20module=20utils:=20BUGFIX=20ipa=20modules?= =?UTF-8?q?=20Cookie=20problem=20with=20Loadbalanced=20IPA=20and=20Python3?= =?UTF-8?q?=20(=E2=80=A6=20(#738)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * BUGFIX ipa modules Cookie problem with Loadbalanced IPA and Python3 (#737) * Update changelogs/fragments/738-ipa-python3.yml Co-authored-by: Felix Fontein * Update plugins/module_utils/ipa.py Co-authored-by: Felix Fontein --- changelogs/fragments/738-ipa-python3.yml | 2 ++ plugins/module_utils/ipa.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/738-ipa-python3.yml diff --git a/changelogs/fragments/738-ipa-python3.yml b/changelogs/fragments/738-ipa-python3.yml new file mode 100644 index 0000000000..e732837d35 --- /dev/null +++ b/changelogs/fragments/738-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-collections/community.general/issues/737). diff --git a/plugins/module_utils/ipa.py b/plugins/module_utils/ipa.py index 6a0e7712de..9eb9f406f6 100644 --- a/plugins/module_utils/ipa.py +++ b/plugins/module_utils/ipa.py @@ -83,7 +83,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: