aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Talerico <jtaleric@redhat.com>2018-11-15 17:09:07 -0500
committerBryn M. Reeves <bmr@redhat.com>2019-03-19 11:46:25 +0000
commit9270f871016fa6c6c8450949b96c842dfcfbbeb2 (patch)
tree0a5f7ebcb669768ebe6dd35933be74eadc6c3684
parentd65099fde910102a8ef47e86a32418797a55345e (diff)
downloadsos-9270f871016fa6c6c8450949b96c842dfcfbbeb2.tar.gz
[openstack_instack] Support for multiple stacks
The OpenStack undercloud can support > 1 stack. This patch will iterate through all the possible stacks deployed on the undercloud. Signed-off-by: Joe Talerico <rook@redhat.com>
-rw-r--r--sos/plugins/openstack_instack.py48
1 files changed, 26 insertions, 22 deletions
diff --git a/sos/plugins/openstack_instack.py b/sos/plugins/openstack_instack.py
index 37a75e02..4fa21699 100644
--- a/sos/plugins/openstack_instack.py
+++ b/sos/plugins/openstack_instack.py
@@ -11,6 +11,7 @@
from sos.plugins import Plugin, RedHatPlugin
import os
+import re
NON_CONTAINERIZED_DEPLOY = [
@@ -62,29 +63,32 @@ class OpenStackInstack(Plugin):
"the environment file for the user intended "
"to connect to the OpenStack environment.")
else:
+ # capture all the possible stack uuids
+ get_stacks = "openstack stack list"
+ stacks = self.call_ext_prog(get_stacks)['output']
+ stack_ids = re.findall(r'(\s(\w+-\w+)+\s)', stacks)
# get status of overcloud stack and resources
- self.add_cmd_output("openstack stack show overcloud")
- self.add_cmd_output(
- "openstack stack resource list -n 10 overcloud",
- timeout=600)
-
- # get details on failed deployments
- cmd = "openstack stack resource list -f value -n 5 overcloud"
- deployments = self.call_ext_prog(cmd, timeout=600)['output']
- for deployment in deployments.splitlines():
- if 'FAILED' in deployment:
- check = [
- "OS::Heat::StructuredDeployment",
- "OS::Heat::SoftwareDeployment"]
- if any(x in deployment for x in check):
- deployment = deployment.split()[1]
- cmd = "openstack software deployment show " \
- "--long %s" % (deployment)
- self.add_cmd_output(
- cmd,
- suggest_filename="failed-deployment-" +
- deployment + ".log",
- timeout=600)
+ for sid in stack_ids:
+ self.add_cmd_output("openstack stack show %s" % sid[0])
+ self.add_cmd_output(
+ "openstack stack resource list -n 10 %s" % sid[0])
+
+ # get details on failed deployments
+ cmd = "openstack stack resource list -f value -n 5 %s" % sid[0]
+ deployments = self.call_ext_prog(cmd)['output']
+ for deployment in deployments.splitlines():
+ if 'FAILED' in deployment:
+ check = [
+ "OS::Heat::StructuredDeployment",
+ "OS::Heat::SoftwareDeployment"]
+ if any(x in deployment for x in check):
+ deploy = deployment.split()[1]
+ cmd = "openstack software deployment " \
+ "show --long %s" % (deployment)
+ fname = "failed-deployment-%s.log" % deploy
+ self.add_cmd_output(
+ cmd,
+ suggest_filename=fname)
self.add_cmd_output("openstack object save "
"tripleo-ui-logs tripleo-ui.logs --file -")