mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 07:26:03 -03:30
AC-615 Handle Rackspace inventory import when source_regions is empty string.
This commit is contained in:
@@ -782,7 +782,7 @@ class RunInventoryUpdate(BaseTask):
|
|||||||
env['EC2_INI_PATH'] = kwargs.get('private_data_file', '')
|
env['EC2_INI_PATH'] = kwargs.get('private_data_file', '')
|
||||||
elif inventory_source.source == 'rackspace':
|
elif inventory_source.source == 'rackspace':
|
||||||
env['RAX_CREDS_FILE'] = kwargs.get('private_data_file', '')
|
env['RAX_CREDS_FILE'] = kwargs.get('private_data_file', '')
|
||||||
env['RAX_REGION'] = inventory_source.source_regions
|
env['RAX_REGION'] = inventory_source.source_regions or 'all'
|
||||||
# Set this environment variable so the vendored package won't
|
# Set this environment variable so the vendored package won't
|
||||||
# complain about not being able to determine its version number.
|
# complain about not being able to determine its version number.
|
||||||
env['PBR_VERSION'] = '0.5.21'
|
env['PBR_VERSION'] = '0.5.21'
|
||||||
|
|||||||
@@ -967,6 +967,8 @@ class InventoryUpdatesTest(BaseTransactionTest):
|
|||||||
self.organization.users.add(self.normal_django_user)
|
self.organization.users.add(self.normal_django_user)
|
||||||
self.inventory = self.organization.inventories.create(name='Cloud Inventory')
|
self.inventory = self.organization.inventories.create(name='Cloud Inventory')
|
||||||
self.group = self.inventory.groups.create(name='Cloud Group')
|
self.group = self.inventory.groups.create(name='Cloud Group')
|
||||||
|
self.inventory2 = self.organization.inventories.create(name='Cloud Inventory 2')
|
||||||
|
self.group2 = self.inventory2.groups.create(name='Cloud Group 2')
|
||||||
|
|
||||||
def update_inventory_source(self, group, **kwargs):
|
def update_inventory_source(self, group, **kwargs):
|
||||||
inventory_source = group.inventory_source
|
inventory_source = group.inventory_source
|
||||||
@@ -1055,3 +1057,8 @@ class InventoryUpdatesTest(BaseTransactionTest):
|
|||||||
source='rackspace', credential=credential,
|
source='rackspace', credential=credential,
|
||||||
source_regions=source_regions)
|
source_regions=source_regions)
|
||||||
self.check_inventory_source(inventory_source)
|
self.check_inventory_source(inventory_source)
|
||||||
|
# If test source regions is given, test again with empty string.
|
||||||
|
if source_regions:
|
||||||
|
inventory_source2 = self.update_inventory_source(self.group2,
|
||||||
|
source='rackspace', credential=credential, source_regions='')
|
||||||
|
self.check_inventory_source(inventory_source2)
|
||||||
|
|||||||
Reference in New Issue
Block a user