Ignore:
Timestamp:
Feb 15, 2021, 6:34:36 PM (4 years ago)
Author:
joergs
Message:

Use tinyrpc instead of jsonrpc.

File:
1 edited

Legend:

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

    r1239 r1254  
    88
    99__author__ = "Joerg Steffens"
    10 __copyright__ = "Copyright 2012-2018, dass IT GmbH"
     10__copyright__ = "Copyright 2012-2021, dass IT GmbH"
    1111__license__ = "GPL"
    12 __version__ = "1.2"
     12__version__ = "1.3"
    1313__email__ = "joerg.steffens@dass-it.de"
    1414
     
    3030import time
    3131
    32 try:
    33     import jsonrpc
    34 except ImportError:
    35     import jsonrpclib
    36 
     32from tinyrpc.protocols.jsonrpc import JSONRPCProtocol
     33from tinyrpc.transports.http import HttpPostClientTransport
     34from tinyrpc import RPCClient
    3735
    3836UrlJsonRpc="https://<username>:<password>@opsi:4447/rpc"
     
    8987        self.nagios=nagios
    9088        self.urlJsonRpc=urlJsonRpc
    91         if 'jsonrpc' in sys.modules:
    92             self.rpc=jsonrpc.ServiceProxy(self.urlJsonRpc)
    93         else:
    94             self.rpc=jsonrpclib.ServerProxy(self.urlJsonRpc)
     89        self.rpc = RPCClient(JSONRPCProtocol(), HttpPostClientTransport(self.urlJsonRpc, verify=False)).get_proxy()
     90
    9591        self.logger.debug( "initialized: " + self.urlJsonRpc )
    9692        self.logger.debug(dir(self.rpc))
Note: See TracChangeset for help on using the changeset viewer.