Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 786825 - plumage_stats parameter for server raise exception
plumage_stats parameter for server raise exception
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: condor-plumage (Show other bugs)
Development
All Linux
medium Severity medium
: 2.3
: ---
Assigned To: Pete MacKinnon
Daniel Horák
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-02 09:00 EST by Martin Kudlej
Modified: 2013-03-06 13:41 EST (History)
4 users (show)

See Also:
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 13:41:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0564 normal SHIPPED_LIVE Low: Red Hat Enterprise MRG Grid 2.3 security update 2013-03-06 18:37:09 EST

  None (edit)
Description Martin Kudlej 2012-02-02 09:00:13 EST
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.
Comment 1 Pete MacKinnon 2012-05-02 15:43:16 EDT
    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.
Comment 4 Daniel Horák 2012-11-15 05:57:29 EST
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@HOST1.redhat.com
  slot2@HOST1.redhat.com
  slot3@HOST1.redhat.com
# plumage_stats --rl --server="localhost:27017"
  MACHINE
  slot1@HOST1.redhat.com
  slot2@HOST1.redhat.com
  slot3@HOST1.redhat.com
# plumage_stats --rl --server=localhost
  MACHINE
  slot1@HOST1.redhat.com
  slot2@HOST1.redhat.com
  slot3@HOST1.redhat.com
# plumage_stats --rl --server="$(hostname):27017"
  MACHINE
  slot1@HOST1.redhat.com
  slot2@HOST1.redhat.com
  slot3@HOST1.redhat.com
# plumage_stats --rl --server=$(hostname)
  MACHINE
  slot1@HOST1.redhat.com
  slot2@HOST1.redhat.com
  slot3@HOST1.redhat.com

# plumage_stats --rl -s "HOST2.redhat.com:27017"
  MACHINE
  slot1@HOST2.redhat.com
  slot2@HOST2.redhat.com
  slot3@HOST2.redhat.com
# plumage_stats --rl --server="HOST2.redhat.com:27017"
  MACHINE
  slot1@HOST2.redhat.com
  slot2@HOST2.redhat.com
  slot3@HOST2.redhat.com
# plumage_stats --rl --server=HOST2.redhat.com
  MACHINE
  slot1@HOST2.redhat.com
  slot2@HOST2.redhat.com
  slot3@HOST2.redhat.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
Comment 6 errata-xmlrpc 2013-03-06 13:41:35 EST
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

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