Move DL0 raises outside if existing conditionals to calm down pylint

This pull should not remove code, therefore it is needed to add addtional
conditionals to calm down pylint beacuse of unreachable code.

See: https://pagure.io/freeipa/issue/7669
Signed-off-by: Thomas Woerner <twoerner@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
Thomas Woerner
2018-08-07 15:44:56 +02:00
committed by Christian Heimes
parent 0eb140ea73
commit b99dc46a9c
2 changed files with 9 additions and 6 deletions

View File

@@ -182,6 +182,11 @@ class KRAInstaller(KRAInstall):
api.Backend.ldap2.connect()
if self.installing_replica:
if not self.options.promote:
# Domain level 0 is not supported anymore
raise admintool.ScriptError(
"Domain level 0 is not supported anymore")
if self.options.promote:
config = ReplicaConfig()
config.kra_host_name = None
@@ -193,9 +198,6 @@ class KRAInstaller(KRAInstall):
config.top_dir = tempfile.mkdtemp("ipa")
config.dir = config.top_dir
else:
# Domain level 0 is not supported anymore
raise admintool.ScriptError(
"Domain level 0 is not supported anymore")
config = create_replica_config(
self.options.password,
self.replica_file,

View File

@@ -640,12 +640,13 @@ class ServerReplicaInstall(ServerReplicaInstallInterface):
@step()
def main(self):
if self.replica_file is None:
replica_promote_check(self)
else:
if self.replica_file is not None:
# Domain level 0 is not supported anymore
raise RuntimeError(
"Domain level 0 is not supported anymore.")
if self.replica_file is None:
replica_promote_check(self)
else:
replica_install_check(self)
yield
replica_install(self)