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