Bug 1119412

Summary: ovirt-shell cannot run in cron (/dev/tty missing)
Product: [Retired] oVirt Reporter: Markus Stockhausen <mst>
Component: ovirt-engine-cliAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Belka <jbelka>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.4CC: gklein, iheim, rbalakri, yeylon
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: ovirt-engine-cli-3.5.0.2-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-17 12:39:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Markus Stockhausen 2014-07-14 17:32:32 UTC
Description of problem:

ovirt-shell cannot run in crontab


Version-Release number of selected component (if applicable):

OVirt 3.4.2


How reproducible:

100%


Steps to Reproduce:

1. create script with ovirt-shell e.g. 
/usr/bin/ovirt-shell -c -E "list vms --show-all" > /dumps/vms.dump

2. implement script into crontab

Actual results:

dump:

Traceback (most recent call last):
  File "/usr/bin/ovirt-shell", line 9, in <module>
    load_entry_point('ovirt-shell==3.4.0.5', 'console_scripts', 'ovirt-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/infrastructure/context.py", line 47, in __init__
    super(OvirtCliExecutionContext, self).__init__(args=args, option_parser=option_parser)
  File "/usr/lib/python2.6/site-packages/cli/context.py", line 73, 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'
Traceback (most recent call last):
  File "/usr/bin/ovirt-shell", line 9, in <module>
    load_entry_point('ovirt-shell==3.4.0.5', 'console_scripts', 'ovirt-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/infrastructure/context.py", line 47, in __init__
    super(OvirtCliExecutionContext, self).__init__(args=args, option_parser=option_parser)
  File "/usr/lib/python2.6/site-packages/cli/context.py", line 73, 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'


Expected results:

ovirt-shell should run as expected

Comment 1 Jiri Belka 2014-07-29 11:08:54 UTC
ok, ovirt-engine-cli-3.5.0.2-1.el6.noarch (tested via cron and at)

Comment 2 Sandro Bonazzola 2014-10-17 12:39:54 UTC
oVirt 3.5 has been released and should include the fix for this issue.