Ignore:
Timestamp:
Dec 10, 2010 9:03:35 AM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
52b6ebc
Parents:
913dc7a (diff), 8d5394e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of tardis.deterlab.net:/var/local/git/fedd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/client_lib.py

    r8d5394e r66bb590  
    1010
    1111from fedid import fedid
    12 from util import fedd_ssl_context
     12from util import fedd_ssl_context, file_expanding_opts
    1313from remote_service import service_caller
    1414from service_error import service_error
     
    1717
    1818
    19 class client_opts(OptionParser):
     19class client_opts(file_expanding_opts):
    2020    """
    2121    Standatd set of options that all clients talking to fedd can probably use.
    2222    Client code usually specializes this.
    2323    """
     24
    2425    def __init__(self):
    25         OptionParser.__init__(self, usage="%prog [opts] (--help for details)",
     26        file_expanding_opts.__init__(self,
     27                usage="%prog [opts] (--help for details)",
    2628                version="0.1")
    2729
    28         self.add_option("--cert", action="store", dest="cert",
     30        self.add_option("--cert", action="callback", dest="cert",
     31                callback=self.expand_file,
    2932                type="string", help="my certificate file")
    30         self.add_option("--abac", action="store", dest="abac_dir",
    31                 type="string", help="Directory with abac certs")
     33        self.add_option("--abac", action="callback", dest="abac_dir",
     34                callback=self.expand_file,
     35                type="string", default=os.path.expanduser('~/.abac'),
     36                help="Directory with abac certs")
     37        self.add_option('--no_abac', action='store_const', const=None,
     38                dest='abac_dir', help='Do not use abac authorization')
    3239        self.add_option( "--debug", action="count", dest="debug",
    3340                default=0, help="Set debug.  Repeat for more information")
     
    3542                dest="serialize_only", default=False,
    3643                help="Print the SOAP request that would be sent and exit")
    37         self.add_option("--trusted", action="store", dest="trusted",
     44        self.add_option("--trusted", action="callback", dest="trusted",
     45                callback=self.expand_file,
    3846                type="string", help="Trusted certificates (required)")
    3947        self.add_option("--url", action="store", dest="url",
     
    98106    '''
    99107    rv = [ ]
    100     if dir:
     108    if dir and os.path.isdir(dir):
    101109        for fn in ["%s/%s" % (dir, p) for p in os.listdir(dir) \
    102110                if os.path.isfile("%s/%s" % (dir,p))]:
Note: See TracChangeset for help on using the changeset viewer.