summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipa-install/ipa-replica-prepare
diff options
context:
space:
mode:
authorMartin Nagy <mnagy@redhat.com>2008-08-15 18:08:01 +0200
committerMartin Nagy <mnagy@redhat.com>2008-09-11 23:34:01 +0200
commit885103c32127d10250564e25c5895464fb366f9e (patch)
tree5db92cd0d4282b3e1aacbfc04c9d076a0d515bec /ipa-server/ipa-install/ipa-replica-prepare
parent57669ba43224eee0d90556aeea03d14873b4bd7f (diff)
downloadfreeipa-885103c32127d10250564e25c5895464fb366f9e.tar.gz
freeipa-885103c32127d10250564e25c5895464fb366f9e.tar.xz
freeipa-885103c32127d10250564e25c5895464fb366f9e.zip
Rework config.py and change cli tools. Maintain order of IPA servers from command line, config and DNS. Parse options before detecting IPA configuration. Don't ignore rest of the options if one is missing in ipa.conf. Drop the --usage options, we will rely on --help. Fixes: 458869, 459070, 458980, 459234
Diffstat (limited to 'ipa-server/ipa-install/ipa-replica-prepare')
-rw-r--r--ipa-server/ipa-install/ipa-replica-prepare10
1 files changed, 5 insertions, 5 deletions
diff --git a/ipa-server/ipa-install/ipa-replica-prepare b/ipa-server/ipa-install/ipa-replica-prepare
index ab2e6af8f..67445e394 100644
--- a/ipa-server/ipa-install/ipa-replica-prepare
+++ b/ipa-server/ipa-install/ipa-replica-prepare
@@ -39,8 +39,6 @@ def usage():
def parse_options():
parser = OptionParser(version=version.VERSION)
- args = ipa.config.init_config(sys.argv)
-
parser.add_option("--dirsrv_pkcs12", dest="dirsrv_pkcs12",
help="install certificate for the directory server")
parser.add_option("--http_pkcs12", dest="http_pkcs12",
@@ -52,7 +50,7 @@ def parse_options():
parser.add_option("-p", "--password", dest="password",
help="Directory Manager (existing master) password")
- options, args = parser.parse_args(args)
+ options, args = parser.parse_args()
# If any of the PKCS#12 options are selected, all are required. Create a
# list of the options and count it to enforce that all are required without
@@ -62,9 +60,11 @@ def parse_options():
if cnt > 0 and cnt < 4:
parser.error("error: All PKCS#12 options are required if any are used.")
- if len(args) != 2:
+ if len(args) != 1:
parser.error("must provide the fully-qualified name of the replica")
+ ipa.config.init_config(options)
+
return options, args
def get_host_name():
@@ -171,7 +171,7 @@ def get_dirman_password():
def main():
options, args = parse_options()
- replica_fqdn = args[1]
+ replica_fqdn = args[0]
if not ipautil.file_exists(certs.CA_SERIALNO) and not options.dirsrv_pin:
sys.exit("The replica must be created on the primary IPA server.\nIf you installed IPA with your own certificates using PKCS#12 files you must provide PKCS#12 files for any replicas you create as well.")