[lxc-users] lxc-attach from python
Rory Campbell-Lange
rory at campbell-lange.net
Sun Jul 12 23:46:24 UTC 2015
Hi Ranjib
Thanks for the pointer and sorry for my slow reply.
By the way the line is (for anyone else interested):
container.attach_wait(lxc.attach_run_command, ["ifconfig", "eth0"],
namespaces=(lxc.CLONE_NEWUSER + lxc.CLONE_NEWNET
+ lxc.CLONE_NEWUTS))
Regards
Rory
On 30/06/15, Ranjib Dey (dey.ranjib at gmail.com) wrote:
> https://github.com/lxc/lxc/blob/master/src/python-lxc/examples/api_test.py#L121
> hth
>
> On Tue, Jun 30, 2015 at 4:18 PM, Rory Campbell-Lange <
> rory at campbell-lange.net> wrote:
>
> > I've been playing with the lxc python api from the python3 command line.
> > I can't find a way to do something like this from python:
> >
> > lxc-attach -n debian-wheezy -- apt-get install rsync
> >
> > which works with the vanilla lxc-attach command.
> >
> > My thought is that my team could load debian packages from a yaml or
> > other structured file via the python api.
> >
> > Rory
More information about the lxc-users
mailing list