Python LXC api needs to be much better at error reporting
Bug #1542438 reported by
Christopher Townsend
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Won't Fix
|
Wishlist
|
Unassigned |
Bug Description
I use the Python API extensively on the lp:libertine project. However, when there is an error somewhere in the LXC layer, the only thing that is returned is False which is not very useful when trying to figure out what has gone wrong.
For example, I try to use the Container.create() method and it is failing However, when I try using the lxc-create CLI tool using the same exact parameters, it works. Since the Python API does not have an error output, I'm having a very difficult time figuring out why the Python create is failing.
Changed in lxc (Ubuntu): | |
status: | New → Won't Fix |
To post a comment you must log in.
Hi,
the intent is that you can set the logfile and loglevel and find
out more about how it failed for those. While there is talk about
work to improve on the startup failure debugging, it is still
based on the logfile output.
As an example:
^C2 ✗ serge@sl ~ $ python3 ("x1") item("lxc. loglevel" , "1") item("lxc. logfile" , "/tmp/outout")
Python 3.4.3+ (default, Oct 14 2015, 16:03:50)
[GCC 5.2.1 20151010] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxc
>>> c=lxc.Container
>>> c.set_config_
True
>>> c.set_config_
True
>>> c.start()
False
but now /tmp/outout has the debug information.
It sounds like we could stand to have this better explained
somewhere, but I'm not sure where.