Changeset 1254


Ignore:
Timestamp:
02/15/21 18:34:36 (4 months ago)
Author:
joergs
Message:

Use tinyrpc instead of jsonrpc.

Location:
opsi/server/dass-opsi-tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • opsi/server/dass-opsi-tools/dass-opsi-tools.spec

    r1239 r1254  
    11#
    2 # Copyright  (c)  2012  dass IT GmbH, Koeln, Germany.
     2# Copyright  (c)  2012-2021  dass IT GmbH, Koeln, Germany.
    33# This file and all modifications and additions to the pristine
    44# package are under the same license as the package itself.
     
    88Name:           dass-opsi-tools
    99URL:            http://trac.dass-it.de/pub/
    10 License:        GPL
     10License:        GPL-2.0-or-later
    1111Group:          Productivity/Networking/Opsi
    1212Autoreqprov:    on
    13 Summary:        dass IT addon tools for OPSI
    14 Version:        1.2
     13Summary:        OPSI admin tools from dass IT
     14Version:        1.3
    1515Release:        0
    1616
    1717Requires:       python-dateutil
    18 Requires:       python-json-rpc
     18Requires:       python-tinyrpc
    1919# python-argparse is part of python >= 2.7
    2020%if ( ( 0%{?suse_version} && 0%{?suse_version} <= 1110 )  || ( 0%{?rhel_version} && 0%{?rhel_version} <= 600 ) )
     
    5353%defattr(-,root,root)
    5454/usr/bin/*
    55 
  • 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.