Bug 1277216

Summary: gdeploy produces warnings about wrong usage of argparse module
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Martin Bukatovic <mbukatov>
Component: gdeployAssignee: Sachidananda Urs <surs>
Status: CLOSED ERRATA QA Contact: Anush Shetty <ashetty>
Severity: low Docs Contact:
Priority: unspecified    
Version: rhgs-3.1CC: nvarma, rcyriac, rhinduja, smohan, surs
Target Milestone: ---Keywords: ZStream
Target Release: RHGS 3.1.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gdeploy-2.0-2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-23 05:28:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1299184    

Description Martin Bukatovic 2015-11-02 17:10:59 UTC
Description of problem
======================

Python module argparse is used in a wrong way. On rhel 6 machines, this leads
to ugly warning being displayed every time gdeploy command is run.

Version-Release number of selected component (if applicable)
============================================================

gdeploy-1.0-12.el6rhs.noarch
python-2.6.6-64.el6.x86_64
python-argparse-1.2.1-2.1.el6.noarch

How reproducible
================

100 %

Steps to Reproduce
==================

On RHEL 6 Gluster Storage Server machnie, try to use gdeploy tool, eg:

 * gdeploy -h
 * gdeploy --version

Actual results
==============

Python module argparse complains about wrong usage of it's api:

~~~
# gdeploy -h
/usr/lib/python2.6/site-packages/argparse.py:1575: DeprecationWarning: The "version" argument to ArgumentParser is deprecated. Please use "add_argument(..., action='version', version="N", ...)" instead
  """instead""", DeprecationWarning)
usage: gdeploy [-h] [-v] [-vv] [-c CONFIG_FILE] [-k] [volumeset <hostIP>:<volumename> <key> <value>]

positional arguments:
  volumeset       Set options for the volume

optional arguments:
  -h, --help      show this help message and exit
  -v, --version   show program's version number and exit
  -c CONFIG_FILE  Configuration file
  -k              Keep the generated ansible utility files
  -vv             verbose mode
~~~

~~~
# gdeploy --version
/usr/lib/python2.6/site-packages/argparse.py:1575: DeprecationWarning: The "version" argument to ArgumentParser is deprecated. Please use "add_argument(..., action='version', version="N", ...)" instead
  """instead""", DeprecationWarning)
1.0
~~~

Expected results
================

Python module argparse doesn't complain. So for example:

~~~
# gdeploy --version
gdeploy 1.0
~~~

Comment 1 Martin Bukatovic 2015-11-02 17:12:37 UTC
See proposed fix: https://github.com/gluster/gdeploy/pull/25

Comment 2 Sachidananda Urs 2015-11-03 07:15:59 UTC
Merged into gdeploy-1.1

Comment 6 Anush Shetty 2016-04-11 05:24:38 UTC
Verified with gdeploy-2.0-2.el6rhs.noarch

Comment 8 errata-xmlrpc 2016-06-23 05:28:49 UTC
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.

https://access.redhat.com/errata/RHEA-2016:1250