Changeset 7036
- Timestamp:
- 18/06/10 16:28:16 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/MyProxyClient/myproxy/script.py
r7035 r7036 28 28 29 29 def make_optparser(): 30 usage = "usage: %prog [options] username"30 usage = "usage: %prog [options] [proxyfile]" 31 31 op = optparse.OptionParser(usage=usage) 32 32 … … 51 51 op.add_option('-k', '--keyfile', dest='keyfile', 52 52 action='store', type='string', metavar='KEYFILE', 53 help='Write the private key to KEYFILE rather than stdout')53 help='Write the private key to KEYFILE rather than proxyfile') 54 54 op.add_option('-c', '--certfile', dest='certfile', 55 55 action='store', type='string', metavar='CERTFILE', 56 help='Write the proxy certificate to CERTFILE rather than stdout')56 help='Write the proxy certificate to CERTFILE rather than proxyfile') 57 57 op.add_option('-O', '--openid', dest='openid', 58 58 action='store', type='string', metavar='OPENID', … … 82 82 83 83 options, args = op.parse_args(argv[1:]) 84 #!NOTE: no arguments 84 if args: 85 outfile = args[0] 86 else: 87 outfile = None 85 88 86 89 if options.openid: … … 114 117 cert, key = creds 115 118 119 if outfile: 120 fout = open(outfile, 'w') 121 else: 122 fout = sys.stdout 123 116 124 if options.certfile: 117 125 fh = open(options.certfile, 'w') … … 119 127 fh.close() 120 128 else: 121 sys.stdout.write(cert)129 fout.write(cert) 122 130 123 131 if options.keyfile: … … 126 134 fh.close() 127 135 else: 128 sys.stdout.write(key)136 fout.write(key) 129 137 130 138
Note: See TracChangeset
for help on using the changeset viewer.