From 2808d1c15500b4a5f2d977a0131f58d74abe7679 Mon Sep 17 00:00:00 2001 From: Joker 234 Date: Thu, 1 Jun 2023 19:41:20 +0200 Subject: [PATCH] fix(inventory): bug when using clouds_yaml_path Before this fix the current implementation in combination with the most recent openstacksdk (1.2.0) resulted in a list containing the default values and another list inside this list containing the value of clouds_yaml_path. The clouds_yaml_path value gets now added directly to the list only if it was set. Change-Id: I3c3b6f59393928d098e9b80c55b87fc6ee1e9912 --- plugins/inventory/openstack.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/inventory/openstack.py b/plugins/inventory/openstack.py index db6b78a7..826e304b 100644 --- a/plugins/inventory/openstack.py +++ b/plugins/inventory/openstack.py @@ -271,9 +271,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): if not attempt_to_read_cache or cache_needs_update: self.display.vvvv('Retrieving servers from Openstack clouds') clouds_yaml_path = self.get_option('clouds_yaml_path') - config_files = ( - openstack.config.loader.CONFIG_FILES - + ([clouds_yaml_path] if clouds_yaml_path else [])) + config_files = openstack.config.loader.CONFIG_FILES + if clouds_yaml_path: + config_files += clouds_yaml_path config = openstack.config.loader.OpenStackConfig( config_files=config_files)