Changeset 1063
- Timestamp:
- Aug 15, 2012, 5:08:35 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
opsi/server/dass-opsi-tools/usr/bin/opsi-client
r1062 r1063 10 10 __version__ = "1.0" 11 11 __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 variables16 # http_proxy / https_proxy17 # are *not* set.18 12 19 13 # … … 35 29 from pprint import pprint 36 30 37 UrlJsonRpc="https://<USERNAME>:<PASSWORD>@opsi:4447/rpc" 31 UrlJsonRpc="https://<username>:<password>@opsi:4447/rpc" 32 33 HelpEpilog="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." 38 34 39 35 class OpsiRpc: 36 40 37 41 38 ProductAttributesCopy = ['actionRequest','actionResult','installationStatus','packageVersion','productVersion'] … … 131 128 132 129 if __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 134 134 parser.add_argument( '--debug', action='store_true', help="enable debugging output" ) 135 135 #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" )137 136 138 137 subparsers = parser.add_subparsers(title='subcommands', … … 161 160 args = parser.parse_args() 162 161 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 ) 169 163 170 164 result = True
Note:
See TracChangeset
for help on using the changeset viewer.