Adding unknown ca tests
[certmaster.git] / scripts / certmaster-request
index 1d7df8c..de4d047 100755 (executable)
@@ -17,6 +17,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 import distutils.sysconfig
 import optparse
+import sys
 
 from certmaster import requester
 
@@ -27,6 +28,13 @@ if __name__ == "__main__":
         metavar="NAME", 
         help='hostname to use as the CN for the certificate')
     
+    parser.add_option('--ca', action="store", dest="ca", default='',
+        metavar="CA", 
+        help='certificate authority used to sign the certificate')
+    
     (opts, args) = parser.parse_args()
 
-    requester.request_cert(hostname=opts.hostname)
+    try:
+        requester.request_cert(hostname=opts.hostname, ca_name=opts.ca)
+    except Exception as e:
+        print >> sys.stderr, "error: %s" % str(e)