Invoking rhevm-shell commands from non-interactive shell gives error as OSError: [Errno 6] No such device or address: '/dev/tty'

Solution Verified - Updated -

Issue

  • Invoking rhevm-shell commands from non-interactive shell gives error as OSError: [Errno 6] No such device or address: '/dev/tty'. When invoked from shell gives the proper results in the file.
# cat /tmp/rhevm-shell.output
Traceback (most recent call last):
  File "/usr/bin/rhevm-shell", line 9, in <module>
    load_entry_point('rhevm-shell==3.2.0.9-SNAPSHOT', 'console_scripts', 'rhevm-shell')()
  File "/usr/lib/python2.6/site-packages/ovirtcli/main.py", line 27, in main
    context = OvirtCliExecutionContext(sys.argv, parser)
  File "/usr/lib/python2.6/site-packages/ovirtcli/context.py", line 45, in __init__
    super(OvirtCliExecutionContext, self).__init__(args=args, option_parser=option_parser)
  File "/usr/lib/python2.6/site-packages/cli/context.py", line 71, in __init__
    self.terminal = create(self.Terminal)
  File "/usr/lib/python2.6/site-packages/cli/object.py", line 26, in create
    obj = cls(sys.stdin, sys.stdout, sys.stderr, **kwargs)
  File "/usr/lib/python2.6/site-packages/cli/platform/posix/terminal.py", line 36, in __init__
    self._tty = os.open('/dev/tty', os.O_RDWR)
OSError: [Errno 6] No such device or address: '/dev/tty'

Environment

  • Red Hat Enterprise Virtualization 3.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.