Changeset dcffcc6 for fedd


Ignore:
Timestamp:
Dec 15, 2010 10:37:21 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
990b746
Parents:
c092b7f
Message:

Fix --make_dir (renamed from --make-dir). Code moves had broken it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_to_abac.py

    rc092b7f rdcffcc6  
    132132    else: sys.exit('Cannot read %s (key file)' % opts.key)
    133133
     134if opts.make_authorizer:
     135    creds_dir = mkdtemp()
     136    delete_creds = True
     137else:
     138    creds_dir = opts.dir
     139    delete_creds = False
     140
     141if opts.cert:
     142    if os.access(opts.cert, os.R_OK):
     143        if not key:
     144            if abac_pem_type(opts.cert) == 'both':
     145                key, cert = abac_split_cert(opts.cert)
     146                delete_certs = True
     147        else:
     148            cert = opts.cert
     149    else:
     150        sys.exit('Cannot read %s (certificate file)' % opts.cert)
     151
     152if any([ x is None for x in (cert, opts.dir, key)]):
     153    print >>sys.stderr, "Need output dir, certificate and key to make creds"
     154    print >>sys.stderr, "Reverting to debug mode"
     155    debug = True
     156else:
     157    debug = opts.debug
     158
    134159if opts.dir:
    135160    if opts.make_dir:
     
    145170            sys.exit('%s is not writable' % opts.dir)
    146171
    147 if opts.make_authorizer:
    148     creds_dir = mkdtemp()
    149     delete_creds = True
    150 else:
    151     creds_dir = opts.dir
    152     delete_creds = False
    153 
    154 if opts.cert:
    155     if os.access(opts.cert, os.R_OK):
    156         if not key:
    157             if abac_pem_type(opts.cert) == 'both':
    158                 key, cert = abac_split_cert(opts.cert)
    159                 delete_certs = True
    160         else:
    161             cert = opts.cert
    162     else:
    163         sys.exit('Cannot read %s (certificate file)' % opts.cert)
    164 
    165 if any([ x is None for x in (cert, opts.dir, key)]):
    166     print >>sys.stderr, "Need output dir, certificate and key to make creds"
    167     print >>sys.stderr, "Reverting to debug mode"
    168     debug = True
    169 else:
    170     debug = opts.debug
    171172
    172173try:
Note: See TracChangeset for help on using the changeset viewer.