]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-ls: Force running against containers without python
authorStéphane Graber <stgraber@ubuntu.com>
Mon, 5 May 2014 15:51:19 +0000 (10:51 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 5 May 2014 16:41:26 +0000 (11:41 -0500)
When using --nesting, we exec ourselves in the container context, if we
somehow need to dynamically-load modules from there, things break. So
make sure we pre-load everything we may need.

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

index fa387b3cf3056e7fab5b0b696577e1be377036a3..fe225284735449f76faa5db7d981296f6adf4714 100755 (executable)
@@ -38,6 +38,10 @@ import sys
 _ = gettext.gettext
 gettext.textdomain("lxc-ls")
 
+# Required for containers without python
+import encodings.ascii
+assert encodings.ascii
+
 # Constants
 LXCPATH = "@LXCPATH@"
 RUNTIME_PATH = "@RUNTIME_PATH@"