403b09
From 0c3b7bd3b51626fc7f29c98087e1d59ea079bcda Mon Sep 17 00:00:00 2001
403b09
From: Florence Blanc-Renaud <flo@redhat.com>
403b09
Date: Thu, 1 Sep 2016 15:53:38 +0200
403b09
Subject: [PATCH] Fix ipa-certupdate for CA-less installation
403b09
403b09
In a CA-less installation, ipa-certupdate fails with the error message:
403b09
  $ ipa-certupdate
403b09
  trying https://vm-180.abc.idm.lab.eng.brq.redhat.com/ipa/session/json
403b09
  Forwarding 'ca_is_enabled' to json server 'https://vm-180.abc.idm.lab.eng.brq.redhat.com/ipa/session/json'
403b09
  Forwarding 'ca_find/1' to json server 'https://vm-180.abc.idm.lab.eng.brq.redhat.com/ipa/session/json'
403b09
  CA is not configured
403b09
  The ipa-certupdate command failed.
403b09
403b09
The issue happens because ipa-certupdate tries to call ca_find even on a
403b09
CA_less deployment. The fix skips the call to ca_find in this case.
403b09
403b09
https://fedorahosted.org/freeipa/ticket/6288
403b09
403b09
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
403b09
---
403b09
 ipaclient/ipa_certupdate.py | 7 ++++---
403b09
 1 file changed, 4 insertions(+), 3 deletions(-)
403b09
403b09
diff --git a/ipaclient/ipa_certupdate.py b/ipaclient/ipa_certupdate.py
403b09
index e59047a2705eb8ccb98b5213c4c8771f55a29bc5..f340f32bcdca5f5d98177f7aa9af366b67d8dd80 100644
403b09
--- a/ipaclient/ipa_certupdate.py
403b09
+++ b/ipaclient/ipa_certupdate.py
403b09
@@ -87,9 +87,10 @@ class CertUpdate(admintool.AdminTool):
403b09
 
403b09
             # find lightweight CAs (on renewal master only)
403b09
             lwcas = []
403b09
-            for ca_obj in api.Command.ca_find()['result']:
403b09
-                if IPA_CA_CN not in ca_obj['cn']:
403b09
-                    lwcas.append(ca_obj)
403b09
+            if ca_enabled:
403b09
+                for ca_obj in api.Command.ca_find()['result']:
403b09
+                    if IPA_CA_CN not in ca_obj['cn']:
403b09
+                        lwcas.append(ca_obj)
403b09
 
403b09
             api.Backend.rpcclient.disconnect()
403b09
         finally:
403b09
-- 
403b09
2.7.4
403b09