do not enforce plugin: for source=scm

* InventorySource w/ source type scm point to an inventory file via
source_file. source_vars are ignored.
This commit is contained in:
Chris Meyers
2020-07-29 15:26:17 -04:00
committed by Ryan Petrello
parent 35d264d7f8
commit b7efad5640
2 changed files with 4 additions and 29 deletions

View File

@@ -1163,13 +1163,6 @@ class InventorySource(UnifiedJobTemplate, InventorySourceOptions, CustomVirtualE
source_vars = dict(self.source_vars_dict) # make a copy
if injector and self.source_vars_dict.get('plugin', '') != injector.get_proper_name():
source_vars['plugin'] = injector.get_proper_name()
elif not injector:
source_vars = dict(self.source_vars_dict) # make a copy
collection_pattern = re.compile("^(.+)\.(.+)\.(.+)$") # noqa
if 'plugin' not in source_vars:
raise ValidationError(_("plugin: must be present and of the form namespace.collection.inv_plugin"))
elif not bool(collection_pattern.match(source_vars['plugin'])):
raise ValidationError(_("plugin: must be of the form namespace.collection.inv_plugin"))
return json.dumps(source_vars)
'''