Bug 1119412 - ovirt-shell cannot run in cron (/dev/tty missing)
Summary: ovirt-shell cannot run in cron (/dev/tty missing)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-cli
Version: 3.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.5.0
Assignee: Juan Hernández
QA Contact: Jiri Belka
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-14 17:32 UTC by Markus Stockhausen
Modified: 2016-02-10 19:33 UTC (History)
4 users (show)

Fixed In Version: ovirt-engine-cli-3.5.0.2-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-17 12:39:54 UTC
oVirt Team: Infra


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 30238 master MERGED cli: Don't fail when there is no tty Never
oVirt gerrit 30250 cli_3.5 MERGED cli: Don't fail when there is no tty Never

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.


Note You need to log in before you can comment on or make changes to this bug.