|
|
9b9c8d |
From 7077776de3432a321298df13076ea0cc59bc35b1 Mon Sep 17 00:00:00 2001
|
|
|
9b9c8d |
From: Thomas Woerner <twoerner@redhat.com>
|
|
|
9b9c8d |
Date: Mon, 5 Sep 2022 13:16:26 +0200
|
|
|
9b9c8d |
Subject: [PATCH] ipaserver/ipareplica: Add isatty method to AnsibleModuleLog
|
|
|
9b9c8d |
|
|
|
9b9c8d |
In some cases ipa code is using sys.stdout.isatty. As stdout is mapped
|
|
|
9b9c8d |
to AnsibleModuleLog this call will lead in a traceback as it was not
|
|
|
9b9c8d |
defined.
|
|
|
9b9c8d |
|
|
|
9b9c8d |
The staticmethod isatty has been added to AnsibleModuleLog in ipaserver
|
|
|
9b9c8d |
role module_utils/ansible_ipa_server.py and in ipareplica role
|
|
|
9b9c8d |
module_utils/ansible_ipa_repica.py.
|
|
|
9b9c8d |
|
|
|
9b9c8d |
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2120415
|
|
|
9b9c8d |
ansible-freeipa Replica Install Setup DNS fails
|
|
|
9b9c8d |
Fixes: #251 - 'AnsibleModuleLog' object has no attribute 'isatty'
|
|
|
9b9c8d |
Fixes: #117 - 'AnsibleModuleLog' object has no attribute 'isatty'
|
|
|
9b9c8d |
---
|
|
|
9b9c8d |
roles/ipareplica/module_utils/ansible_ipa_replica.py | 4 ++++
|
|
|
9b9c8d |
roles/ipaserver/module_utils/ansible_ipa_server.py | 4 ++++
|
|
|
9b9c8d |
2 files changed, 8 insertions(+)
|
|
|
9b9c8d |
|
|
|
9b9c8d |
diff --git a/roles/ipareplica/module_utils/ansible_ipa_replica.py b/roles/ipareplica/module_utils/ansible_ipa_replica.py
|
|
|
9b9c8d |
index 0e4e738..27ee13d 100644
|
|
|
9b9c8d |
--- a/roles/ipareplica/module_utils/ansible_ipa_replica.py
|
|
|
9b9c8d |
+++ b/roles/ipareplica/module_utils/ansible_ipa_replica.py
|
|
|
9b9c8d |
@@ -222,6 +222,10 @@ else:
|
|
|
9b9c8d |
def info(self, msg):
|
|
|
9b9c8d |
self.module.debug(msg)
|
|
|
9b9c8d |
|
|
|
9b9c8d |
+ @staticmethod
|
|
|
9b9c8d |
+ def isatty():
|
|
|
9b9c8d |
+ return False
|
|
|
9b9c8d |
+
|
|
|
9b9c8d |
def write(self, msg):
|
|
|
9b9c8d |
self.module.debug(msg)
|
|
|
9b9c8d |
# self.module.warn(msg)
|
|
|
9b9c8d |
diff --git a/roles/ipaserver/module_utils/ansible_ipa_server.py b/roles/ipaserver/module_utils/ansible_ipa_server.py
|
|
|
9b9c8d |
index 5b1c4e5..8e7be0b 100644
|
|
|
9b9c8d |
--- a/roles/ipaserver/module_utils/ansible_ipa_server.py
|
|
|
9b9c8d |
+++ b/roles/ipaserver/module_utils/ansible_ipa_server.py
|
|
|
9b9c8d |
@@ -255,6 +255,10 @@ else:
|
|
|
9b9c8d |
def info(self, msg):
|
|
|
9b9c8d |
self.module.debug(msg)
|
|
|
9b9c8d |
|
|
|
9b9c8d |
+ @staticmethod
|
|
|
9b9c8d |
+ def isatty():
|
|
|
9b9c8d |
+ return False
|
|
|
9b9c8d |
+
|
|
|
9b9c8d |
def write(self, msg):
|
|
|
9b9c8d |
self.module.debug(msg)
|
|
|
9b9c8d |
# self.module.warn(msg)
|
|
|
9b9c8d |
--
|
|
|
9b9c8d |
2.37.3
|
|
|
9b9c8d |
|