diff options
| author | Mark McLoughlin <markmc@redhat.com> | 2012-11-12 16:25:54 -0500 |
|---|---|---|
| committer | Mark McLoughlin <markmc@redhat.com> | 2012-11-15 14:59:30 -0500 |
| commit | 0787e38090d309c2c1272886c6ea029a9f8e4924 (patch) | |
| tree | 510aad3db1054b0a73fed6b4725a6ce846998190 /openstack/common | |
| parent | cdf57f3589d147022724f50d34991f570e401144 (diff) | |
| download | oslo-0787e38090d309c2c1272886c6ea029a9f8e4924.tar.gz oslo-0787e38090d309c2c1272886c6ea029a9f8e4924.tar.xz oslo-0787e38090d309c2c1272886c6ea029a9f8e4924.zip | |
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
Diffstat (limited to 'openstack/common')
| -rw-r--r-- | openstack/common/cfg.py | 11 |
1 files changed, 4 insertions, 7 deletions
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) |
