Changeset d39809f


Ignore:
Timestamp:
Sep 22, 2010 5:52:47 PM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
2628e5d
Parents:
27d964d
Message:

Add get_abac_certs a function to get the certificates from a directory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/client_lib.py

    r27d964d rd39809f  
    22
    33import sys
     4import pwd
    45import os
    5 import pwd
     6import os.path
     7
     8from string import join
    69
    710
     
    2528        self.add_option("--cert", action="store", dest="cert",
    2629                type="string", help="my certificate file")
     30        self.add_option("--abac", action="store", dest="abac_dir",
     31                type="string", help="Directory with abac certs")
    2732        self.add_option( "--debug", action="count", dest="debug",
    2833                default=0, help="Set debug.  Repeat for more information")
     
    8186        cert = None
    8287    return cert
     88
     89def get_abac_certs(dir):
     90    '''
     91    Return a list of the contents of the files in dir.  These should be abac
     92    certificates, but that isn't checked.
     93    '''
     94    rv = [ ]
     95    if dir:
     96        for fn in ["%s/%s" % (dir, p) for p in os.listdir(dir) \
     97                if os.path.isfile("%s/%s" % (dir,p))]:
     98            f = open(fn, 'r')
     99            rv.append(join(f))
     100            f.close()
     101    return rv
     102
    83103
    84104def wrangle_standard_options(opts):
Note: See TracChangeset for help on using the changeset viewer.