From 0787e38090d309c2c1272886c6ea029a9f8e4924 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Mon, 12 Nov 2012 16:25:54 -0500 Subject: Remove add_option() method argparse just has an add_argument() method, so there's no reason for us to keep add_option() around. Change-Id: I6f4be089ceaf0fd8c4c99565af392b445916172e --- openstack/common/cfg.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'openstack') diff --git a/openstack/common/cfg.py b/openstack/common/cfg.py index ee5fd4f..531c650 100644 --- a/openstack/common/cfg.py +++ b/openstack/common/cfg.py @@ -560,7 +560,7 @@ class Opt(object): :param container: an argparse._ArgumentGroup object :param name: the opt name :param short: the short opt name - :param kwargs: the keyword arguments for add_option() + :param kwargs: the keyword arguments for add_argument() :param prefix: an optional prefix to prepend to the opt name :raises: DuplicateOptError if a naming confict is detected """ @@ -962,14 +962,11 @@ class ConfigCliParser(argparse.ArgumentParser): if usage is not None: self.usage = usage.replace("%prog", self.prog) - self.add_option('--version', - action=_VersionAction, - version=version) + self.add_argument('--version', + action=_VersionAction, + version=version) self._optionals.title = 'Options' - def add_option(self, *args, **kwargs): - self.add_argument(*args, **kwargs) - def add_argument(self, *args, **kwargs): try: super(ConfigCliParser, self).add_argument(*args, **kwargs) -- cgit