From f40c9195a1ee37cf5db84a52206f96c0ca8f31e2 Mon Sep 17 00:00:00 2001 From: Mike Panetta Date: Wed, 26 Feb 2014 16:44:38 -0500 Subject: [PATCH] Remove termios support (and associated issues) This is to fix issues related to devstack, marconi-server was crashing with no screen mode. Change-Id: Ida12606f44d1c5b2bd981834858302f03df8ed96 --- marconi/common/cli.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/marconi/common/cli.py b/marconi/common/cli.py index de79d0a53..845d40e6b 100644 --- a/marconi/common/cli.py +++ b/marconi/common/cli.py @@ -15,11 +15,8 @@ # limitations under the License. from __future__ import print_function -import atexit import functools -import os import sys -import termios from marconi.openstack.common.gettextutils import _ from marconi.openstack.common import log as logging @@ -40,26 +37,6 @@ def _fail(returncode, ex): sys.exit(returncode) -def _enable_echo(enable): - """Enables or disables terminal echo. - - :param enable: pass True to enable echo, False to disable - """ - if not os.isatty(sys.stdin.fileno()): - # if we are not running in an interactive shell we will get - # termios.error: (25, 'Inappropriate ioctl for device') - return - - fd = sys.stdin.fileno() - new_attr = termios.tcgetattr(fd) - if enable: - new_attr[3] |= termios.ECHO - else: - new_attr[3] &= ~termios.ECHO - - termios.tcsetattr(fd, termios.TCSANOW, new_attr) - - def runnable(func): """Entry point wrapper. @@ -69,9 +46,6 @@ def runnable(func): @functools.wraps(func) def _wrapper(): - atexit.register(_enable_echo, True) - _enable_echo(False) - try: logging.setup('marconi') func()