Skip to content

Migrate jsonrpclib to maintained fork and sync interfaces to current API - #596

Open
jonasbardino wants to merge 6 commits into
nextfrom
adjust/jsonrpcinterface-and-xmlrpcinterface-and-dependencies
Open

Migrate jsonrpclib to maintained fork and sync interfaces to current API#596
jonasbardino wants to merge 6 commits into
nextfrom
adjust/jsonrpcinterface-and-xmlrpcinterface-and-dependencies

Conversation

@jonasbardino

@jonasbardino jonasbardino commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Migrate our jsonrpclib dependency for the mig/cgi-bin/jsonrpcinterface.py backend and mig/user/jsonrpcsslclient.py example to the actively maintained jsonrpclib-pelix fork and sync interfaces to current API.
Polish and reuse more from xmlrpcX example scripts in lockstep with #595. Also includes the mig/shared/rpcfunctions.py server-side fixes from there so there's a bit of overlap.

NB: a similar jsonrpclib switch to jsonrpclib-pelix is needed in the docker-migrid Dockerfile.

…s to

current API and reuse more from xmlrpcX example scripts.
@jonasbardino jonasbardino self-assigned this Jul 15, 2026
@jonasbardino jonasbardino added the enhancement New feature or request label Jul 15, 2026
@jonasbardino jonasbardino added the bug Something isn't working label Jul 16, 2026
@jonasbardino jonasbardino changed the title WiP: migrate jsonrpclib to maintained fork and sync interfaces to current API Migrate jsonrpclib to maintained fork and sync interfaces to current API Jul 16, 2026
@jonasbardino
jonasbardino marked this pull request as ready for review July 16, 2026 10:05
@jonasbardino jonasbardino added the battle-tested Code was tested to be fully functional in line with project code guidelines. label Jul 16, 2026
Comment thread mig/user/jsonrpcsslclient.py Outdated
key_pw = self.conf.get('password', None)
cacert = None
if conf['cacertfile'] and conf['cacertfile'] != 'AUTO':
if self.conf['cacertfile'] and self.conf['cacertfile'] != 'AUTO':

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if 'cacertfile' in self.conf and self.conf['cacertfile'] != 'AUTO': ?

print("cat as text file")
(inlist, retval) = server.cat({"path": path_list, "flags": "v"})
print('cat status: %s' % retval)
if returnval != 0:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing (returnval, returnmsg) = retval ?

if 'file_output' == entry['object_type']:
print(''.join([i for i in entry['lines']]))
print('cat status: %s' % retval)
if returnval != 0:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing (returnval, returnmsg) = retval ?

jsonrpc.SafeTransport.__init__(self)
self.conf.update(conf)
jsonrpc.SafeTransport.__init__(self, config=config, context=context)
if conf:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current setup every instance shares one conf dict, so a second transport inherits (and overwrites) the first.

To ensure a unique conf for each instance set conf = None at class level and init self.conf using:
self.conf = dict(conf or {})

host = None
ssl_ctx = None
_connection = None
conf = {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conf = None

(see suggestion below)

@Martin-Rehr Martin-Rehr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved when comments are addressed

jonasbardino added a commit to ucphhpc/docker-migrid that referenced this pull request Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

battle-tested Code was tested to be fully functional in line with project code guidelines. bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make jsonrpc example functional again with a modern fork of jsonrpclib

2 participants