Commits

Christophe Chauvet committed 5ef7e1e

release must be execute in quiet

  • Participants
  • Parent commits f0663c5

Comments (0)

Files changed (1)

File fabric/contrib/debian/__init__.py

 # -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Fabric-Debian
+#    Copyright (C) 2011 Christophe CHAUVET <christophe.chauvet@gmail.com>
+#
+#    This file is a part of Fabric-Debian
+#
+#    Fabric-Debian is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    Fabric-Debian is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
 """
 Declare as namespace
 """
 
 __import__('pkg_resources').declare_namespace(__name__)
 
-from fabric.api import env, sudo, run
+from fabric.api import env, sudo, run, hide
+
+env.use_sudo = False
+
 
 def release():
     """
     Return the version of the distribution
     Use lsb_release
     """
-    res = run('lsb_release -idrc')
+    f_run = env.use_sudo and sudo or run
+    with hide('running', 'stdout', 'stderr'):
+        res = f_run('lsb_release -idrc')
     ret = {}
     for i in res.splitlines():
         (j, k) = i.split(':')
         ret[j.replace(' ', '_').lower()] = k.strip()
     return ret
 
-
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: