Blame SOURCES/sos-bz1506908-openstack-containerized.patch

8b0807
From e63c17d902f99d96cbd4cb2a06d9cbbf8a4d4c18 Mon Sep 17 00:00:00 2001
8b0807
From: Martin Schuppert <mschuppert@redhat.com>
8b0807
Date: Tue, 7 Nov 2017 18:07:47 +0100
8b0807
Subject: [PATCH] [openstack_nova] added missing nova container config
8b0807
8b0807
Tripleo Pike opinionated config+log paths to be collected
8b0807
for services, when running in containers.
8b0807
8b0807
The nova configuration for the nova and placement container
8b0807
was included, but the nova configuration libvirt container
8b0807
was missing. Also the httpd configs for the nova contaier
8b0807
were added.
8b0807
8b0807
This is a change to #1130
8b0807
8b0807
Signed-off-by: Martin Schuppert mschuppe@redhat.com
8b0807
---
8b0807
 sos/plugins/openstack_nova.py | 6 +++++-
8b0807
 1 file changed, 5 insertions(+), 1 deletion(-)
8b0807
8b0807
diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py
8b0807
index 1fbfa76a..cdd29760 100644
8b0807
--- a/sos/plugins/openstack_nova.py
8b0807
+++ b/sos/plugins/openstack_nova.py
8b0807
@@ -87,7 +87,10 @@ class OpenStackNova(Plugin):
8b0807
             "/etc/nova/",
8b0807
             self.var_puppet_gen + "/etc/nova/",
8b0807
             self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf",
8b0807
-            self.var_puppet_gen + "_placement/var/spool/cron/nova",
8b0807
+            self.var_puppet_gen + "/var/spool/cron/nova",
8b0807
+            self.var_puppet_gen + "/etc/httpd/conf/",
8b0807
+            self.var_puppet_gen + "/etc/httpd/conf.d/",
8b0807
+            self.var_puppet_gen + "/etc/httpd/conf.modules.d/*.conf",
8b0807
             self.var_puppet_gen + "_placement/etc/nova/",
8b0807
             self.var_puppet_gen + "_placement/etc/httpd/conf/",
8b0807
             self.var_puppet_gen + "_placement/etc/httpd/conf.d/",
8b0807
@@ -96,6 +99,7 @@ class OpenStackNova(Plugin):
8b0807
             self.var_puppet_gen + "/../memcached/etc/sysconfig/memcached",
8b0807
             self.var_puppet_gen + "_libvirt/etc/libvirt/",
8b0807
             self.var_puppet_gen + "_libvirt/etc/my.cnf.d/tripleo.cnf",
8b0807
+            self.var_puppet_gen + "_libvirt/etc/nova/",
8b0807
             self.var_puppet_gen + "_libvirt/etc/nova/migration/"
8b0807
             "authorized_keys",
8b0807
             self.var_puppet_gen + "_libvirt/var/lib/nova/.ssh/config",
8b0807
-- 
8b0807
2.13.6
8b0807
8b0807
From 410733862a1f5ea1f9666d1fa41a7b5d3390e3c6 Mon Sep 17 00:00:00 2001
8b0807
From: Martin Schuppert <mschuppert@redhat.com>
8b0807
Date: Wed, 8 Nov 2017 17:57:54 +0100
8b0807
Subject: [PATCH] [openstack_[glance|heat|cinder|nova]] limit command run
8b0807
8b0807
Collect "glance-manage db_version" and similar commands from the
8b0807
four plugins only if the relevant services or containers are
8b0807
running. Otherwise the commands get stuck and timeout.
8b0807
8b0807
This is an enhancement to #1124 to check for containers + do the
8b0807
same for nova + cinder.
8b0807
8b0807
Signed-off-by: Martin Schuppert mschuppe@redhat.com
8b0807
8b0807
Edited to remove use of shell syntax.
8b0807
8b0807
Fixes: #1139
8b0807
8b0807
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
8b0807
---
8b0807
 sos/plugins/openstack_cinder.py | 30 ++++++++++---
8b0807
 sos/plugins/openstack_glance.py | 33 +++++++++++----
8b0807
 sos/plugins/openstack_heat.py   | 23 ++++++++--
8b0807
 sos/plugins/openstack_nova.py   | 94 +++++++++++++++++++++++++++--------------
8b0807
 4 files changed, 129 insertions(+), 51 deletions(-)
