From 50cec8cdfd5ad16f1b4414a6774e947f3c419d91 Mon Sep 17 00:00:00 2001
From: Felipe Volpone <felipevolpone@gmail.com>
Date: Fri, 23 Jun 2017 15:32:22 -0300
Subject: [PATCH] Fixing ipa-replica-install --setup-kra if it's the first KRA
 in topology

---
 ipaserver/install/server/replicainstall.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
index 4f28de25bd..0c1545a1c3 100644
--- a/ipaserver/install/server/replicainstall.py
+++ b/ipaserver/install/server/replicainstall.py
@@ -1252,11 +1252,10 @@ def promote_check(installer):
             config.kra_host_name = kra_host
             kra_enabled = True
         else:
-            if options.setup_kra:
-                root_logger.error("There is no KRA server in the domain, "
-                                  "can't setup a KRA clone")
-                raise ScriptError(rval=3)
             kra_enabled = False
+            if options.setup_kra:
+                kra.install(api, config, options)
+                kra_enabled = True
 
         if ca_enabled:
             options.realm_name = config.realm_name
