diff options
| author | Jamie Lennox <jamielennox@redhat.com> | 2014-08-14 16:02:47 +1000 |
|---|---|---|
| committer | Jamie Lennox <jamielennox@redhat.com> | 2014-08-15 09:47:21 +1000 |
| commit | 7d0277cacd78265b0d0d497cabe0ef184f8b63d4 (patch) | |
| tree | 85d12d11377a6c823cc553d1a4b44dfbe7e71ff4 /keystoneclient/auth/base.py | |
| parent | e7eaec13e9c47e9e28a367819c08d4bedb8f6da0 (diff) | |
| download | python-keystoneclient-7d0277cacd78265b0d0d497cabe0ef184f8b63d4.tar.gz | |
Make auth plugins dest save to os_
If the auth plugin saves into the normal namespace like .user_id and
user_id is an argument of the command then the two argument collide with
each other.
This is fairly common, particularly in keystoneclient's shell.
There is a little bit of a compatibility concern in that the variables
on the returned namespace have changed, however the usage of this
function should be if you use register_argparse_arguments you should
also use load_from_argparse_arguments and that is not changed.
Change-Id: Id1cb0983a1e78661492acd78ad9aa67ff8d49250
Diffstat (limited to 'keystoneclient/auth/base.py')
| -rw-r--r-- | keystoneclient/auth/base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/keystoneclient/auth/base.py b/keystoneclient/auth/base.py index 74d4de5..4e1b269 100644 --- a/keystoneclient/auth/base.py +++ b/keystoneclient/auth/base.py @@ -151,7 +151,7 @@ class BaseAuthPlugin(object): default=default, metavar=opt.metavar, help=opt.help, - dest=opt.dest) + dest='os_%s' % opt.dest) @classmethod def load_from_argparse_arguments(cls, namespace, **kwargs): @@ -165,7 +165,7 @@ class BaseAuthPlugin(object): :returns: An auth plugin, or None if a name is not provided. """ for opt in cls.get_options(): - val = getattr(namespace, opt.dest) + val = getattr(namespace, 'os_%s' % opt.dest) if val is not None: val = opt.type(val) kwargs.setdefault(opt.dest, val) |
