| Summary: | condor_q output depends on order of parameters | ||
|---|---|---|---|
| Product: | Red Hat Enterprise MRG | Reporter: | Martin Kudlej <mkudlej> |
| Component: | condor | Assignee: | Erik Erlandson <eerlands> |
| Status: | CLOSED ERRATA | QA Contact: | Martin Kudlej <mkudlej> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 1.3 | CC: | iboverma, matt, tstclair |
| Target Milestone: | 2.1 | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | condor-7.6.4-0.5 | Doc Type: | Bug Fix |
| Doc Text: |
The "-long" and "-format" options to the condor_q command were order-dependent due to a parsing error. This update removes the parsing error, and the order of the aforementioned options no longer results in different behavior.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-01-23 17:26:09 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | |||
| Bug Blocks: | 743350 | ||
|
Description
Martin Kudlej
2011-03-24 13:46:49 UTC
Also,
$ condor_q -attributes ProcId,ExitCode,ExitBySignal,JobStatus -long -format "%s\n" x -long
JobStatus = 5
ProcId = 0
ExitBySignal = false
It looks like -format clears some -long bit.
And indeed it does,
src/condor_q.V6/queue.cpp
if (match_prefix (arg, "long")) {
verbose = 1;
summarize = 0;
}
...
if( match_prefix( arg, "format" ) ) {
// make sure we have at least two more arguments
if( argc <= i+2 ) {
fprintf( stderr, "Error: Argument -format requires "
"format and attribute parameters\n" );
exit( 1 );
}
verbose = 0;
It is unclear why the "verbose = 0" is important, especially when an extra -long after the -format can re-enable it.
commit f57379da4ff5e9f2ea3920b6b71271a55ad341dc
Author: gthain <gthain>
Date: Thu Nov 15 21:06:57 2007 +0000
Add support for schedd-side projection when xml output is asked for. This is a bit of a hack, and only for Igor, so I am intentionall not documenting it yet
diff --git a/src/condor_q.V6/queue.C b/src/condor_q.V6/queue.C
index 3becaed..64fef7a 100644
--- a/src/condor_q.V6/queue.C
+++ b/src/condor_q.V6/queue.C
@@ -1122,6 +1122,7 @@ processCommandLineArguments (int argc, char *argv[])
"format and attribute parameters\n" );
exit( 1 );
}
+ verbose = 0;
if (customFormat == false) {
// first time here
attrs.clearAll();
The code was introduced for the "-xml -format X Attr1 -format Y Attr2" trick, which is now explicitly supported with "-xml -attributes Attr1,Attr2". The importance of the "verbose = 0" is still a mystery and does not appear to be important in current code. It should just be removed. Committed to uw/V7_6-branch REPRO/TEST Submit a more or less arbitrary job so there is something in the queue. Before fix, order of "-l" and "-format" will alter output: $ condor_q -attributes ProcId,JobStatus -l -format "%s\n" xxx 1 $ condor_q -attributes ProcId,JobStatus -format "%s\n" xxx -l 1 JobStatus = 2 ProcId = 0 After fix, order is independent: $ condor_q -attributes ProcId,JobStatus -l -format "%s\n" xxx 1 JobStatus = 2 ProcId = 0 $ condor_q -attributes ProcId,JobStatus -format "%s\n" xxx -l 1 JobStatus = 2 ProcId = 0
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:
Cause:
boolean flag was needlessly reset during parsing of "-format" option on condor_q
Consequence:
Order dependency between "-long" and "-format" arguments on command line
Fix:
Removed the offending flag reset
Result:
"-long" and "-format" are no longer order dependent
Tested on RHEL5.8/RHEL6.1 x x86_64/i386 with condor-7.6.4-0.8 and it works -> VERIFIED
Technical note updated. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
Diffed Contents:
@@ -1,11 +1 @@
-Cause:
+The "-long" and "-format" options to the condor_q command were order-dependent due to a parsing error. This update removes the parsing error, and the order of the aforementioned options no longer results in different behavior.-boolean flag was needlessly reset during parsing of "-format" option on condor_q
-
-Consequence:
-Order dependency between "-long" and "-format" arguments on command line
-
-Fix:
-Removed the offending flag reset
-
-Result:
-"-long" and "-format" are no longer order dependent
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHEA-2012-0045.html |