| Summary: | plumage_stats parameter for server raise exception | ||
|---|---|---|---|
| Product: | Red Hat Enterprise MRG | Reporter: | Martin Kudlej <mkudlej> |
| Component: | condor-plumage | Assignee: | Pete MacKinnon <pmackinn> |
| Status: | CLOSED ERRATA | QA Contact: | Daniel Horák <dahorak> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | Development | CC: | dahorak, matt, pmackinn, tstclair |
| Target Milestone: | 2.3 | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | condor-7.8.2-0.1 | Doc Type: | Bug Fix |
| Doc Text: |
Cause: Incorrect parsing of server hostname and port arguments.
Consequence: TypeError from python when plumage_stats was invoked with a server:port string.
Fix: Unnecessary nargs keyword was removed from parser option for mongodb host.
Result: plumage_stats correctly parses optional server argument.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-03-06 18:41:35 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
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: Incorrect parsing of server hostname and port arguments.
Consequence: TypeError from python when plumage_stats was invoked with a server:port string.
Fix: Unnecessary nargs keyword was removed from parser option for mongodb host.
Result: plumage_stats correctly parses optional server argument.
Tested and verified on RHEL 6.4 i386/x86_64:
# rpm -qa | grep condor
condor-7.8.7-0.4.el6.i686
condor-plumage-7.8.7-0.4.el6.i686
condor-classads-7.8.7-0.4.el6.i686
# plumage_stats --rl -s "localhost:27017"
MACHINE
slot1.com
slot2.com
slot3.com
# plumage_stats --rl --server="localhost:27017"
MACHINE
slot1.com
slot2.com
slot3.com
# plumage_stats --rl --server=localhost
MACHINE
slot1.com
slot2.com
slot3.com
# plumage_stats --rl --server="$(hostname):27017"
MACHINE
slot1.com
slot2.com
slot3.com
# plumage_stats --rl --server=$(hostname)
MACHINE
slot1.com
slot2.com
slot3.com
# plumage_stats --rl -s "HOST2.redhat.com:27017"
MACHINE
slot1.com
slot2.com
slot3.com
# plumage_stats --rl --server="HOST2.redhat.com:27017"
MACHINE
slot1.com
slot2.com
slot3.com
# plumage_stats --rl --server=HOST2.redhat.com
MACHINE
slot1.com
slot2.com
slot3.com
# plumage_stats --rl --server=xyz
could not find master/primary
# echo $?
1
# plumage_stats --rl --server="localhost:1234"
could not find master/primary
# echo $?
1
# plumage_stats --rl --server=
empty host (or extra comma in host list)
# echo $?
1
# plumage_stats --rl --server
Usage: plumage_stats [options]
plumage_stats: error: --server option requires an argument
# echo $?
2
# plumage_stats --rl -s
Usage: plumage_stats [options]
plumage_stats: error: -s option requires an argument
# echo $?
2
It is possible to use -s/--server parameter.
In case of problem, it write error message and exit with return code>0 (without raise exception).
>>> VERIFIED
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/RHSA-2013-0564.html |
Description of problem: $ plumage_stats -s "localhost:27017" Traceback (most recent call last): File "/usr/bin/plumage_stats", line 78, in <module> (options, args) = parser.parse_args() File "/usr/lib64/python2.6/optparse.py", line 1394, in parse_args stop = self._process_args(largs, rargs, values) File "/usr/lib64/python2.6/optparse.py", line 1438, in _process_args self._process_short_opts(rargs, values) File "/usr/lib64/python2.6/optparse.py", line 1535, in _process_short_opts % (opt, nargs)) TypeError: %d format: a number is required, not str $ condor_config_val -dump | grep ODS_DB_PORT ODS_DB_PORT = 27017 $ condor_config_val -dump | grep ODS_DB_HOST ODS_DB_HOST = localhost $ plumage_stats -s "localhost:27017" Traceback (most recent call last): File "/usr/bin/plumage_stats", line 78, in <module> (options, args) = parser.parse_args() File "/usr/lib64/python2.6/optparse.py", line 1394, in parse_args stop = self._process_args(largs, rargs, values) File "/usr/lib64/python2.6/optparse.py", line 1438, in _process_args self._process_short_opts(rargs, values) File "/usr/lib64/python2.6/optparse.py", line 1535, in _process_short_opts % (opt, nargs)) TypeError: %d format: a number is required, not str $ plumage_stats --server="localhost:27017" Traceback (most recent call last): File "/usr/bin/plumage_stats", line 78, in <module> (options, args) = parser.parse_args() File "/usr/lib64/python2.6/optparse.py", line 1394, in parse_args stop = self._process_args(largs, rargs, values) File "/usr/lib64/python2.6/optparse.py", line 1434, in _process_args self._process_long_opt(rargs, values) File "/usr/lib64/python2.6/optparse.py", line 1496, in _process_long_opt % (opt, nargs)) TypeError: %d format: a number is required, not str $ plumage_stats --server="$(hostname):27017" Traceback (most recent call last): File "/usr/bin/plumage_stats", line 78, in <module> (options, args) = parser.parse_args() File "/usr/lib64/python2.6/optparse.py", line 1394, in parse_args stop = self._process_args(largs, rargs, values) File "/usr/lib64/python2.6/optparse.py", line 1434, in _process_args self._process_long_opt(rargs, values) File "/usr/lib64/python2.6/optparse.py", line 1496, in _process_long_opt % (opt, nargs)) TypeError: %d format: a number is required, not str $ plumage_stats --server=$(hostname) Traceback (most recent call last): File "/usr/bin/plumage_stats", line 78, in <module> (options, args) = parser.parse_args() File "/usr/lib64/python2.6/optparse.py", line 1394, in parse_args stop = self._process_args(largs, rargs, values) File "/usr/lib64/python2.6/optparse.py", line 1434, in _process_args self._process_long_opt(rargs, values) File "/usr/lib64/python2.6/optparse.py", line 1496, in _process_long_opt % (opt, nargs)) TypeError: %d format: a number is required, not str $ plumage_stats --server=localhost Traceback (most recent call last): File "/usr/bin/plumage_stats", line 78, in <module> (options, args) = parser.parse_args() File "/usr/lib64/python2.6/optparse.py", line 1394, in parse_args stop = self._process_args(largs, rargs, values) File "/usr/lib64/python2.6/optparse.py", line 1434, in _process_args self._process_long_opt(rargs, values) File "/usr/lib64/python2.6/optparse.py", line 1496, in _process_long_opt % (opt, nargs)) TypeError: %d format: a number is required, not str Version-Release number of selected component (if applicable): condor-plumage-7.6.5-0.12 How reproducible: 100% Steps to Reproduce: 1. install and setup condor and ODS 2. plumage_stats -s(or --server=) hostname(:port) 3. it raises exception Actual results: It raises exception for server parameter. Expected results: It will not raise exception. If anything is wrong, it will write message and end with return code>0. It will be able to use server parameter.