[PKG-Openstack-devel] Bug#914481: [bank] python3-pylxd: Python3-pylxd is not Python3 compatible

Robert LeBlanc robot at leblancnet.us
Fri Nov 23 19:07:27 GMT 2018


Package: python3-pylxd
Version: 2.0.0~b1-2
Severity: important

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***

Trying to interact with LXD with a Python3 program, I thought I'd try
pylxd, but I don't think this package has been tested under Python3.

# export LXD_DIR=""
# python3
>>>> from pylxd import client
>>>> c = client.Client()
#### FAIL ####

# export LXD_DIR=/var/snap/lxd/common/lxd
# python3
>>>> from pylxd import client
>>>> c = client.Client()
#### FAIL ####

The following patches at lest let me do a few things, but I don't have
time to go through all the code.

--- client.py.orig      2018-11-23 11:41:31.959501342 -0700
+++ client.py   2018-11-23 11:47:29.315413276 -0700
@@ -111,11 +111,11 @@
         else:
             if 'LXD_DIR' in os.environ:
                 path = os.path.join(
-                    os.environ.get['LXD_DIR'], 'unix.socket')
+                    os.environ.get('LXD_DIR'), 'unix.socket')
             else:
                 path = '/var/lib/lxd/unix.socket'
             self.api = _APINode('http+unix://{}'.format(
-                urllib.quote(path, safe='')))
+                urllib.parse.quote(path, safe='')))
         self.api = self.api[version]

         self.containers = self.Containers(self)

--- container.py.orig   2018-11-23 11:49:13.620723578 -0700
+++ container.py        2018-11-23 11:49:20.761360981 -0700
@@ -70,7 +70,7 @@

     def __init__(self, **kwargs):
         super(Container, self).__init__()
-        for key, value in kwargs.iteritems():
+        for key, value in kwargs.items():
             setattr(self, key, value)

     def reload(self):


-- System Information:
Debian Release: 9.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.18.0-0.bpo.1-amd64 (SMP w/12 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python3-pylxd depends on:
ii  python3                      3.5.3-1
ii  python3-babel                2.3.4+dfsg.1-2
ii  python3-dateutil             2.5.3-2
ii  python3-openssl              16.2.0-1
ii  python3-pbr                  1.10.0-1
ii  python3-requests             2.12.4-1
ii  python3-requests-unixsocket  0.1.5-3
ii  python3-six                  1.10.0-3

python3-pylxd recommends no packages.

python3-pylxd suggests no packages.

-- no debconf information



More information about the Openstack-devel mailing list