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:
Artem Goncharov 2018-07-18 13:37:04 +02:00 committed by Matt Clay
parent b0a4627975
commit 0aa5d8ed45
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- plugins/inventory/openstack.py - Do not create group with empty name if region is not set

View file

@ -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))