summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-replica-install
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-10-29 20:24:31 +0200
committerRob Crittenden <rcritten@redhat.com>2010-11-09 13:28:10 -0500
commit594adb98773d365efda5a7449f66042015645f7f (patch)
tree885747621352119fbe3751c4b0f84b148136b162 /install/tools/ipa-replica-install
parent22056206641f7b8f2751f9d4f2200e7c5030e084 (diff)
downloadfreeipa-594adb98773d365efda5a7449f66042015645f7f.tar.gz
freeipa-594adb98773d365efda5a7449f66042015645f7f.tar.xz
freeipa-594adb98773d365efda5a7449f66042015645f7f.zip
Log script options to logfile
Uses a new subclass IPAOptionParser in scripts instead of OptionParser from the standard python library. IPAOptionParser uses its own IPAOption class to store options, which adds a new 'sensitive' attribute. https://fedorahosted.org/freeipa/ticket/393
Diffstat (limited to 'install/tools/ipa-replica-install')
-rwxr-xr-xinstall/tools/ipa-replica-install12
1 files changed, 7 insertions, 5 deletions
diff --git a/install/tools/ipa-replica-install b/install/tools/ipa-replica-install
index e54101202..e4aae4aa3 100755
--- a/install/tools/ipa-replica-install
+++ b/install/tools/ipa-replica-install
@@ -31,6 +31,7 @@ from ipaserver.install import bindinstance, httpinstance, ntpinstance, certs
from ipaserver.plugins.ldap2 import ldap2
from ipapython import version
from ipalib import api, errors, util
+from ipapython.config import IPAOptionParser
CACERT="/usr/share/ipa/html/ca.crt"
@@ -50,14 +51,13 @@ class ReplicaConfig:
self.subject_base = "O=IPA"
def parse_options():
- from optparse import OptionParser
usage = "%prog [options] REPLICA_FILE"
- parser = OptionParser(usage=usage, version=version.VERSION)
+ parser = IPAOptionParser(usage=usage, version=version.VERSION)
parser.add_option("-N", "--no-ntp", dest="conf_ntp", action="store_false",
help="do not configure ntp", default=True)
parser.add_option("-d", "--debug", dest="debug", action="store_true",
default=False, help="gather extra debugging information")
- parser.add_option("-p", "--password", dest="password",
+ parser.add_option("-p", "--password", dest="password", sensitive=True,
help="Directory Manager (existing master) password")
parser.add_option("--setup-dns", dest="setup_dns", action="store_true",
default=False, help="configure bind with our zone")
@@ -70,6 +70,7 @@ def parse_options():
help="Do not use DNS for hostname lookup during installation")
options, args = parser.parse_args()
+ safe_options = parser.get_safe_opts(options)
if len(args) != 1:
parser.error("you must provide a file generated by ipa-replica-prepare")
@@ -84,7 +85,7 @@ def parse_options():
elif not options.forwarders and not options.no_forwarders:
parser.error("You must specify at least one --forwarder option or --no-forwarders option")
- return options, args[0]
+ return safe_options, options, args[0]
def get_dirman_password():
return installutils.read_password("Directory Manager (existing master)", confirm=False, validate=False)
@@ -261,8 +262,9 @@ def check_bind():
sys.exit(1)
def main():
- options, filename = parse_options()
+ safe_options, options, filename = parse_options()
installutils.standard_logging_setup("/var/log/ipareplica-install.log", options.debug)
+ logging.debug('%s was invoked with argument "%s" and options: %s' % (sys.argv[0], filename, safe_options))
if not ipautil.file_exists(filename):
sys.exit("Replica file %s does not exist" % filename)