#!/usr/local/bin/python from optparse import OptionParser from federation.authorizer import abac_authorizer class Parser(OptionParser): def __init__(self): OptionParser.__init__(self, usage='%prog [options') self.add_option('--cert', dest='cert', help='Identity certificate') self.add_option('--key', dest='key', help='Identity key') self.add_option('--policy', dest='policy', help='ABAC policy certificates') self.add_option('--dir', dest='out_dir', help='directory to save into') parser = Parser() opts, args = parser.parse_args() if any([ not x for x in (opts.key, opts.cert, opts.policy, opts.out_dir)]): parser.print_help() sys.exit(1) a = abac_authorizer(key=opts.key, me=opts.cert, certs=opts.policy) a.save(opts.out_dir)