Description of problem: Some of condor scripts accept host name as argument, if bad host name is used they return 0 instead of some error number. Involved condor scripts: condor_reschedule condor_vacate condor_off condor_on condor_reconfig condor_restart Version-Release number of selected component (if applicable): condor-7.4.4-0.16 How reproducible: 100% Steps to Reproduce: 1. run 'condor_off -name nohost; echo $?' # condor_off -name nohost; echo $? condor_off: unknown host nohost 0 Actual results: script returns 0 Expected results: script should return 1 Additional info:
Upstream at https://condor-wiki.cs.wisc.edu/index.cgi/tktview?tn=1895
Fixed upstream for 7.5.6 commit 5654df23c99e9ac58e163eae9e4bb5644c2840a9 Author: Matthew Farrellee <matt@redhat> Date: Thu Feb 3 14:22:20 2011 -0500 Report errors via tool exit codes if everything doesn't work, #1895 diff --git a/src/condor_tools/tool.cpp b/src/condor_tools/tool.cpp
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: C: Some command-line tools would not consistently report errors via their return code. C: Scripting the tools can be more complicated than is necessary. F: A number of tools (mentioned in BZ) were updated to report errors when provided with a bad hostname. R: The tools are now easier to script as they report errors when provided a bad hostname.
Reproduced on: $CondorVersion: 7.4.5 Feb 4 2011 BuildID: RH-7.4.5-0.8.el5 PRE-RELEASE $ $CondorPlatform: X86_64-LINUX_RHEL5 $ # condor_off -name nohost; echo $? condor_off: unknown host nohost 0 # condor_reschedule -name nohost; echo $? condor_reschedule: unknown host nohost 0 # condor_vacate -name nohost; echo $? condor_vacate: unknown host nohost 0 # condor_off -name nohost; echo $? condor_off: unknown host nohost 0 # condor_on -name nohost; echo $? condor_on: unknown host nohost 0 # condor_reconfig -name nohost; echo $? condor_reconfig: unknown host nohost 0 # condor_restart -name nohost; echo $? condor_restart: unknown host nohost 0
Retested over all supported platforms x86,x86_64/RHEL5,RHEL6: condor-7.6.1-0.4 # condor_off -name nohost; echo $? condor_off: unknown host nohost 1 # condor_reschedule -name nohost; echo $? condor_reschedule: unknown host nohost 1 # condor_vacate -name nohost; echo $? condor_vacate: unknown host nohost 1 # condor_off -name nohost; echo $? condor_off: unknown host nohost 1 # condor_on -name nohost; echo $? condor_on: unknown host nohost 1 # condor_reconfig -name nohost; echo $? condor_reconfig: unknown host nohost 1 # condor_restart -name nohost; echo $? condor_restart: unknown host nohost 1 Return code in all tools was corrected for unknown host parameter. >>> VERIFIED
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2011-0889.html