From 0377645747ee0fef4cbbd6630be1e66a8786c8e4 Mon Sep 17 00:00:00 2001 From: Thomas Woerner Date: Tue, 7 Aug 2018 11:07:30 +0200 Subject: [PATCH] Raise error if DL is set to 0 or DL0 options are used In the case that the domain level is set to 0 or replica_file is set (not None) an error will be raised. See: https://pagure.io/freeipa/issue/7669 Signed-off-by: Thomas Woerner Reviewed-By: Christian Heimes --- ipaserver/install/server/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ipaserver/install/server/__init__.py b/ipaserver/install/server/__init__.py index af046e80c..7c9d6293c 100644 --- a/ipaserver/install/server/__init__.py +++ b/ipaserver/install/server/__init__.py @@ -338,6 +338,11 @@ class ServerInstallInterface(ServerCertificateInstallInterface, def __init__(self, **kwargs): super(ServerInstallInterface, self).__init__(**kwargs) + # Domain level 0 is not supported anymore + if not self._is_promote(): + raise RuntimeError( + "Domain level 0 is not supported anymore.") + # pkinit is not supported on DL0, don't allow related options if not self._is_promote(): if (self.no_pkinit or self.pkinit_cert_files is not None or @@ -501,6 +506,8 @@ class ServerInstallInterface(ServerCertificateInstallInterface, "domain via the --domain option") else: + # Domain level 0 is not supported anymore + if not os.path.isfile(self.replica_file): raise RuntimeError( "Replica file %s does not exist" % self.replica_file) @@ -636,6 +643,9 @@ class ServerReplicaInstall(ServerReplicaInstallInterface): if self.replica_file is None: replica_promote_check(self) else: + # Domain level 0 is not supported anymore + raise RuntimeError( + "Domain level 0 is not supported anymore.") replica_install_check(self) yield replica_install(self)