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
This commit is contained in:
parent
ca2e1d299f
commit
f40c9195a1
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user