This fixes a regression from the ipaplatform refactoring.

https://fedorahosted.org/freeipa/ticket/4763

--
PetrĀ³



From 2bea3850ff68c821b4af4e20d3992256e816c849 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Mon, 24 Nov 2014 15:01:29 +0100
Subject: [PATCH] copy_schema_to_ca: Fallback to old import location for
 ipaplatform.services

This file is copied to older servers that might not have the ipaplatform
refactoring.
Import from the old location if the new one is not available.

https://fedorahosted.org/freeipa/ticket/4763
---
 install/share/copy-schema-to-ca.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/install/share/copy-schema-to-ca.py b/install/share/copy-schema-to-ca.py
index fc53fe4cb52486cc618bec77aabe8283ad5eadbc..1614e11636c2f52e231ea2ff40d882209194c60a 100755
--- a/install/share/copy-schema-to-ca.py
+++ b/install/share/copy-schema-to-ca.py
@@ -15,13 +15,17 @@
 import pwd
 import shutil
 
-from ipaplatform import services
 from ipapython import ipautil, dogtag
 from ipapython.ipa_log_manager import root_logger, standard_logging_setup
 from ipaserver.install.dsinstance import DS_USER, schema_dirname
 from ipaserver.install.cainstance import PKI_USER
 from ipalib import api
 
+try:
+    from ipaplatform import services
+except ImportError:
+    from ipapython import services  # pylint: disable=no-name-in-module
+
 SERVERID = "PKI-IPA"
 SCHEMA_FILENAMES = (
     "60kerberos.ldif",
-- 
2.1.0

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

Reply via email to