mirror of
https://github.com/ansible/awx.git
synced 2026-03-19 18:07:33 -02:30
Use the fully qualified inventory plugin name only for foreman
This commit is contained in:
committed by
Shane McDonald
parent
e63383bde6
commit
3f76499c56
@@ -1373,6 +1373,7 @@ class PluginFileInjector(object):
|
|||||||
collection = None
|
collection = None
|
||||||
collection_migration = '2.9' # Starting with this version, we use collections
|
collection_migration = '2.9' # Starting with this version, we use collections
|
||||||
|
|
||||||
|
# TODO: delete this method and update unit tests
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_proper_name(cls):
|
def get_proper_name(cls):
|
||||||
if cls.plugin_name is None:
|
if cls.plugin_name is None:
|
||||||
@@ -1397,13 +1398,12 @@ class PluginFileInjector(object):
|
|||||||
|
|
||||||
def inventory_as_dict(self, inventory_update, private_data_dir):
|
def inventory_as_dict(self, inventory_update, private_data_dir):
|
||||||
source_vars = dict(inventory_update.source_vars_dict) # make a copy
|
source_vars = dict(inventory_update.source_vars_dict) # make a copy
|
||||||
proper_name = self.get_proper_name()
|
|
||||||
'''
|
'''
|
||||||
None conveys that we should use the user-provided plugin.
|
None conveys that we should use the user-provided plugin.
|
||||||
Note that a plugin value of '' should still be overridden.
|
Note that a plugin value of '' should still be overridden.
|
||||||
'''
|
'''
|
||||||
if proper_name is not None:
|
if self.plugin_name is not None:
|
||||||
source_vars['plugin'] = proper_name
|
source_vars['plugin'] = self.plugin_name
|
||||||
return source_vars
|
return source_vars
|
||||||
|
|
||||||
def build_env(self, inventory_update, env, private_data_dir, private_data_files):
|
def build_env(self, inventory_update, env, private_data_dir, private_data_files):
|
||||||
@@ -1573,6 +1573,12 @@ class satellite6(PluginFileInjector):
|
|||||||
ret['FOREMAN_PASSWORD'] = credential.get_input('password', default='')
|
ret['FOREMAN_PASSWORD'] = credential.get_input('password', default='')
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
def inventory_as_dict(self, inventory_update, private_data_dir):
|
||||||
|
ret = super(satellite6, self).inventory_as_dict(inventory_update, private_data_dir)
|
||||||
|
# this inventory plugin requires the fully qualified inventory plugin name
|
||||||
|
ret['plugin'] = f'{cls.namespace}.{cls.collection}.{cls.plugin_name}'
|
||||||
|
return ret
|
||||||
|
|
||||||
|
|
||||||
class tower(PluginFileInjector):
|
class tower(PluginFileInjector):
|
||||||
plugin_name = 'tower'
|
plugin_name = 'tower'
|
||||||
|
|||||||
Reference in New Issue
Block a user