diff options
Diffstat (limited to 'cpp/demo/IceGrid/secure/makecerts.py')
-rwxr-xr-x | cpp/demo/IceGrid/secure/makecerts.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/cpp/demo/IceGrid/secure/makecerts.py b/cpp/demo/IceGrid/secure/makecerts.py index 5af14affc19..428934e38f1 100755 --- a/cpp/demo/IceGrid/secure/makecerts.py +++ b/cpp/demo/IceGrid/secure/makecerts.py @@ -10,22 +10,28 @@ import os, sys, shutil, glob -def iceca(args): +iceca = "iceca" + +def runIceca(args): os.environ['PYTHONUNBUFFERED'] = '1' - if os.system("iceca " + args): + if os.system(iceca + " " + args): sys.exit(1) def createCertificate(filename, cn): print "======= Creating " + filename + " certificate =======" - iceca("request --no-password --overwrite %s \"%s\"" % (filename, cn)) - iceca("sign --in %s_req.pem --out %s_cert.pem" % (filename, filename)) + runIceca("request --no-password --overwrite %s \"%s\"" % (filename, cn)) + runIceca("sign --in %s_req.pem --out %s_cert.pem" % (filename, filename)) os.remove("%s_req.pem" % filename) print print +for x in sys.argv[1:]: + if x[0:7] == "--iceca": + iceca = x[8:] + cwd = os.getcwd() if not os.path.exists("certs") or os.path.basename(cwd) != "secure": @@ -40,7 +46,7 @@ os.chdir("certs") # First, create the certificate authority. # print "======= Creating Certificate Authority =======" -iceca("init --overwrite --no-password") +runIceca("init --overwrite --no-password") print print @@ -56,6 +62,6 @@ try: except OSError: pass -iceca("import --key-pass password --store-pass password --java ca_cert ca/db/ca_cert.pem ca/db/ca_key.pem certs.jks") +runIceca("import --key-pass password --store-pass password --java ca_cert ca/db/ca_cert.pem ca/db/ca_key.pem certs.jks") os.chdir("..") |