8b0807
8b0807
diff --git a/sos/plugins/openstack_cinder.py b/sos/plugins/openstack_cinder.py
8b0807
index abfd267b..a023105c 100644
8b0807
--- a/sos/plugins/openstack_cinder.py
8b0807
+++ b/sos/plugins/openstack_cinder.py
8b0807
@@ -27,16 +27,34 @@ class OpenStackCinder(Plugin):
8b0807
     plugin_name = "openstack_cinder"
8b0807
     profiles = ('openstack', 'openstack_controller')
8b0807
 
8b0807
-    option_list = [("db", "gathers openstack cinder db version", "slow",
8b0807
-                    False)]
8b0807
-
8b0807
     var_puppet_gen = "/var/lib/config-data/puppet-generated/cinder"
8b0807
 
8b0807
     def setup(self):
8b0807
-        if self.get_option("db"):
8b0807
+
8b0807
+        # collect commands output only if the openstack-cinder-api service
8b0807
+        # is running
8b0807
+        service_status = self.get_command_output(
8b0807
+            "systemctl status openstack-cinder-api.service"
8b0807
+        )
8b0807
+
8b0807
+        container_status = self.get_command_output("docker ps")
8b0807
+        in_container = False
8b0807
+        if container_status['status'] == 0:
8b0807
+            for line in container_status['output'].splitlines():
8b0807
+                if line.endswith("cinder_api"):
8b0807
+                    in_container = True
8b0807
+
8b0807
+        if (service_status['status'] == 0) or in_container:
8b0807
+            cinder_config = ""
8b0807
+            # if containerized we need to pass the config to the cont.
8b0807
+            if in_container:
8b0807
+                cinder_config = "--config-dir " + self.var_puppet_gen + \
8b0807
+                                "/etc/cinder/"
8b0807
+
8b0807
             self.add_cmd_output(
8b0807
-                "cinder-manage db version",
8b0807
-                suggest_filename="cinder_db_version")
8b0807
+                "cinder-manage " + cinder_config + " db version",
8b0807
+                suggest_filename="cinder_db_version"
8b0807
+            )
8b0807
 
