Changeset 5d854e1 for fedd/federation


Ignore:
Timestamp:
Sep 21, 2010 3:12:16 PM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
3bf0b3c
Parents:
87807f42
Message:

allow FEDD_URL in the environment to set the contact URL. Man am I sick of typing --url.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/client_lib.py

    r87807f42 r5d854e1  
    3333                type="string", help="Trusted certificates (required)")
    3434        self.add_option("--url", action="store", dest="url",
    35                 type="string",default="https://localhost:23235", 
    36                 help="URL to connect to (default %default)")
     35                type="string",default=None, help="URL to connect to")
    3736        self.add_option("--transport", action="store", type="choice",
    3837                choices=("xmlrpc", "soap"), default="soap",
     
    9089    and if the debug level is set, set the tracefile attribute as well.  If any
    9190    of these tests fail, raise a RuntimeError.  Otherwise return the
    92     certificate file and the dedid.
    93     """
     91    certificate file, the fedid, and the fedd url.
     92    """
     93    default_url="https://localhost:23235"
     94
    9495    if opts.debug > 0: opts.tracefile=sys.stderr
    9596
     
    110111        raise RuntimeError("Cannot read certificate (%s)" % cert)
    111112
    112     return (cert, fid)
     113    if opts.url: url = opts.url
     114    elif 'FEDD_URL' in os.environ: url = os.environ['FEDD_URL']
     115    else: url = default_url
     116
     117
     118    return (cert, fid, url)
    113119
    114120def save_certfile(out_certfile, ea):
Note: See TracChangeset for help on using the changeset viewer.