Bug 836777 - ovirt-engine-iso-uploader: Wrong return value is printed when upload operation fails and using verbose mode .
ovirt-engine-iso-uploader: Wrong return value is printed when upload operatio...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-iso-uploader (Show other bugs)
3.1.0
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Keith Robertson
Pavel Stehlik
integration
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-01 05:03 EDT by Oded Ramraz
Modified: 2016-07-03 21:35 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-18 02:27:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Oded Ramraz 2012-07-01 05:03:21 EDT
Description of problem:

ovirt-engine-iso-uploader: Wrong return value when using verbose mode and trying to upload the same ISO twice , or when passing wrong path as an input ( see Additional Information )
wrong return code is printed:  0 instead of 3 
DEBUG: returncode(0)

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:


Return values:
    0: The program ran to completion with no errors.
    1: The program encountered a critical failure and stopped.
    2: The program did not discover any ISO domains.
    3: The program encountered a problem uploading to an ISO domain.
    4: The program encountered a problem un-mounting and removing the temporary directory.

[root@aqua-rhel base_iso]# rhevm-iso-uploader upload -v -i iso  WindowsXP-sp2-vlk.iso 
Please provide the REST API password for the admin@internal RHEV-M user (CTRL+D to abort): 
DEBUG: API Vendor(ovirt.org)    API Version(3.1.0)
DEBUG: id=fb1c28e4-2c8b-4bb5-882a-0372d98c7733 address=multipass.eng.lab.tlv.redhat.com path=/export/images/qa/aqua_rest/iso
DEBUG: local NFS mount point is /tmp/tmpz3tvnV
DEBUG: NFS mount command (/bin/mount -t nfs -o rw,sync,soft multipass.eng.lab.tlv.redhat.com:/export/images/qa/aqua_rest/iso /tmp/tmpz3tvnV)
DEBUG: /bin/mount -t nfs -o rw,sync,soft multipass.eng.lab.tlv.redhat.com:/export/images/qa/aqua_rest/iso /tmp/tmpz3tvnV
DEBUG: _cmds(['/bin/mount', '-t', 'nfs', '-o', 'rw,sync,soft', 'multipass.eng.lab.tlv.redhat.com:/export/images/qa/aqua_rest/iso', '/tmp/tmpz3tvnV'])
DEBUG: returncode(0)
DEBUG: STDOUT()
DEBUG: STDERR()
ERROR: WindowsXP-sp2-vlk.iso exists on multipass.eng.lab.tlv.redhat.com.  Either remove it or supply the --force option to overwrite it.
DEBUG: /bin/umount -t nfs -f  /tmp/tmpz3tvnV
DEBUG: /bin/umount -t nfs -f  /tmp/tmpz3tvnV
DEBUG: _cmds(['/bin/umount', '-t', 'nfs', '-f', '/tmp/tmpz3tvnV'])
DEBUG: returncode(0)
DEBUG: STDOUT()
DEBUG: STDERR()


[root@aqua-rhel base_iso]# echo $?
3


