From 15b3bab5b727c2d79bcbfa3295d9c848b2c7b1f2 Mon Sep 17 00:00:00 2001 From: Chris Trufan <31186388+ctrufan@users.noreply.github.com> Date: Thu, 12 Sep 2019 15:05:23 -0400 Subject: [PATCH] =?UTF-8?q?Always=20specify=20header=20of=20connection=20k?= =?UTF-8?q?eep-alive=20regardless=20of=20python=20v=E2=80=A6=20(#62218)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Always specify header of connection keep-alive regardless of python version. * Add chgangelog fragment * Fixes to changelog fragment (cherry picked from commit 606e13919ee028a8c33e6e1e65980a8488c971fa) --- changelogs/fragments/62218-fix-to-entrust-api.yml | 3 +++ lib/ansible/module_utils/ecs/api.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/62218-fix-to-entrust-api.yml diff --git a/changelogs/fragments/62218-fix-to-entrust-api.yml b/changelogs/fragments/62218-fix-to-entrust-api.yml new file mode 100644 index 00000000000..6454f1c6d50 --- /dev/null +++ b/changelogs/fragments/62218-fix-to-entrust-api.yml @@ -0,0 +1,3 @@ +bugfixes: +- "openssl_certificate - When provider is ``entrust``, use a ``connection: keep-alive`` header for ECS API connections." +- "ecs_certificate - Always specify header ``connection: keep-alive`` for ECS API connections." diff --git a/lib/ansible/module_utils/ecs/api.py b/lib/ansible/module_utils/ecs/api.py index 17812dbb937..d89b03330bc 100644 --- a/lib/ansible/module_utils/ecs/api.py +++ b/lib/ansible/module_utils/ecs/api.py @@ -241,7 +241,10 @@ class ECSSession(object): return resource def _set_config(self, name, **kwargs): - headers = {"Content-Type": "application/json"} + headers = { + "Content-Type": "application/json", + "Connection": "keep-alive", + } self.request = Request(headers=headers, timeout=60) configurators = [self._read_config_vars]