[Freeipa-devel] [PATCH] 0069 renew_ca_cert: bootstrap api with in_server=True

Fraser Tweedale ftweedal at redhat.com
Fri Jun 17 06:53:09 UTC 2016


On Fri, Jun 17, 2016 at 08:35:45AM +0200, Jan Cholasta wrote:
> Hi,
> 
> On 17.6.2016 06:55, Fraser Tweedale wrote:
> > Attached patch fixes https://fedorahosted.org/freeipa/ticket/5968
> 
> This should be fixed for all the restart scripts, not just renew_ca_cert.
> 
Updated patch attached.
-------------- next part --------------
From dac1e3e748fc5b9b3d48aa1dc2050d5f9a505773 Mon Sep 17 00:00:00 2001
From: Fraser Tweedale <ftweedal at redhat.com>
Date: Fri, 17 Jun 2016 14:18:05 +1000
Subject: [PATCH] restart scripts: bootstrap api with in_server=True

renew_ca_cert fails because it cannot access the 'config' plugin.
Bootstrap all the restart scripts to avoid such issues.

Fixes: https://fedorahosted.org/freeipa/ticket/5968
---
 install/restart_scripts/renew_ca_cert  | 2 +-
 install/restart_scripts/renew_ra_cert  | 2 +-
 install/restart_scripts/restart_dirsrv | 2 +-
 install/restart_scripts/stop_pkicad    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/install/restart_scripts/renew_ca_cert b/install/restart_scripts/renew_ca_cert
index bfb726cddf1b747f01512a85408fd479427ced44..dc0f1117b366e3fdcf6d00f0e6d928e2e32b8f2b 100644
--- a/install/restart_scripts/renew_ca_cert
+++ b/install/restart_scripts/renew_ca_cert
@@ -38,7 +38,7 @@ from ipaplatform.paths import paths
 def _main():
     nickname = sys.argv[1]
 
-    api.bootstrap(context='restart')
+    api.bootstrap(in_server=True, context='restart')
     api.finalize()
 
     dogtag_service = services.knownservices['pki_tomcatd']
diff --git a/install/restart_scripts/renew_ra_cert b/install/restart_scripts/renew_ra_cert
index 9b5e231b526432bec3e6d187a674042a27b94b57..17a7af9b079ea6d91fc60fac2bcc65d8ec7d8bc0 100644
--- a/install/restart_scripts/renew_ra_cert
+++ b/install/restart_scripts/renew_ra_cert
@@ -37,7 +37,7 @@ from ipaplatform.paths import paths
 def _main():
     nickname = 'ipaCert'
 
-    api.bootstrap(context='restart')
+    api.bootstrap(in_server=True, context='restart')
     api.finalize()
 
     tmpdir = tempfile.mkdtemp(prefix="tmp-")
diff --git a/install/restart_scripts/restart_dirsrv b/install/restart_scripts/restart_dirsrv
index 856729b5cd8dcfe7885a6ccf64aa847e6379102c..a8e78184f9a6f595a11440fbddae3c41933bb29b 100644
--- a/install/restart_scripts/restart_dirsrv
+++ b/install/restart_scripts/restart_dirsrv
@@ -33,7 +33,7 @@ def _main():
     except IndexError:
         instance = ""
 
-    api.bootstrap(context='restart')
+    api.bootstrap(in_server=True, context='restart')
     api.finalize()
 
     syslog.syslog(syslog.LOG_NOTICE, "certmonger restarted dirsrv instance '%s'" % instance)
diff --git a/install/restart_scripts/stop_pkicad b/install/restart_scripts/stop_pkicad
index 30b99eeff80b42aedbada583df37f9fddb076aec..ae07dcd588a54bbb1328b289c9218d2053f32c0b 100644
--- a/install/restart_scripts/stop_pkicad
+++ b/install/restart_scripts/stop_pkicad
@@ -27,7 +27,7 @@ from ipaserver.install import certs
 
 
 def main():
-    api.bootstrap(context='restart')
+    api.bootstrap(in_server=True, context='restart')
     api.finalize()
 
     dogtag_service = services.knownservices['pki_tomcatd']
-- 
2.5.5



More information about the Freeipa-devel mailing list