lxd 2.14: 'Container' object has no attribute 'description' #232

Closed
powersj opened this Issue May 31, 2017 · 2 comments

Comments

Projects
None yet
1 participant

powersj commented May 31, 2017

Description

With the update to LXD 2.14 it seems a description field was added and pylxd is not handling it well.

Steps to Reproduce

Script to reproduce using pylxd 2.2.3 under Python3 with pre-requisite is a running container called 'x'

$ lxc launch ubuntu-daily:x x
$ python3
>>> import pylxd
>>> pylxd.__version__
'2.2.3'
>>> client = pylxd.Client()
>>> x = client.containers.get('x')
/home/powersj/.local/lib/python3.5/site-packages/pylxd/models/_model.py:112: UserWarning: Attempted to set unknown attribute "description" on instance of "Container"
  key, self.__class__.__name__
>>> x.sync()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/powersj/.local/lib/python3.5/site-packages/pylxd/models/_model.py", line 153, in sync
    setattr(self, key, val)
  File "/home/powersj/.local/lib/python3.5/site-packages/pylxd/models/_model.py", line 134, in __setattr__
    return super(Model, self).__setattr__(name, value)
AttributeError: 'Container' object has no attribute 'description'

Expected Behavior

No UserWarning or AttributeError

>>> import pylxd
>>> pylxd.__version__
'2.2.3'
>>> client=pylxd.Client()
>>> x = client.containers.get('x')
>>> x.sync()
>>> 

powersj commented May 31, 2017

This was fixed by #230, a new 2.2.4 release to pypi would be awesome to pick it up.

powersj commented Jul 10, 2017

2.2.4 on pypi, thank you @ajkavanagh

@powersj powersj closed this Jul 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment