You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create container, create file with json content eg. '{ }'
try to get the file
from pylxd import Client
client = Client()
test = client.containers.get('test')
print(test.files.get('/test.json'))
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pylxd/client.py", line 88, in _assert_response
if data['type'] != 'sync':
KeyError: 'type'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test.py", line 4, in <module>
print(nginx.files.get('/etc/helthcheck'))
File "/usr/lib/python3/dist-packages/pylxd/models/container.py", line 90, in get
params={'path': filepath})
File "/usr/lib/python3/dist-packages/pylxd/client.py", line 106, in get
self._assert_response(response, stream=kwargs.get('stream', False))
File "/usr/lib/python3/dist-packages/pylxd/client.py", line 92, in _assert_response
raise exceptions.LXDAPIException(response)
pylxd.exceptions.LXDAPIException: <exception str() failed>
The text was updated successfully, but these errors were encountered:
Okay, having had a look at the code, it's because the .files.get(...) implementation re-uses the API .get(...) method which checks if it's JSON and then assumes it must be protocol message and makes assumptions about what must be in the JSON. Hence the failure. I'll try to get this fixed soon.
How to reproduce:
The text was updated successfully, but these errors were encountered: