The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/go-lxc/pull/103

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Seth Moore <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
From 405efdef0877a799e6c682f1bf67a1af5485d167 Mon Sep 17 00:00:00 2001
From: Seth Moore <[email protected]>
Date: Mon, 18 Apr 2016 22:01:19 -0400
Subject: [PATCH] Do not suppress stderr if Execute command exits nonzero
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Seth Moore <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
---
 container.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/container.go b/container.go
index cc3b680..93f6203 100644
--- a/container.go
+++ b/container.go
@@ -527,6 +527,11 @@ 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 {
+               // Do not suppress stderr if the exit code != 0. Return with 
err.
+               if len(output) > 1 {
+                       return output, ErrExecuteFailed
+               }
+
                return nil, ErrExecuteFailed
        }
 
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to