summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2013-08-20 06:39:39 +0000
committerPetr Viktorin <pviktori@redhat.com>2013-08-20 16:18:59 +0200
commit02be7acd155170b2be9b013013c5f110aa01eb16 (patch)
treed0291cef21275c469e8a4030744485aa8fc8e95f /ipaserver
parent1669253238f87f508b0b599029d16d4f0d594b30 (diff)
downloadfreeipa-02be7acd155170b2be9b013013c5f110aa01eb16.tar.gz
freeipa-02be7acd155170b2be9b013013c5f110aa01eb16.tar.xz
freeipa-02be7acd155170b2be9b013013c5f110aa01eb16.zip
Add --pin option to ipa-server-certinstall.
Hide the unnecessary --dirsrv_pin and --http_pin options. https://fedorahosted.org/freeipa/ticket/3869
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/install/ipa_server_certinstall.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/ipaserver/install/ipa_server_certinstall.py b/ipaserver/install/ipa_server_certinstall.py
index 4960fda61..a87f393e1 100644
--- a/ipaserver/install/ipa_server_certinstall.py
+++ b/ipaserver/install/ipa_server_certinstall.py
@@ -23,6 +23,7 @@ import sys
import os
import os.path
import pwd
+import optparse
from ipapython import admintool
from ipapython.dn import DN
@@ -53,13 +54,13 @@ class ServerCertInstall(admintool.AdminTool):
dest="http", action="store_true", default=False,
help="install certificate for the http server")
parser.add_option(
- "--dirsrv_pin",
- dest="dirsrv_pin",
- help="The password of the Directory Server PKCS#12 file")
+ "--pin",
+ dest="pin",
+ help="The password of the PKCS#12 file")
parser.add_option(
- "--http_pin",
- dest="http_pin",
- help="The password of the Apache Server PKCS#12 file")
+ "--dirsrv_pin", "--http_pin",
+ dest="pin",
+ help=optparse.SUPPRESS_HELP)
def validate_options(self):
super(ServerCertInstall, self).validate_options(needs_root=True)
@@ -68,8 +69,7 @@ class ServerCertInstall(admintool.AdminTool):
if not self.options.dirsrv and not self.options.http:
self.option_parser.error("you must specify dirsrv and/or http")
- if ((self.options.dirsrv and not self.options.dirsrv_pin) or
- (self.options.http and not self.options.http_pin)):
+ if not self.options.pin:
self.option_parser.error("you must provide the password for the "
"PKCS#12 file")
@@ -111,7 +111,7 @@ class ServerCertInstall(admintool.AdminTool):
['nssslpersonalityssl'])
old_cert = entry.single_value('nssslpersonalityssl')
- server_cert = self.import_cert(dirname, self.options.dirsrv_pin,
+ server_cert = self.import_cert(dirname, self.options.pin,
old_cert, 'ldap/%s' % api.env.host,
'restart_dirsrv %s' % serverid)
@@ -129,7 +129,7 @@ class ServerCertInstall(admintool.AdminTool):
old_cert = installutils.get_directive(httpinstance.NSS_CONF,
'NSSNickname')
- server_cert = self.import_cert(dirname, self.options.http_pin,
+ server_cert = self.import_cert(dirname, self.options.pin,
old_cert, 'HTTP/%s' % api.env.host,
'restart_httpd')