replicainstall: Add check for domain if server is specified

Avoids failing in the later stages during the ipa-client-install
command.

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Tomas Babej authored and Petr Vobornik committed 2015-12-11 17:21:14 +01:00
1 parent e9baafb08f
commit c3c8651ac1
1 file changed
+6
@@ -1461,6 +1461,12 @@ class Replica(BaseServer):
raise RuntimeError("--dirsrv-cert-file and --http-cert-file "
"are required if any PKCS#12 options are "
"used")
if self.server and not self.domain_name:
raise RuntimeError("The --server option cannot be used "
"without providing domain via the --domain "
"option")
else:
if not ipautil.file_exists(self.replica_file):
raise RuntimeError("Replica file %s does not exist"