From 5f6efc32d20d53d49bba3bbb86d5d91a2e12eb06 Mon Sep 17 00:00:00 2001
From: Thomas Woerner <twoerner@redhat.com>
Date: Tue, 26 Mar 2019 12:59:18 +0100
Subject: [PATCH] ipareplica_setup_http: Use inspect on install_http

The promote argument has been dropped with the final removal of domain
level 0 support in version 4.7.1. The fstore argument has been added
with the 4.7.1 version also.
---
 .../library/ipareplica_setup_http.py          | 32 +++++++++++++++----
 1 file changed, 25 insertions(+), 7 deletions(-)

diff --git a/roles/ipareplica/library/ipareplica_setup_http.py b/roles/ipareplica/library/ipareplica_setup_http.py
index 98afd1b0..f7d7a993 100644
--- a/roles/ipareplica/library/ipareplica_setup_http.py
+++ b/roles/ipareplica/library/ipareplica_setup_http.py
@@ -188,13 +188,31 @@ def main():
         create_ipa_conf(fstore, config, ca_enabled,
                         master=config.master_host_name)
 
-        install_http(
-            config,
-            auto_redirect=not options.no_ui_redirect,
-            promote=promote,
-            pkcs12_info=http_pkcs12_info,
-            ca_is_configured=ca_enabled,
-            ca_file=cafile)
+        argspec = inspect.getargspec(install_http)
+        if "promote" in argspec.args:
+            install_http(
+                config,
+                auto_redirect=not options.no_ui_redirect,
+                promote=promote,
+                pkcs12_info=http_pkcs12_info,
+                ca_is_configured=ca_enabled,
+                ca_file=cafile)
+        else:
+            if "fstore" not in argspec.args:
+                install_http(
+                    config,
+                    auto_redirect=not options.no_ui_redirect,
+                    pkcs12_info=http_pkcs12_info,
+                    ca_is_configured=ca_enabled,
+                    ca_file=cafile)
+            else:
+                install_http(
+                    config,
+                    auto_redirect=not options.no_ui_redirect,
+                    pkcs12_info=http_pkcs12_info,
+                    ca_is_configured=ca_enabled,
+                    ca_file=cafile,
+                    fstore=fstore)
 
         # Need to point back to ourself after the cert for HTTP is obtained
         create_ipa_conf(fstore, config, ca_enabled)
-- 
GitLab