More hacks to fix broken o-c-c precedence

We needed a bit more to work around os-client-config 1.18.0's broken
precedence; this can't all be fixed in OSC.

Change-Id: Ibe1c36e72c96eb2b3746645f7e6b433307ce8021
This commit is contained in:
Dean Troyer 2016-08-11 18:28:07 -05:00
parent e0e2deaee0
commit ea65b90d63
2 changed files with 27 additions and 0 deletions

View File

@ -148,6 +148,22 @@ class OSC_Config(OpenStackConfig):
LOG.debug("auth_config_hook(): %s" % config)
return config
# TODO(dtroyer): un-hackify all of the below when o-c-c 1.19.x is
# the minimum in global-requirements
def get_one_cloud(self, cloud=None, validate=True,
argparse=None, **kwargs):
# First, save this off for later
self._save_argparse = self._fix_args(kwargs, argparse=argparse)
return super(OSC_Config, self).get_one_cloud(
cloud=cloud,
validate=validate,
argparse=argparse,
**kwargs
)
def _validate_auth_ksc(self, config, cloud, fixed_argparse=None):
"""Old compatibility hack for OSC, no longer needed/wanted"""
return config
@ -156,6 +172,10 @@ class OSC_Config(OpenStackConfig):
"""Validate auth plugin arguments"""
# May throw a keystoneauth1.exceptions.NoMatchingPlugin
if fixed_argparse is None:
# This is o-c-c 1.18.x or older, fix up the original options
fixed_argparse = self._fix_args(None, argparse=self._save_argparse)
plugin_options = loader.get_options()
for p_opt in plugin_options:

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Add additional precedence fixes to the argument precedence problems
in os-client-config 1.18.0 and earlier. This all will be removed
when os-client-config 1.19.x is the minimum allwed version in
OpenStack's global requirements.txt.