Changeset 1063 for opsi/server


Ignore:
Timestamp:
Aug 15, 2012, 5:08:35 PM (12 years ago)
Author:
joergs
Message:

beautified

File:
1 edited

Legend:

Unmodified
Added
Removed
  • opsi/server/dass-opsi-tools/usr/bin/opsi-client

    r1062 r1063  
    1010__version__ = "1.0"
    1111__email__ = "joerg.steffens@dass-it.de"
    12 
    13 # ATTENTION:
    14 #   python-json-rpc has a problem with http-proxy support.
    15 #   In case of problems, make sure, the environment variables
    16 #   http_proxy / https_proxy
    17 #   are *not* set.
    1812
    1913#
     
    3529from pprint import pprint
    3630
    37 UrlJsonRpc="https://<USERNAME>:<PASSWORD>@opsi:4447/rpc"
     31UrlJsonRpc="https://<username>:<password>@opsi:4447/rpc"
     32
     33HelpEpilog="WARNING: python-json-rpc is known to have problems with HTTP proxies. In case of problems, make sure, the environment variables http_proxy and/or https_proxy are *not* set."
    3834
    3935class OpsiRpc:
     36   
    4037   
    4138    ProductAttributesCopy = ['actionRequest','actionResult','installationStatus','packageVersion','productVersion']
     
    131128
    132129if __name__ == '__main__':
    133     parser = argparse.ArgumentParser(description='Command line tool for OPSI configuration.', epilog="WARNING: python-json-rpc is known to have problems with HTTP proxies. In case of problems, make sure, the environment variables http_proxy and/or https_proxy are *not* set." )
     130    parser = argparse.ArgumentParser(description='Command line tool for OPSI configuration.', epilog=HelpEpilog )
     131
     132    parser.add_argument( '--url', required=True, help="OPSI Server JSON-RPC url, in following format: " + UrlJsonRpc )
     133   
    134134    parser.add_argument( '--debug', action='store_true', help="enable debugging output" )
    135135    #parser.add_argument( '--verbose', type=bool, help="add debugging output" )
    136     parser.add_argument( '--url', help="OPSI Server JSON-RPC url, normally https://<username>:<password>@<OPSI-SERVER>:4447/rpc" )
    137136
    138137    subparsers = parser.add_subparsers(title='subcommands',
     
    161160    args = parser.parse_args()
    162161   
    163    
    164     urlJsonRpc = UrlJsonRpc
    165     if args.url:
    166         urlJsonRpc = args.url
    167    
    168     opsi=OpsiRpc( urlJsonRpc, args.debug )
     162    opsi=OpsiRpc( args.url, args.debug )
    169163   
    170164    result = True
Note: See TracChangeset for help on using the changeset viewer.