aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2013-10-03 17:57:42 +0100
committerBryn M. Reeves <bmr@redhat.com>2013-10-03 17:57:42 +0100
commitdcc0b35431bc3fc134bca77903227ecb74672cb5 (patch)
tree279b37741a7ecbf615db545b665c642d0bb77ea2
parentd79cec6ac30a8ffb5c6d2ac0afa47811e192c1de (diff)
downloadsos-dcc0b35431bc3fc134bca77903227ecb74672cb5.tar.gz
No TTY should not imply batch mode
Commit 6ea48cbb introduced an isatty() check on stdin and automatically sets batch mode if we're not attached to a TTY. Although the logic of this seems simple enough the combination of this and commit 4b46e04 breaks valid uses that have worked since sos-1.x, e.g.: Traceback (most recent call last): File "/usr/sbin/sosreport", line 23, in <module> main(sys.argv[1:]) File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1171, in main sos.execute() File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1133, in execute self._setup_logging() File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 630, in _setup_logging self.opts.batch = True File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 324, in batch self._check_options_initialized() File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 229, in _check_options_initialized + "from command line") ValueError: SoSOptions object already initialized from command line Given the actual semantics of --batch (do not prompt for or read user input from stdin) there is no need to enable it if stdin is a pipe or other non-TTY file descriptor. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/sosreport.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 908cbede..88c67301 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -625,10 +625,6 @@ class SoSReport(object):
pass
def _setup_logging(self):
-
- if not sys.stdin.isatty():
- self.opts.batch = True
-
# main soslog
self.soslog = logging.getLogger('sos')
self.soslog.setLevel(logging.DEBUG)