From 6b96b84cc4ece114b746049f1085ee63fb3a10d7 Mon Sep 17 00:00:00 2001
From: Debora Benedetto <debora.benedetto@hpe.com>
Date: Tue, 19 Jul 2022 19:34:29 +0200
Subject: [PATCH] bugfix operating system exaction

---
 output_files_generated/nginx_openstack/config.yaml | 5 -----
 plugin/AnsiblePlugin.py                            | 4 +++-
 templates/terraform/open_stack/ssh_key.tpl         | 0
 3 files changed, 3 insertions(+), 6 deletions(-)
 delete mode 100644 output_files_generated/nginx_openstack/config.yaml
 create mode 100644 templates/terraform/open_stack/ssh_key.tpl

diff --git a/output_files_generated/nginx_openstack/config.yaml b/output_files_generated/nginx_openstack/config.yaml
deleted file mode 100644
index 6464675..0000000
--- a/output_files_generated/nginx_openstack/config.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-iac:
-- terraform
-- ansible
-...
\ No newline at end of file
diff --git a/plugin/AnsiblePlugin.py b/plugin/AnsiblePlugin.py
index 12daa45..1ff4b39 100644
--- a/plugin/AnsiblePlugin.py
+++ b/plugin/AnsiblePlugin.py
@@ -4,7 +4,9 @@ from plugin.PluginException import PluginResourceNotFoundError
 
 
 def clean_operating_system_name(operating_system):
-    if "ubuntu" in operating_system:
+    operating_system_lower_case = operating_system.lower()
+    logging.info(f"AnsiblePlugin: extracting operating system from {operating_system}")
+    if "ubuntu" in operating_system_lower_case:
         return "ubuntu"
     else:
         raise PluginResourceNotFoundError(plugin_name="AnsiblePlugin", resource_name="operating system")
diff --git a/templates/terraform/open_stack/ssh_key.tpl b/templates/terraform/open_stack/ssh_key.tpl
new file mode 100644
index 0000000..e69de29
-- 
GitLab