[lxc-devel] [PATCH] lxc-ls: Force running against containers without python

Stéphane Graber stgraber at ubuntu.com
Mon May 5 16:38:33 UTC 2014


On Mon, May 05, 2014 at 04:33:54PM +0000, Serge Hallyn wrote:
> Quoting Stéphane Graber (stgraber at ubuntu.com):
> > 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 at ubuntu.com>
> > ---
> >  src/lxc/lxc-ls.in | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/src/lxc/lxc-ls.in b/src/lxc/lxc-ls.in
> 
> No idea what this is :)  My only question would be, does this mean we need
> any new dependencies?  If so, then 'assert' may be a bit strong for existing
> users, since they may have python in all their nested containers...

Nope, no new deps. The assert is just to prevent pyflakes3 from
reporting the extra import as being useless.

> 
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> 
> > index d1faaa2..a8f3256 100755
> > --- a/src/lxc/lxc-ls.in
> > +++ b/src/lxc/lxc-ls.in
> > @@ -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@"
> > -- 
> > 1.9.1
> > 
> > _______________________________________________
> > lxc-devel mailing list
> > lxc-devel at lists.linuxcontainers.org
> > http://lists.linuxcontainers.org/listinfo/lxc-devel
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140505/56f274bb/attachment.sig>


More information about the lxc-devel mailing list