diff --git a/osc_lib/cli/client_config.py b/osc_lib/cli/client_config.py index b456e80..30abae8 100644 --- a/osc_lib/cli/client_config.py +++ b/osc_lib/cli/client_config.py @@ -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: diff --git a/releasenotes/notes/arg-precedence-1ba9fd6929650830.yaml b/releasenotes/notes/arg-precedence-1ba9fd6929650830.yaml new file mode 100644 index 0000000..df821c1 --- /dev/null +++ b/releasenotes/notes/arg-precedence-1ba9fd6929650830.yaml @@ -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.