On 10/06/2011 10:21 PM, Rob Crittenden wrote:
Adam Young wrote:
Not yet ready for prime time.

I've tested the changes to updateinstance by hand, so I know they work.
I'm having problems with the python import setup.

RPM build fails with:


install/tools/ipa-upgradeconfig:36: [F0401] Unable to import 'installutils'


And, if I uncomment the import for http utils, I get an error at run
time as well. That confuses me, as I am able to import installutils at
runtime.

I think these patches fix it. Please double check my comments. I tested this on a non-updated dogtag install (e.g. it doesn't have the new script) and it didn't seem to break anything.

rob
They work, but require this additional patch to the RPM spec.
From 2d988528bc43e7cdd088fc97c81e634bdd87351c Mon Sep 17 00:00:00 2001
From: Adam Young <ayo...@redhat.com>
Date: Fri, 7 Oct 2011 13:07:55 -0400
Subject: [PATCH] Force the upgrade of pki-setup when upgrading the RPMS

---
 freeipa.spec.in       |    5 +++++
 ipapython/services.py |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 0 deletions(-)
 create mode 100644 ipapython/services.py

diff --git a/freeipa.spec.in b/freeipa.spec.in
index 8ebe1896a6d45c9a4b86cc16d0432299d209adb3..0171f853995514d96041d842885dacb0708480ca 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -112,6 +112,7 @@ Requires: slapi-nis >= 0.21
 %if 0%{?fedora} >= 15
 Requires: pki-ca >= 9.0.12
 Requires: pki-silent >= 9.0.12
+Requires: pki-setup  >= 9.0.15
 %else
 Requires: pki-ca >= 9.0.5
 Requires: pki-silent >= 9.0.5
@@ -550,6 +551,10 @@ fi
 %ghost %attr(0644,root,apache) %config(noreplace) %{_sysconfdir}/ipa/default.conf
 
 %changelog
+* Fri Oct 7 2011 Adam Young <ayo...@redhat.com> - 2.1.1-2
+- Add explicit dependency on pki-setup.
+
+
 * Mon Sep 12 2011 Alexander Bokovoy <aboko...@redhat.com> - 2.1.1-1
 - Make sure platform adaptation is packaged in -python sub-package
 
diff --git a/ipapython/services.py b/ipapython/services.py
new file mode 100644
index 0000000000000000000000000000000000000000..c27c4865f1f86100ae4924239b9212e305384223
--- /dev/null
+++ b/ipapython/services.py
@@ -0,0 +1,48 @@
+# Authors: Alexander Bokovoy <aboko...@redhat.com>
+#
+# Copyright (C) 2011  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# authconfig is an entry point to platform-provided AuthConfig implementation
+# (instance of ipapython.platform.base.AuthConfig)
+authconfig = None
+
+# knownservices is an entry point to known platform services
+# (instance of ipapython.platform.base.KnownServices) 
+knownservices = None
+
+# service is a class to instantiate ipapython.platform.base.PlatformService
+service = None
+
+# restore context default implementation  that does nothing
+def restore_context_default(filepath):
+    return
+
+# Restore security context for a path
+# If the platform has security features where context is important, implement your own
+# version in platform services
+restore_context = restore_context_default
+
+# Default implementation of backup and replace hostname that does nothing
+def backup_and_replace_hostname_default(fstore, statestore, hostname):
+    return
+
+# Backup and replace system's hostname
+# Since many platforms have their own way how to store system's hostname, this method must be
+# implemented in platform services
+backup_and_replace_hostname = backup_and_replace_hostname_default
+
+from ipapython.platform.redhat import *
-- 
1.7.6

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to