8b0807
         self.add_copy_spec([
8b0807
             "/etc/cinder/",
8b0807
diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py
8b0807
index fdd789a8..4cdc6dc6 100644
8b0807
--- a/sos/plugins/openstack_glance.py
8b0807
+++ b/sos/plugins/openstack_glance.py
8b0807
@@ -54,22 +54,37 @@ class OpenStackGlance(Plugin):
8b0807
         if self.get_option("verify"):
8b0807
             self.add_cmd_output("rpm -V %s" % ' '.join(self.packages))
8b0807
 
8b0807
-        vars_all = [p in os.environ for p in [
8b0807
-                    'OS_USERNAME', 'OS_PASSWORD']]
8b0807
-
8b0807
-        vars_any = [p in os.environ for p in [
8b0807
-                    'OS_TENANT_NAME', 'OS_PROJECT_NAME']]
8b0807
-
8b0807
         # collect commands output only if the openstack-glance-api service
8b0807
         # is running
8b0807
         service_status = self.get_command_output(
8b0807
-                "systemctl status openstack-glance-api.service"
8b0807
+            "systemctl status openstack-glance-api.service"
8b0807
         )
8b0807
-        if service_status['status'] == 0:
8b0807
+
8b0807
+        container_status = self.get_command_output("docker ps")
8b0807
+        in_container = False
8b0807
+        if container_status['status'] == 0:
8b0807
+            for line in container_status['output'].splitlines():
8b0807
+                if line.endswith("cinder_api"):
8b0807
+                    in_container = True
8b0807
+
8b0807
+        if (service_status['status'] == 0) or in_container:
8b0807
+            glance_config = ""
8b0807
+            # if containerized we need to pass the config to the cont.
8b0807
+            if in_container:
8b0807
+                glance_config = "--config-dir " + self.var_puppet_gen + \
8b0807
+                                "/etc/glance/"
8b0807
+
8b0807
             self.add_cmd_output(
8b0807
-                "glance-manage db_version",
8b0807
+                "glance-manage " + glance_config + " db_version",
8b0807
                 suggest_filename="glance_db_version"
8b0807
             )
8b0807
+
8b0807
+            vars_all = [p in os.environ for p in [
8b0807
+                        'OS_USERNAME', 'OS_PASSWORD']]
8b0807
+
8b0807
+            vars_any = [p in os.environ for p in [
8b0807
+                        'OS_TENANT_NAME', 'OS_PROJECT_NAME']]
8b0807
+
8b0807
             if not (all(vars_all) and any(vars_any)):
8b0807
                 self.soslog.warning("Not all environment variables set. "
8b0807
                                     "Source the environment file for the user "
8b0807
diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py
8b0807
index de34ed15..e3395fab 100644
8b0807
--- a/sos/plugins/openstack_heat.py
8b0807
+++ b/sos/plugins/openstack_heat.py
8b0807
@@ -32,11 +32,26 @@ class OpenStackHeat(Plugin):
8b0807
 
8b0807
         # collect commands output only if the openstack-heat-api service
8b0807
         # is running
8b0807
-        service_status = self.get_command_output("systemctl status "
8b0807
-                                                 "openstack-heat-api.service")
8b0807
-        if service_status['status'] == 0:
8b0807
+        service_status = self.get_command_output(
8b0807
+            "systemctl status openstack-heat-api.service"
8b0807
+        )
8b0807
+
8b0807
+        container_status = self.get_command_output("docker ps")
8b0807
+        in_container = False
8b0807
+        if container_status['status'] == 0:
8b0807
+            for line in container_status['output'].splitlines():
8b0807
+                if line.endswith("cinder_api"):
8b0807
+                    in_container = True
8b0807
+
8b0807
+        if (service_status['status'] == 0) or in_container:
8b0807
+            heat_config = ""
8b0807
+            # if containerized we need to pass the config to the cont.
8b0807
+            if in_container:
8b0807
+                heat_config = "--config-dir " + self.var_puppet_gen + \
8b0807
+                                "_api/etc/heat/"
8b0807
+
8b0807
             self.add_cmd_output(
8b0807
-                "heat-manage db_version",
8b0807
+                "heat-manage " + heat_config + " db_version",
8b0807
                 suggest_filename="heat_db_version"
8b0807
             )
8b0807
 
8b0807
diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py
8b0807
index cdd29760..e8839a2a 100644
8b0807
--- a/sos/plugins/openstack_nova.py
8b0807
+++ b/sos/plugins/openstack_nova.py
8b0807
@@ -32,40 +32,70 @@ class OpenStackNova(Plugin):
8b0807
     var_puppet_gen = "/var/lib/config-data/puppet-generated/nova"
8b0807
 
8b0807
     def setup(self):
8b0807
-        # commands we do not need to source the environment file
8b0807
-        self.add_cmd_output("nova-manage db version")
8b0807
-        self.add_cmd_output("nova-manage fixed list")
8b0807
-        self.add_cmd_output("nova-manage floating list")
8b0807
 
8b0807
-        vars_all = [p in os.environ for p in [
8b0807
-                    'OS_USERNAME', 'OS_PASSWORD']]
8b0807
-
8b0807
-        vars_any = [p in os.environ for p in [
8b0807
-                    'OS_TENANT_NAME', 'OS_PROJECT_NAME']]
8b0807
+        # collect commands output only if the openstack-nova-api service
8b0807
+        # is running
8b0807
+        service_status = self.get_command_output(
8b0807
+            "systemctl status openstack-nova-api.service"
8b0807
+        )
8b0807
 
8b0807
-        if not (all(vars_all) and any(vars_any)):
8b0807
-            self.soslog.warning("Not all environment variables set. Source "
8b0807
-                                "the environment file for the user intended "
8b0807
-                                "to connect to the OpenStack environment.")
8b0807
-        else:
8b0807
-            self.add_cmd_output("nova service-list")
8b0807
-            self.add_cmd_output("openstack flavor list --long")
8b0807
-            self.add_cmd_output("nova network-list")
8b0807
-            self.add_cmd_output("nova list")
8b0807
-            self.add_cmd_output("nova agent-list")
8b0807
-            self.add_cmd_output("nova version-list")
8b0807
-            self.add_cmd_output("nova host-list")
8b0807
-            self.add_cmd_output("openstack quota show")
8b0807
-            self.add_cmd_output("openstack hypervisor stats show")
8b0807
-            # get details for each nova instance
8b0807
-            cmd = "openstack server list -f value"
8b0807
-            nova_instances = self.call_ext_prog(cmd)['output']
8b0807
-            for instance in nova_instances.splitlines():
8b0807
-                instance = instance.split()[0]
8b0807
-                cmd = "openstack server show %s" % (instance)
8b0807
-                self.add_cmd_output(
8b0807
-                    cmd,
8b0807
-                    suggest_filename="instance-" + instance + ".log")
8b0807
+        container_status = self.get_command_output("docker ps")
8b0807
+        in_container = False
8b0807
+        if container_status['status'] == 0:
8b0807
+            for line in container_status['output'].splitlines():
8b0807
+                if line.endswith("cinder_api"):
8b0807
+                    in_container = True
8b0807
+
8b0807
+        if (service_status['status'] == 0) or in_container:
8b0807
+            nova_config = ""
8b0807
+            # if containerized we need to pass the config to the cont.
8b0807
+            if in_container:
8b0807
+                nova_config = "--config-dir " + self.var_puppet_gen + \
8b0807
+                                "/etc/nova/"
8b0807
+
8b0807
+            self.add_cmd_output(
8b0807
+                "nova-manage " + nova_config + " db version",
8b0807
+                suggest_filename="nova-manage_db_version"
8b0807
+            )
8b0807
+            self.add_cmd_output(
8b0807
+                "nova-manage " + nova_config + " fixed list",
8b0807
+                suggest_filename="nova-manage_fixed_list"
8b0807
+            )
8b0807
+            self.add_cmd_output(
8b0807
+                "nova-manage " + nova_config + " floating list",
8b0807
+                suggest_filename="nova-manage_floating_list"
8b0807
+            )
8b0807
+
8b0807
+            vars_all = [p in os.environ for p in [
8b0807
+                        'OS_USERNAME', 'OS_PASSWORD']]
8b0807
+
8b0807
+            vars_any = [p in os.environ for p in [
8b0807
+                        'OS_TENANT_NAME', 'OS_PROJECT_NAME']]
8b0807
+
8b0807
+            if not (all(vars_all) and any(vars_any)):
8b0807
+                self.soslog.warning("Not all environment variables set. "
8b0807
+                                    "Source the environment file for the user "
8b0807
+                                    "intended to connect to the OpenStack "
8b0807
+                                    "environment.")
8b0807
+            else:
8b0807
+                self.add_cmd_output("nova service-list")
8b0807
+                self.add_cmd_output("openstack flavor list --long")
8b0807
+                self.add_cmd_output("nova network-list")
8b0807
+                self.add_cmd_output("nova list")
8b0807
+                self.add_cmd_output("nova agent-list")
8b0807
+                self.add_cmd_output("nova version-list")
8b0807
+                self.add_cmd_output("nova hypervisor-list")
8b0807
+                self.add_cmd_output("openstack quota show")
8b0807
+                self.add_cmd_output("openstack hypervisor stats show")
8b0807
+                # get details for each nova instance
8b0807
+                cmd = "openstack server list -f value"
8b0807
+                nova_instances = self.call_ext_prog(cmd)['output']
8b0807
+                for instance in nova_instances.splitlines():
8b0807
+                    instance = instance.split()[0]
8b0807
+                    cmd = "openstack server show %s" % (instance)
8b0807
+                    self.add_cmd_output(
8b0807
+                        cmd,
8b0807
+                        suggest_filename="instance-" + instance + ".log")
8b0807
 
8b0807
         self.limit = self.get_option("log_size")
8b0807
         if self.get_option("all_logs"):
8b0807
-- 
8b0807
2.13.6
8b0807
8b0807
From 404951b99d5e2e46fe0757d27b984eb5ff94cf76 Mon Sep 17 00:00:00 2001
8b0807
From: Pavel Moravec <pmoravec@redhat.com>
8b0807
Date: Wed, 8 Nov 2017 19:30:57 +0100
8b0807
Subject: [PATCH] [etcd] fix typo in etcdctl subcmds
8b0807
8b0807
subcmds variable set while "subcmd" referred instead.
8b0807
8b0807
Resolves: #1141
8b0807
8b0807
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
8b0807
---
8b0807
 sos/plugins/etcd.py | 2 +-
8b0807
 1 file changed, 1 insertion(+), 1 deletion(-)
8b0807
8b0807
diff --git a/sos/plugins/etcd.py b/sos/plugins/etcd.py
8b0807
index 4f072a4c..bd5d10d8 100644
8b0807
--- a/sos/plugins/etcd.py
8b0807
+++ b/sos/plugins/etcd.py
8b0807
@@ -40,7 +40,7 @@ class etcd(Plugin, RedHatPlugin):
8b0807
            'ls --recursive',
8b0807
         ]
8b0807
 
8b0807
-        self.add_cmd_output(['%s %s' % (self.cmd, sub) for sub in subcmd])
8b0807
+        self.add_cmd_output(['%s %s' % (self.cmd, sub) for sub in subcmds])
8b0807
 
8b0807
         urls = [
8b0807
             '/v2/stats/leader',
8b0807
-- 
8b0807
2.13.6
8b0807
8b0807
From 2140b1611565078c4a6536782c013a525722e0da Mon Sep 17 00:00:00 2001
8b0807
From: Martin Schuppert <mschuppert@redhat.com>
8b0807
Date: Thu, 21 Dec 2017 08:00:41 +0100
8b0807
Subject: [PATCH] [openstack_glance|heat|nova] fix api container names
8b0807
8b0807
Container names of glance, heat and nova api was not correct
8b0807
when verify if a the container is running.
8b0807
8b0807
Signed-off-by: Martin Schuppert <mschuppe@redhat.com>
8b0807
---
8b0807
 sos/plugins/openstack_glance.py | 2 +-
8b0807
 sos/plugins/openstack_heat.py   | 2 +-
8b0807
 sos/plugins/openstack_nova.py   | 2 +-
8b0807
 3 files changed, 3 insertions(+), 3 deletions(-)
8b0807
8b0807
diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py
8b0807
index 4cdc6dc62..d7588abe0 100644
8b0807
--- a/sos/plugins/openstack_glance.py
8b0807
+++ b/sos/plugins/openstack_glance.py
8b0807
@@ -64,7 +64,7 @@ def setup(self):
8b0807
         in_container = False
8b0807
         if container_status['status'] == 0:
8b0807
             for line in container_status['output'].splitlines():
8b0807
-                if line.endswith("cinder_api"):
8b0807
+                if line.endswith("glance_api"):
8b0807
                     in_container = True
8b0807
 
8b0807
         if (service_status['status'] == 0) or in_container:
8b0807
diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py
8b0807
index e3395fabd..0cf7c8595 100644
8b0807
--- a/sos/plugins/openstack_heat.py
8b0807
+++ b/sos/plugins/openstack_heat.py
8b0807
@@ -40,7 +40,7 @@ def setup(self):
8b0807
         in_container = False
8b0807
         if container_status['status'] == 0:
8b0807
             for line in container_status['output'].splitlines():
8b0807
-                if line.endswith("cinder_api"):
8b0807
+                if line.endswith("heat_api"):
8b0807
                     in_container = True
8b0807
 
8b0807
         if (service_status['status'] == 0) or in_container:
8b0807
diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py
8b0807
index e8839a2a6..951e69cba 100644
8b0807
--- a/sos/plugins/openstack_nova.py
8b0807
+++ b/sos/plugins/openstack_nova.py
8b0807
@@ -43,7 +43,7 @@ def setup(self):
8b0807
         in_container = False
8b0807
         if container_status['status'] == 0:
8b0807
             for line in container_status['output'].splitlines():
8b0807
-                if line.endswith("cinder_api"):
8b0807
+                if line.endswith("nova_api"):
8b0807
                     in_container = True
8b0807
 
8b0807
         if (service_status['status'] == 0) or in_container:
8b0807
From 6f5295056cbea8220407fe42159b15ea1a135e46 Mon Sep 17 00:00:00 2001
8b0807
From: Martin Schuppert <mschuppert@redhat.com>
8b0807
Date: Wed, 10 Jan 2018 20:50:46 +0100
8b0807
Subject: [PATCH] [plugins] add method to check process list for a named
8b0807
 process
8b0807
8b0807
In openstack plugins we collect data depending if processes with
8b0807
different names are there. This introduces a check_process_by_name
8b0807
Plugin method to have a consistent way to do this from any plugin
8b0807
where needed.
8b0807
8b0807
Signed-off-by: Martin Schuppert mschuppe@redhat.com
8b0807
---
8b0807
 sos/plugins/__init__.py | 16 ++++++++++++++++
8b0807
 1 file changed, 16 insertions(+)
8b0807
8b0807
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
8b0807
index 2a8bc516e..3f3a19558 100644
8b0807
--- a/sos/plugins/__init__.py
8b0807
+++ b/sos/plugins/__init__.py
8b0807
@@ -1026,6 +1026,22 @@ def report(self):
8b0807
         else:
8b0807
             return html
8b0807
 
8b0807
+    def check_process_by_name(self, process):
8b0807
+        """Checks if a named process is found in /proc/[0-9]*/cmdline.
8b0807
+        Returns either True or False."""
8b0807
+        status = False
8b0807
+        cmd_line_glob = "/proc/[0-9]*/cmdline"
8b0807
+        try:
8b0807
+            cmd_line_paths = glob.glob(cmd_line_glob)
8b0807
+            for path in cmd_line_paths:
8b0807
+                f = open(path, 'r')
8b0807
+                cmd_line = f.read().strip()
8b0807
+                if process in cmd_line:
8b0807
+                    status = True
8b0807
+        except IOError as e:
8b0807
+            return False
8b0807
+        return status
8b0807
+
8b0807
 
8b0807
 class RedHatPlugin(object):
8b0807
     """Tagging class for Red Hat's Linux distributions"""
8b0807
From 12f1c4f851c771a0173f6e00657e1a983af8451c Mon Sep 17 00:00:00 2001
8b0807
From: Martin Schuppert <mschuppert@redhat.com>
8b0807
Date: Fri, 29 Dec 2017 09:20:33 +0100
8b0807
Subject: [PATCH] [openstack_cinder] check for api service running via
8b0807
 cinder_wsgi
8b0807
8b0807
With OSP11 cinder api changed to run via https wsgi. To check for
8b0807
running cinder-manage command we also need to take this situation.
8b0807
The change checks for cinder_wsgi process.
8b0807
8b0807
Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
8b0807
---
8b0807
 sos/plugins/__init__.py         | 11 +++++++++++
8b0807
 sos/plugins/openstack_cinder.py | 27 +++++++++++++++------------
8b0807
 2 files changed, 26 insertions(+), 12 deletions(-)
8b0807
8b0807
diff --git a/sos/plugins/openstack_cinder.py b/sos/plugins/openstack_cinder.py
8b0807
index a023105c8..cc9181efa 100644
8b0807
--- a/sos/plugins/openstack_cinder.py
8b0807
+++ b/sos/plugins/openstack_cinder.py
8b0807
@@ -31,26 +31,29 @@ class OpenStackCinder(Plugin):
8b0807
 
8b0807
     def setup(self):
8b0807
 
8b0807
-        # collect commands output only if the openstack-cinder-api service
8b0807
-        # is running
8b0807
-        service_status = self.get_command_output(
8b0807
-            "systemctl status openstack-cinder-api.service"
8b0807
-        )
8b0807
+        # check if either standalone (cinder-api) or httpd wsgi (cinder_wsgi)
8b0807
+        # is up and running
8b0807
+        cinder_process = ["cinder_wsgi", "cinder-api"]
8b0807
+        in_ps = False
8b0807
+        for process in cinder_process:
8b0807
+            in_ps = self.check_process_by_name(process)
8b0807
+            if in_ps:
8b0807
+                break
8b0807
 
8b0807
         container_status = self.get_command_output("docker ps")
8b0807
         in_container = False
8b0807
+        cinder_config = ""
8b0807
         if container_status['status'] == 0:
8b0807
             for line in container_status['output'].splitlines():
8b0807
                 if line.endswith("cinder_api"):
8b0807
                     in_container = True
8b0807
+                    # if containerized we need to pass the config to the cont.
8b0807
+                    cinder_config = "--config-dir " + self.var_puppet_gen + \
8b0807
+                                    "/etc/cinder/"
8b0807
+                    break
8b0807
 
8b0807
-        if (service_status['status'] == 0) or in_container:
8b0807
-            cinder_config = ""
8b0807
-            # if containerized we need to pass the config to the cont.
8b0807
-            if in_container:
8b0807
-                cinder_config = "--config-dir " + self.var_puppet_gen + \
8b0807
-                                "/etc/cinder/"
8b0807
-
8b0807
+        # collect commands output if the standalone, wsgi or container is up
8b0807
+        if in_ps or in_container:
8b0807
             self.add_cmd_output(
8b0807
                 "cinder-manage " + cinder_config + " db version",
8b0807
                 suggest_filename="cinder_db_version"