refactored original hosts and renamed source_inventories to input_inventories

This commit is contained in:
Gabe Muniz
2023-02-03 10:04:58 -05:00
parent c22d8f1d7e
commit 80c15e286f
6 changed files with 12 additions and 12 deletions

View File

@@ -11,7 +11,7 @@ class Migration(migrations.Migration):
operations = [
migrations.AddField(
model_name='inventory',
name='source_inventories',
name='input_inventories',
field=models.ManyToManyField(
blank=True,
help_text='Only valid for constructed inventories, this links to the inventories that will be used.',

View File

@@ -140,7 +140,7 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
default=None,
help_text=_('Filter that will be applied to the hosts of this inventory.'),
)
source_inventories = models.ManyToManyField(
input_inventories = models.ManyToManyField(
'Inventory',
blank=True,
related_name='destination_inventories',

View File

@@ -1524,10 +1524,10 @@ class RunInventoryUpdate(SourceControlMixin, BaseTask):
# special case for constructed inventories, we pass source inventories from database
# these must come in order, and in order _before_ the constructed inventory itself
if inventory_update.inventory.kind == 'constructed':
for source_inventory in inventory_update.inventory.source_inventories.all():
for input_inventory in inventory_update.inventory.input_inventories.all():
args.append('-i')
script_params = dict(hostvars=True, towervars=True)
source_inv_path = self.write_inventory_file(source_inventory, private_data_dir, f'hosts_{source_inventory.id}', script_params)
source_inv_path = self.write_inventory_file(input_inventory, private_data_dir, f'hosts_{input_inventory.id}', script_params)
args.append(to_container_path(source_inv_path, private_data_dir))
# Add arguments for the source inventory file/script/thing