Bug 971277 - Rhevm-shell fails on "exit" command when "disconnect" command is used just before it in batch mode
Rhevm-shell fails on "exit" command when "disconnect" command is used just be...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-cli (Show other bugs)
3.3.0
All Linux
unspecified Severity low
: ---
: 3.3.0
Assigned To: Juan Hernández
Ilia Meerovich
infra
:
: 997891 (view as bug list)
Depends On:
Blocks: 971285 997891 1019461
  Show dependency treegraph
 
Reported: 2013-06-06 03:41 EDT by Roman Hodain
Modified: 2016-02-10 14:10 EST (History)
10 users (show)

See Also:
Fixed In Version: is6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 971285 (view as bug list)
Environment:
Last Closed: 2013-06-06 10:17:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 15475 None None None Never

  None (edit)
Description Roman Hodain 2013-06-06 03:41:15 EDT
Description of problem:
If the rhevm-shell is  used in the "batch" mode (--file) and the script contains sequence of the following two commands:
   disconnect
   exit

Then the shell is not exited with the following error message:
   error: command "exit
   " not valid or not available while not connected.

The same sequence of commands works if the shell is used in the interactive mode.

Version-Release number of selected component (if applicable):
rhevm-cli-3.1.1.2-1.el6ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create a script containing the following sequence of commands:
    connect -l <RHEVM_API_URL> -u admin@internal --password 'XXXXXX' --insecure
    disconnect
    exit

2. Run:
    rhevm-shell -f <SCRIPT_NAME>

Actual results:
   error: command "exit
   " not valid or not available while not connected.


Expected results:
   The shell is ended.

Additional info:
Comment 1 Michael Pasternak 2013-06-06 04:06:51 EDT
Roman,

i'm not sure we will be having any additional z-stream release for 3.1,
(3.2 will have fix for this) the workaround is pretty simple, remove 'disconnect' command from the script, 'exit' disconnects implicitly.
Comment 4 Ilia Meerovich 2013-07-03 05:04:37 EDT
It is not working as it should according bug opener.
WA is working.
Please provide info how it expected to work (do we keep WA as permanent solution)
------------------------------------------------------------
[root@ilia-rhevm ~]# rpm -q rhevm-cli
rhevm-cli-3.3.0.3-1.el6ev.noarch
[root@ilia-rhevm ~]# cat foo
connect -l https://ilia-rhevm.qa.lab.tlv.redhat.com:443/api/ -u admin@internal --password 'xxxxxx' --insecure
disconnect
exit
[root@ilia-rhevm ~]# rhevm-shell -f foo 

error: missing configuration variable: url.


[RHEVM shell (disconnected)]# connect -l https://ilia-rhevm.qa.lab.tlv.redhat.com:443/api/ -u admin@internal --password 'xxxxxx' --insecure


 ==========================================
 >>> connected to RHEVM manager 3.3.0.0 <<<
 ==========================================

[RHEVM shell (connected)]# disconnect


  =======================================
  >>> disconnected from RHEVM manager <<<
  =======================================
 
[RHEVM shell (disconnected)]# exit


error: command "exit
" not valid or not available while not connected.

[RHEVM shell (disconnected)]# 
--------------------------------------------------------
[root@ilia-rhevm ~]# cat foo
connect -l https://ilia-rhevm.qa.lab.tlv.redhat.com:443/api/ -u admin@internal --password '123456' --insecure
exit
[root@ilia-rhevm ~]# rhevm-shell -f foo 

error: missing configuration variable: url.


[RHEVM shell (disconnected)]# connect -l https://ilia-rhevm.qa.lab.tlv.redhat.com:443/api/ -u admin@internal --password '123456' --insecure


 ==========================================
 >>> connected to RHEVM manager 3.3.0.0 <<<
 ==========================================

[RHEVM shell (connected)]# exit

[root@ilia-rhevm ~]#
Comment 5 Michael Pasternak 2013-07-03 05:10:19 EDT
what version you're checking at? this is fixed in the 3.3.0.4-1
Comment 6 Ilia Meerovich 2013-07-03 05:16:54 EDT
build: is4
[root@ilia-rhevm ~]# rpm -q rhevm-cli
rhevm-cli-3.3.0.3-1.el6ev.noarch
Comment 7 Ilia Meerovich 2013-07-15 00:55:19 EDT
same cli version in is5 (and the same behaviour):
http://bob.eng.lab.tlv.redhat.com/builds/is5/rhevm-cli-3.3.0.3-1.el6ev.noarch.rpm

changing status To Assigned until fix will be provided
Comment 8 Ilia Meerovich 2013-07-18 08:51:17 EDT
Build IS6.

[imeerovi@imeerovi ART]$ rhevm-shell -f /tmp/foo
URL: 
Username: 

error: missing configuration variable: url.


[RHEVM shell (disconnected)]# connect -l https://vm-161-147.scl.lab.tlv.redhat.com:443/api/ -u admin@internal --password '123456' --insecure


 ==========================================
 >>> connected to RHEVM manager 3.3.0.0 <<<
 ==========================================

[RHEVM shell (connected)]# disconnect


  =======================================
  >>> disconnected from RHEVM manager <<<
  =======================================
 
[RHEVM shell (disconnected)]# exit

[imeerovi@imeerovi ART]$ cat /tmp/foo
connect -l https://vm-161-147.scl.lab.tlv.redhat.com:443/api/ -u admin@internal --password '123456' --insecure
disconnect
exit
[imeerovi@imeerovi ART]$
Comment 9 Barak 2013-08-19 09:21:20 EDT
*** Bug 997891 has been marked as a duplicate of this bug. ***
Comment 23 Itamar Heim 2014-01-21 17:22:08 EST
Closing - RHEV 3.3 Released
Comment 24 Itamar Heim 2014-01-21 17:27:16 EST
Closing - RHEV 3.3 Released

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