[root@aqua-rhel base_iso]# rhevm-iso-uploader upload -v -i iso  WindowsXP-sp2-vlk.is2o 
Please provide the REST API password for the admin@internal RHEV-M user (CTRL+D to abort): 
DEBUG: API Vendor(ovirt.org)    API Version(3.1.0)
DEBUG: id=fb1c28e4-2c8b-4bb5-882a-0372d98c7733 address=multipass.eng.lab.tlv.redhat.com path=/export/images/qa/aqua_rest/iso
DEBUG: local NFS mount point is /tmp/tmpwcYCM8
DEBUG: NFS mount command (/bin/mount -t nfs -o rw,sync,soft multipass.eng.lab.tlv.redhat.com:/export/images/qa/aqua_rest/iso /tmp/tmpwcYCM8)
DEBUG: /bin/mount -t nfs -o rw,sync,soft multipass.eng.lab.tlv.redhat.com:/export/images/qa/aqua_rest/iso /tmp/tmpwcYCM8
DEBUG: _cmds(['/bin/mount', '-t', 'nfs', '-o', 'rw,sync,soft', 'multipass.eng.lab.tlv.redhat.com:/export/images/qa/aqua_rest/iso', '/tmp/tmpwcYCM8'])
DEBUG: returncode(0)
DEBUG: STDOUT()
DEBUG: STDERR()
ERROR: Unable to copy WindowsXP-sp2-vlk.is2o to ISO storage domain on iso.
ERROR: Error message is "[Errno 2] No such file or directory: 'WindowsXP-sp2-vlk.is2o'"
DEBUG: /bin/umount -t nfs -f  /tmp/tmpwcYCM8
DEBUG: /bin/umount -t nfs -f  /tmp/tmpwcYCM8
DEBUG: _cmds(['/bin/umount', '-t', 'nfs', '-f', '/tmp/tmpwcYCM8'])
DEBUG: returncode(0)
DEBUG: STDOUT()
DEBUG: STDERR()

[root@aqua-rhel base_iso]# echo $?
3
Comment 1 Oded Ramraz 2012-07-01 05:06:44 EDT
Maybe the problem is that the global return code is not printed .
Comment 2 Keith Robertson 2012-07-17 09:44:12 EDT
I'm not sure what you want me to fix here.  If you want me to fix the fact that a debug statement says "returncode(0)", then I'll say "no" for two reasons:

Reason 1: This is a debug statement intended for the eyes of someone familiar with the code.
Reason 2: The debug message "DEBUG: returncode(0)" is != to  the program's actual return code.  It is the returncode from forked process and I may need to see it; hence, I print it.

So what is the problem here?
Comment 3 Oded Ramraz 2012-07-17 15:22:25 EDT
Sorry for not being familiar with your code but I still find those prints as misleading . I'm running negative test case and still seeing only returncode(0) in the debug prints while the actual return code is 3 .

The following sentence in the command line helps to confuse me as well: 
Return values:
    0: The program ran to completion with no errors.


(In reply to comment #2)
> I'm not sure what you want me to fix here.  If you want me to fix the fact
> that a debug statement says "returncode(0)", then I'll say "no" for two
> reasons:
> 
> Reason 1: This is a debug statement intended for the eyes of someone
> familiar with the code.
> Reason 2: The debug message "DEBUG: returncode(0)" is != to  the program's
> actual return code.  It is the returncode from forked process and I may need
> to see it; hence, I print it.
> 
> So what is the problem here?
Comment 4 Keith Robertson 2012-07-17 15:43:43 EDT
(In reply to comment #3)
> Sorry for not being familiar with your code but I still find those prints as
> misleading . I'm running negative test case and still seeing only
> returncode(0) in the debug prints while the actual return code is 3 .
> 
So the debug line of "returncode(0)" is valid in the context of verbose output which you told the program to do with the "-v" option.  It is valid because it is telling you that the forked command [1] completed with a returncode of 0.

Do we really need to fix a debug statement that is valid, IMHO, in the context of debugging?   

[1]  /bin/mount -t nfs -o rw,sync,soft multipass.eng.lab.tlv.redhat.com:/export/images/qa/aqua_rest/iso /tmp/tmpwcYCM8





> The following sentence in the command line helps to confuse me as well: 
> Return values:
>     0: The program ran to completion with no errors.
> 
> 
> (In reply to comment #2)
> > I'm not sure what you want me to fix here.  If you want me to fix the fact
> > that a debug statement says "returncode(0)", then I'll say "no" for two
> > reasons:
> > 
> > Reason 1: This is a debug statement intended for the eyes of someone
> > familiar with the code.
> > Reason 2: The debug message "DEBUG: returncode(0)" is != to  the program's
> > actual return code.  It is the returncode from forked process and I may need
> > to see it; hence, I print it.
> > 
> > So what is the problem here?

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