[lxc-devel] [go-lxc/v2] test debug

stgraber on Github lxc-bot at linuxcontainers.org
Sun Sep 17 22:05:04 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 355 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170917/3973ec0d/attachment.bin>
-------------- next part --------------
From 060e9531d320401c4afef4fb95480190d54402ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sun, 17 Sep 2017 15:04:19 -0700
Subject: [PATCH] test debug
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 .travis.yml  | 2 ++
 container.go | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 151a006..4f7db7d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,6 +24,8 @@ before_install:
  - cp /etc/lxc/default.conf ~/.config/lxc/default.conf
  - echo "lxc.idmap = u 0 100000 65536" | sudo tee -a ~/.config/lxc/default.conf
  - echo "lxc.idmap = g 0 100000 65536" | sudo tee -a ~/.config/lxc/default.conf
+ - lxc-create -t busybox -n abc
+ - lxc-start -n abc -F
 
 install:
   - go get gopkg.in/lxc/go-lxc.v2
diff --git a/container.go b/container.go
index 0be23ec..fd69a3f 100644
--- a/container.go
+++ b/container.go
@@ -478,7 +478,7 @@ func (c *Container) Execute(args ...string) ([]byte, error) {
 	// go-nuts thread: https://groups.google.com/forum/#!msg/golang-nuts/h9GbvfYv83w/5Ly_jvOr86wJ
 	output, err := exec.Command(cargs[0], cargs[1:]...).CombinedOutput()
 	if err != nil {
-		return nil, ErrExecuteFailed
+		return output, fmt.Errorf("stgraber: %v", err)
 	}
 
 	return output, nil


More information about the lxc-devel mailing list