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

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) ===

From 5ddee073376f048c9c8714e4fe770ff17668358f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Wed, 24 Feb 2016 18:42:30 -0500
Subject: [PATCH 1/2] Remove trailing newline
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/main.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/main.go b/lxd/main.go
index 5446033..1c04543 100644
--- a/lxd/main.go
+++ b/lxd/main.go
@@ -369,7 +369,7 @@ func daemon() error {
                signal.Notify(ch, syscall.SIGTERM)
                sig := <-ch
 
-               shared.Log.Info(fmt.Sprintf("Received '%s signal', exiting.\n", 
sig))
+               shared.Log.Info(fmt.Sprintf("Received '%s signal', exiting.", 
sig))
                ret = d.Stop()
                wg.Done()
        }()

From a9c162d5a90a9d9381b11d0dd86c9b10b0e13937 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Thu, 25 Feb 2016 16:45:17 -0500
Subject: [PATCH 2/2] exec: Also do non-interactive when stdout is !tty
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxc/exec.go |  6 ++++--
 po/lxd.pot  | 18 ++++++++++--------
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/lxc/exec.go b/lxc/exec.go
index a5c3033..d218fd5 100644
--- a/lxc/exec.go
+++ b/lxc/exec.go
@@ -45,7 +45,9 @@ func (c *execCmd) usage() string {
        return i18n.G(
                `Execute the specified command in a container.
 
-lxc exec [remote:]container [--mode=auto|interactive|non-interactive] [--env 
EDITOR=/usr/bin/vim]... <command>`)
+lxc exec [remote:]container [--mode=auto|interactive|non-interactive] [--env 
EDITOR=/usr/bin/vim]... <command>
+
+Mode defaults to non-interactive, interactive mode is selected if both stdin 
AND stdout are terminals (stderr is ignored).`)
 }
 
 func (c *execCmd) flags() {
@@ -118,7 +120,7 @@ func (c *execCmd) run(config *lxd.Config, args []string) 
error {
        } else if c.modeFlag == "non-interactive" {
                interactive = false
        } else {
-               interactive = termios.IsTerminal(cfd)
+               interactive = termios.IsTerminal(cfd) && 
termios.IsTerminal(int(syscall.Stdout))
        }
 
        var oldttystate *termios.State
diff --git a/po/lxd.pot b/po/lxd.pot
index d056a57..52fbebf 100644
--- a/po/lxd.pot
+++ b/po/lxd.pot
@@ -7,7 +7,7 @@
 msgid   ""
 msgstr  "Project-Id-Version: lxd\n"
         "Report-Msgid-Bugs-To: lxc-devel@lists.linuxcontainers.org\n"
-        "POT-Creation-Date: 2016-02-23 19:02-0500\n"
+        "POT-Creation-Date: 2016-02-25 16:37-0500\n"
         "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
         "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
         "Language-Team: LANGUAGE <l...@li.org>\n"
@@ -103,7 +103,7 @@ msgstr  ""
 msgid   "Aliases:"
 msgstr  ""
 
-#: lxc/exec.go:52
+#: lxc/exec.go:54
 msgid   "An environment variable of the form HOME=/home/foo"
 msgstr  ""
 
@@ -256,7 +256,7 @@ msgstr  ""
 msgid   "Device %s removed from %s"
 msgstr  ""
 
-#: lxc/list.go:410
+#: lxc/list.go:418
 msgid   "EPHEMERAL"
 msgstr  ""
 
@@ -287,7 +287,9 @@ msgstr  ""
 #: lxc/exec.go:45
 msgid   "Execute the specified command in a container.\n"
         "\n"
-        "lxc exec [remote:]container [--mode=auto|interactive|non-interactive] 
[--env EDITOR=/usr/bin/vim]... <command>"
+        "lxc exec [remote:]container [--mode=auto|interactive|non-interactive] 
[--env EDITOR=/usr/bin/vim]... <command>\n"
+        "\n"
+        "Mode defaults to non-interactive, interactive mode is selected if 
both stdin AND stdout are terminals (stderr is ignored)."
 msgstr  ""
 
 #: lxc/image.go:307
@@ -682,11 +684,11 @@ msgstr  ""
 msgid   "Output is in %s"
 msgstr  ""
 
-#: lxc/exec.go:53
+#: lxc/exec.go:55
 msgid   "Override the terminal mode (auto, interactive or non-interactive)"
 msgstr  ""
 
-#: lxc/list.go:412
+#: lxc/list.go:420
 msgid   "PERSISTENT"
 msgstr  ""
 
@@ -1022,7 +1024,7 @@ msgstr  ""
 msgid   "no"
 msgstr  ""
 
-#: lxc/copy.go:100
+#: lxc/copy.go:101
 msgid   "not all the profiles from the source exist on the target"
 msgstr  ""
 
@@ -1063,7 +1065,7 @@ msgstr  ""
 msgid   "taken at %s"
 msgstr  ""
 
-#: lxc/exec.go:157
+#: lxc/exec.go:159
 msgid   "unreachable return reached"
 msgstr  ""
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to