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
Maybe the problem is that the global return code is not printed .
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?
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?
(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?