fixes #42042
do not create group with region name if it is not given Backport https://github.com/ansible/ansible/pull/42939 (cherry picked from commit d3f53b4b9f6167c359dae1069cb71eb10d00afc0)
This commit is contained in:
parent
b0a4627975
commit
0aa5d8ed45
2 changed files with 4 additions and 1 deletions
2
changelogs/fragments/42042-inventory_with_no_region.yaml
Normal file
2
changelogs/fragments/42042-inventory_with_no_region.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- plugins/inventory/openstack.py - Do not create group with empty name if region is not set
|
|
@ -254,7 +254,8 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||
groups.append(cloud)
|
||||
|
||||
# Create a group on region
|
||||
groups.append(region)
|
||||
if region:
|
||||
groups.append(region)
|
||||
|
||||
# And one by cloud_region
|
||||
groups.append("%s_%s" % (cloud, region))
|
||||
|
|
Loading…
Reference in a new issue