Bug 971277

Summary: Rhevm-shell fails on "exit" command when "disconnect" command is used just before it in batch mode
Product: Red Hat Enterprise Virtualization Manager Reporter: Roman Hodain <rhodain>
Component: ovirt-engine-cliAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Ilia Meerovich <iliam>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, bazulay, iheim, iliam, jkt, juan.hernandez, oramraz, Rhev-m-bugs, rhodain, wdaniel
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: All   
OS: Linux   
Whiteboard: infra
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 14:17:37 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:
Bug Depends On:    
Bug Blocks: 971285, 997891, 1019461    

Description Roman Hodain 2013-06-06 07:41:15 UTC
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 08:06:51 UTC
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 09:04:37 UTC
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 09:10:19 UTC
what version you're checking at? this is fixed in the 3.3.0.4-1

Comment 6 Ilia Meerovich 2013-07-03 09:16:54 UTC
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 04:55:19 UTC
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 12:51:17 UTC
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 13:21:20 UTC
*** Bug 997891 has been marked as a duplicate of this bug. ***

Comment 23 Itamar Heim 2014-01-21 22:22:08 UTC
Closing - RHEV 3.3 Released

Comment 24 Itamar Heim 2014-01-21 22:27:16 UTC
Closing - RHEV 3.3 Released