]> 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:39:09 +0000 (11:39 -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 d1faaa2164a7528789bf3d51c346449f5976df7b..a8f3256a05d6ce494ac0e61f96a5c6d488c8fdaf 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@"