import sys
import glob
+import optparse
import os
import certmaster
-from optparse import OptionParser
def errorprint(stuff):
print >> sys.stderr, stuff
+class CertmasterCAOptionParser(optparse.OptionParser):
+ def get_version(self):
+ return file("/etc/func/version").read().strip()
def parseargs(args):
usage = 'certmaster-ca <option> [args]'
- parser = OptionParser(usage=usage)
+ parser = CertmasterCAOptionParser(usage=usage,version=True)
parser.add_option('-l', '--list', default=False, action="store_true",
help='list signing requests remaining')
if opts.list:
hns = cm.get_csrs_waiting()
if hns:
- for hn in cm.get_csrs_waiting():
+ for hn in sorted(hns):
print hn
else:
print 'No certificates to sign'
signed_certs = cm.get_signed_certs(args)
- for i in signed_certs:
+ for i in sorted(signed_certs):
print i
return 0
cert_hashes = cm.get_cert_hashes(hostglobs)
- for i in cert_hashes:
+ for i in sorted(cert_hashes):
print i
return 0