]> git.ipfire.org Git - thirdparty/lxc.git/commit
python3: Don't fail in list_containers on ValueError
authorStéphane Graber <stgraber@ubuntu.com>
Thu, 16 Jan 2014 18:37:32 +0000 (13:37 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 16 Jan 2014 20:44:45 +0000 (15:44 -0500)
commita539732721c45939ab79c01abd19298e4e5c74ca
treecb452809386c23eecfb1311453aa3ed45a3801b7
parent378a5729487794e4f127ac496e7111c51fe2d464
python3: Don't fail in list_containers on ValueError

ValueError typically means that the user doesn't have permissions to
access the directory. Raising an exception there isn't consistent with
other error behaviour of list_containers which simple returns an empty
tuple.

So simply catch the exception and ignore it. An error message is already
printed by LXC itself anyway.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/python-lxc/lxc/__init__.py