pssh (parallel-ssh) problems on Debian 10 with Python 3.7

Python reminds me of PHP many years ago with totally incompatible versioning on one server. Do you need another version? The best way - new servers, because any update or installation can break all global environments. Half a year after “Sunsetting Python 2” but main distributions continue to push python2 during installation and it’s a big challenge not to replace the default version after some update or installing a new package.

What happened? For debugging purposes I decided to try pssh (now parallel-ssh WTF?) on Debian 10 with Python 3.7. And what do I see? Debian as always can’t collect all needed dependencies for deb packages… After installation - time to fix bug's:

BUG1
server:~$ parallel-ssh --version
Traceback (most recent call last):
  File "/usr/bin/parallel-ssh", line 26, in 
    from psshlib.cli import common_parser, common_defaults
  File "/usr/local/lib/python3.7/dist-packages/psshlib/cli.py", line 9, in 
    import version
ModuleNotFoundError: No module named 'version'


FIX1
server:~$ diff /usr/local/lib/python3.7/dist-packages/psshlib/cli.py /usr/local/lib/python3.7/dist-packages/psshlib/cli.py_orig
9c9
< from psshlib import version
---
> import version


BUG2
server:~$ parallel-ssh -i -h ~/.pssh_hosts_files -p 10 hostname
Traceback (most recent call last):
  File "/usr/bin/parallel-ssh", line 118, in 
    do_pssh(hosts, cmdline, opts)
  File "/usr/bin/parallel-ssh", line 71, in do_pssh
    manager = Manager(opts)
  File "/usr/local/lib/python3.7/dist-packages/psshlib/manager.py", line 42, in __init__
    self.iomap = IOMap()
  File "/usr/local/lib/python3.7/dist-packages/psshlib/manager.py", line 215, in __init__
    signal.set_wakeup_fd(wakeup_writefd)
ValueError: the fd 4 must be in non-blocking mode


FIX2
server:~$ diff /usr/local/lib/python3.7/dist-packages/psshlib/manager.py /usr/local/lib/python3.7/dist-packages/psshlib/manager.py_orig
9d8
< import fcntl
213d211
<         fcntl.fcntl(wakeup_writefd, fcntl.F_SETFL, os.O_NONBLOCK)

P.S.
You must be happy after the python upgrade! Shut up and smile!

Comments

Popular posts from this blog