Bug 895559 - PRD34 - [RFE] [RHEVM-CLI] Add CLI invocation capabilities
Summary: PRD34 - [RFE] [RHEVM-CLI] Add CLI invocation capabilities
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-cli
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 3.4.0
Assignee: Juan Hernández
QA Contact: Barak Dagan
URL:
Whiteboard: infra
Depends On: 823515
Blocks: 854519
TreeView+ depends on / blocked
 
Reported: 2013-01-15 14:23 UTC by Barak Dagan
Modified: 2018-12-06 14:54 UTC (History)
12 users (show)

Fixed In Version: ovirt-3.4.0-alpha1
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-27 10:56:09 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 20618 0 None None None Never

Comment 1 Michael Pasternak 2013-01-15 14:43:52 UTC
did you defined TERM as /dev/tty on your local machine?

Comment 2 Barak Dagan 2013-01-15 15:16:29 UTC
[bdagan@bdagan ~]$ export TERM=/dev/tty
[bdagan@bdagan ~]$ echo $TERM
/dev/tty
[bdagan@bdagan ~]$ ssh fire-vdc1.qa.lab.tlv.redhat.com -lroot "rhevm-shell -c"
Traceback (most recent call last):
  File "/usr/bin/rhevm-shell", line 9, in <module>
    load_entry_point('rhevm-shell==3.1.1.2-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 69, 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'

Comment 3 Barak 2013-01-27 10:46:35 UTC
Did you try ssh ... -t  ... ?

Comment 4 Michael Pasternak 2013-01-27 10:55:19 UTC
(In reply to comment #0)
> Expected results:
> 
> get the results of the requested command, like: 
> ssh root@myhost "psql -U xxx -d engine -c '\d'"
> 
>  public | vm_pool_map_view                              | view     | engine
>  public | vm_pools                                      | table    | engine
>  public | vm_pools_full_view                            | view     | engine
>  public | vm_pools_view                                 | view     | engine
>  public | vm_static                                     | table    | engine
>  public | vm_statistics                                 | table    | engine
>  public | vm_templates_storage_domain                   | view     | engine
>  public | vm_templates_view                             | view     | engine
>  public | vm_templates_with_plug_info                   | view     | engine
>  public | vms                                           | view     | engine
>  public | vms_for_disk_view                             | view     | engine
>  public | vms_with_plug_info                            | view     | engine
>  public | vms_with_tags                                 | view     | engine
> (162 rows)
> 
> 
> 
> Additional info:

even if you'll work out your env. issues and will invoke shell remotely, script
output won't be redirected to the linux console i/o stream as rhevm-shell doesn't have cli invocation capabilities.

Comment 5 Michael Pasternak 2013-01-27 10:56:09 UTC

*** This bug has been marked as a duplicate of bug 823515 ***

Comment 11 Michael Pasternak 2013-10-28 15:28:36 UTC
implemented by -E/--execute-command option, e.g:

[mpastern@laptop ~]$ ovirt-shell --execute-command "list vms;list clusters"

[oVirt shell (connected)]# list vms

id         : 77fd5b88-bcd6-4296-bf20-f3d857f7f0d2
name       : test

[oVirt shell (connected)]# list clusters

id         : 99408929-82cf-4dc7-a532-9d998063fa95
name       : Default
description: The default server cluster

[mpastern@laptop ~]$
[mpastern@laptop ~]$
[mpastern@laptop ~]$

Comment 12 Robert McSwain 2013-11-06 14:21:16 UTC
I see that this feature has a target release of 3.4, however considering this is available in the upstream is there any possibility of getting this into a future point release of RHEL 3.3?

Comment 13 Michael Pasternak 2013-11-06 14:29:06 UTC
(In reply to Robert McSwain from comment #12)
> I see that this feature has a target release of 3.4, however considering
> this is available in the upstream is there any possibility of getting this
> into a future point release of RHEL 3.3?

RHEVM 3.3 already after feature freeze, currently we working on stabilizing the version

Comment 15 Barak Dagan 2014-02-18 15:56:51 UTC
Verified on :

# rpm -q ovirt-engine
ovirt-engine-3.4.0-0.7.beta2.el6.noarch

# rpm -qa | grep ovirt-engine | egrep 'sdk|cli'
ovirt-engine-cli-3.4.0.3-1.el6.noarch
ovirt-engine-sdk-python-3.4.0.3-1.el6.noarch

# ovirt-shell -c -l "https://ip.add.re.s/api" -u admin@internal -I -E "list vms;list clusters"
Password: 
[oVirt shell (connected)]# list vms

id         : f12db6fb-c407-473b-b64a-14bda64dd31f
name       : vm222

id         : 5416dbc7-236c-4e22-8db7-a31df74b1eae
name       : vm-test-1                                

[oVirt shell (connected)]# list clusters
id         : a1cfda61-1b88-4c49-a5b0-71daf49b9379                     
name       : c33

id         : 09f91db8-7f5b-4e78-9eba-8df524e01354           
name       : cluster1

id         : b5c1c607-6f3a-4638-ac84-4b0fd3a03b46         
name       : cluster-nfs-1

id         : 82de1af7-1855-42de-a0a9-975b62956bc7                     
name       : clutestes

id         : 00000001-0001-0001-0001-000000000001
name       : Default
description: The default server cluster

Comment 16 Itamar Heim 2014-06-12 14:09:16 UTC
Closing as part of 3.4.0


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