[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Freeipa-devel] [PATCH] add -p/--password option to ipa-replica-install



Add -p/--password option so the DM password can be passed on the command-line.

The import for version moved from ipaserver to ipa, fix that as well.

rob
>From 1bc76a8c1c7fc6722806b1dd20d9fe35e3dc13bf Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten redhat com>
Date: Wed, 4 Jun 2008 15:37:12 -0400
Subject: [PATCH] Add -p/--password option so the DM password can be passed on the command-line.

The import for version moved from ipaserver to ipa, fix that as well.

449858
---
 ipa-server/ipa-install/ipa-replica-install |   15 ++++++++++-----
 ipa-server/man/ipa-replica-install.1       |    3 +++
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/ipa-server/ipa-install/ipa-replica-install b/ipa-server/ipa-install/ipa-replica-install
index 2b37516..a2798bb 100644
--- a/ipa-server/ipa-install/ipa-replica-install
+++ b/ipa-server/ipa-install/ipa-replica-install
@@ -28,7 +28,7 @@ from ipa import ipautil
 
 from ipaserver import dsinstance, replication, installutils, krbinstance, service
 from ipaserver import httpinstance, ntpinstance, certs, ipaldap
-from ipaserver import version
+from ipa import version
 
 class ReplicaConfig:
     def __init__(self):
@@ -48,6 +48,8 @@ def parse_options():
                       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", 
+                      help="Directory Manager (existing master) password")
 
     options, args = parser.parse_args()
 
@@ -196,10 +198,13 @@ def main():
     config.dir = dir
 
     # get the directory manager password
-    try:
-        config.dirman_password = get_dirman_password()
-    except KeyboardInterrupt:
-        sys.exit(0)
+    if not options.password:
+        try:
+            config.dirman_password = get_dirman_password()
+        except KeyboardInterrupt:
+            sys.exit(0)
+    else:
+        config.dirman_password = options.password
 
     # Try out the password
     try:
diff --git a/ipa-server/man/ipa-replica-install.1 b/ipa-server/man/ipa-replica-install.1
index 4041f0c..674afd1 100644
--- a/ipa-server/man/ipa-replica-install.1
+++ b/ipa-server/man/ipa-replica-install.1
@@ -32,6 +32,9 @@ Enable debug logging when more verbose output is needed
 .TP 
 \fB\-n\fR, \fB\-\-no\-ntp\fR
 Do not configure NTP
+.TP 
+\fB\-p\fR, \fB\-\-password\fR=\fIDM_PASSWORD\fR 
+Directory Manager (existing master) password
 .SH "EXIT STATUS"
 0 if the command was successful
 
-- 
1.5.4

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]