[lxc-users] Python (pylxd) execute isn't working

Matt Green mephi at mephi.co.uk
Sat Nov 5 00:46:32 UTC 2016


I'm trying to push commands to containers and it just isn't working.

I've tried running it in the python command line to see if I can figure out
what's going on:

>>> from pylxd import client
>>> lxdClient = client.Client()
>>> inContainerName = "snmp2"
>>> container = lxdClient.containers.get(inContainerName)
>>> containerExec = ['mkdir /go']
>>> container.execute(containerExec)
(u'', u'')

The corresponding lxc command line works:
lxc exec snmp2 -- mkdir /go

In my /var/log/lxd/lxd.log file I have:
t=2016-11-05T00:29:56+0000 lvl=info msg="Executing command"
environment="[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]"
args="[/usr/bin/lxd forkexec snmp2 /var/lib/lxd/containers
/var/log/lxd/snmp2/lxc.conf -- env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -- cmd
mkdir /go]"
t=2016-11-05T00:29:56+0000 lvl=info msg="Executed command"
environment="[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]"
args="[/usr/bin/lxd forkexec snmp2 /var/lib/lxd/containers
/var/log/lxd/snmp2/lxc.conf -- env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -- cmd
mkdir /go]" exit_status=255

It's on an Ubuntu 16.04LTS server running pylxd (2.1.2)

Any ideas what's wrong or how to debug further?

Cheers,

Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20161105/f6aa752d/attachment.html>


More information about the lxc-users mailing list