Blob Blame History Raw
From 5cea94bf6ba5ecbd9e18b0bf352ca82c62e6ee34 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pviktori@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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
---
 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 sys
 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