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
This commit is contained in:
Rob Crittenden
2008-06-04 15:37:12 -04:00
parent 12899d9053
commit 68e14ed8ba
2 changed files with 13 additions and 5 deletions

View File

@@ -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:

View File

@@ -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