[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] Discard stderr when calling system-image-cli. Avoids spurious error messages when system-image-cli is installed on a non-"Ubuntu-RTM" machine. (LP: #267935)



Alas, for a nice, fast, friendly, fabulous mail client.

Patch now attached.

On 13 August 2015 at 13:47, Julian Andres Klode <jak@debian.org> wrote:
> On Thu, Aug 13, 2015 at 01:00:54PM +0100, John Lenton wrote:
>> Signed-off-by: John R. Lenton <john.lenton@canonical.com>
>
> That did not work, your mail client re-formatted it. You
> might want to use git-send-email or send it as an attachment.
>
> --
> Julian Andres Klode  - Debian Developer, Ubuntu Member
>
> See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
>
> Be friendly, do not top-post, and follow RFC 1855 "Netiquette".
>     - If you don't I might ignore you.
From 7f2a84c6c460c687521e44a081250a49be01feba Mon Sep 17 00:00:00 2001
From: "John R. Lenton" <john.lenton@canonical.com>
Date: Thu, 13 Aug 2015 12:53:46 +0100
Subject: [PATCH] Discard stderr when calling system-image-cli. Avoids spurious
 error messages when system-image-cli is installed on a non-"Ubuntu-RTM"
 machine. (LP: #267935)

Signed-off-by: John R. Lenton <john.lenton@canonical.com>
---
 aptsources/distro.py | 7 ++++++-
 debian/changelog     | 9 +++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/aptsources/distro.py b/aptsources/distro.py
index ac1c55e..883420f 100644
--- a/aptsources/distro.py
+++ b/aptsources/distro.py
@@ -487,8 +487,13 @@ def _system_image_channel():
     from subprocess import Popen, PIPE
     import errno
     try:
+        from subprocess import DEVNULL
+    except ImportError:
+        # no DEVNULL in 2.7
+        DEVNULL = os.open(os.devnull, os.O_RDWR)
+    try:
         out = Popen(
-            ['system-image-cli', '-i'], stdout=PIPE,
+            ['system-image-cli', '-i'], stdout=PIPE, stderr=DEVNULL,
             universal_newlines=True).communicate()[0]
         for l in out.splitlines():
             if l.startswith('channel: '):
diff --git a/debian/changelog b/debian/changelog
index 34cab0a..0e3c07d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+python-apt (1.0.0~beta3.1+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Discard stderr when calling system-image-cli. Avoids spurious error
+    messages when system-image-cli is installed on a non-"Ubuntu-RTM"
+    machine. (LP: #1484470)
+
+ -- John R. Lenton (Chipaca) <john.lenton@canonical.com>  Thu, 13 Aug 2015 12:29:53 +0100
+
 python-apt (1.0.0~beta3.1) unstable; urgency=medium
 
   [ Michael Vogt ]
-- 
2.5.0


Reply to: