mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
exclude lookup_terms from config errors (#41740)
* exclude lookup_terms from config errors * moved direct
This commit is contained in:
parent
06b73ff8f1
commit
0102e42272
4 changed files with 67 additions and 71 deletions
|
@ -73,14 +73,7 @@ class AnsiblePlugin(with_metaclass(ABCMeta, object)):
|
|||
|
||||
if not self._options:
|
||||
# load config options if we have not done so already, if vars provided we should be mostly done
|
||||
self._options = C.config.get_plugin_options(get_plugin_class(self), self._load_name, keys=task_keys, variables=var_options)
|
||||
|
||||
# they can be direct options overriding config
|
||||
if direct:
|
||||
for k in self._options:
|
||||
if k in direct:
|
||||
self.set_option(k, direct[k])
|
||||
|
||||
self._options = C.config.get_plugin_options(get_plugin_class(self), self._load_name, keys=task_keys, variables=var_options, direct=direct)
|
||||
# allow extras/wildcards from vars that are not directly consumed in configuration
|
||||
if self.allow_extras and var_options and '_extras' in var_options:
|
||||
self.set_option('_extras', var_options['_extras'])
|
||||
|
|
|
@ -98,13 +98,7 @@ class CallbackBase(AnsiblePlugin):
|
|||
'''
|
||||
|
||||
# load from config
|
||||
self._plugin_options = C.config.get_plugin_options(get_plugin_class(self), self._load_name, keys=task_keys, variables=var_options)
|
||||
|
||||
# or parse specific options
|
||||
if direct:
|
||||
for k in direct:
|
||||
if k in self._plugin_options:
|
||||
self.set_option(k, direct[k])
|
||||
self._plugin_options = C.config.get_plugin_options(get_plugin_class(self), self._load_name, keys=task_keys, variables=var_options, direct=direct)
|
||||
|
||||
def _dump_results(self, result, indent=None, sort_keys=True, keep_invocation=False):
|
||||
|
||||
|
|
|
@ -69,7 +69,6 @@ class LookupModule(LookupBase):
|
|||
self._templar.set_available_variables(variables)
|
||||
myvars = getattr(self._templar, '_available_variables', {})
|
||||
|
||||
self.set_option('_terms', terms)
|
||||
self.set_options(direct=kwargs)
|
||||
default = self.get_option('default')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue