summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolodymyr Shypyguzov <vshypyguzov@mirantis.com>2016-11-24 17:27:58 +0200
committerVolodymyr Shypyguzov <vshypyguzov@mirantis.com>2016-11-24 15:33:50 +0000
commit27e62c6f13fb0e9f204f6832fa3641bac5c0635e (patch)
treed1d8dba0ae3e39e30ca03bac15445c87c386e55e
parente1d0e06d99c24fb83c5a51d6f2b893562a94ba75 (diff)
Catch devops error if inspecting containers goes wrong
In case something is wrong with inspecting containers catch DevopsError instead of failing whole deployment Change-Id: Ib4888c30c6b1dcae8d6094f769246fac6b41e164
Notes
Notes (review): Verified+1: Mirantis CCP CI <mirantis-fuel-ccp-ci@mirantis.com> Code-Review+2: tatyana-leontovich <tleontovich@mirantis.com> Code-Review+1: Artem Panchenko <apanchenko@mirantis.com> Workflow+1: Artem Panchenko <apanchenko@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 24 Nov 2016 20:55:18 +0000 Reviewed-on: https://review.openstack.org/402098 Project: openstack/fuel-ccp-tests Branch: refs/heads/master
-rw-r--r--fuel_ccp_tests/helpers/post_install_k8s_checks.py29
1 files changed, 17 insertions, 12 deletions
diff --git a/fuel_ccp_tests/helpers/post_install_k8s_checks.py b/fuel_ccp_tests/helpers/post_install_k8s_checks.py
index ce37343..f71c312 100644
--- a/fuel_ccp_tests/helpers/post_install_k8s_checks.py
+++ b/fuel_ccp_tests/helpers/post_install_k8s_checks.py
@@ -16,6 +16,7 @@ import re
16import json 16import json
17 17
18from devops.helpers import helpers 18from devops.helpers import helpers
19from devops.error import DevopsError
19 20
20from fuel_ccp_tests import logger 21from fuel_ccp_tests import logger
21 22
@@ -75,15 +76,19 @@ def inspect_docker_containers(image_name, underlay, host_ip):
75 if result: 76 if result:
76 LOG.info("Inspecting running containers with name={name}: on: {node}". 77 LOG.info("Inspecting running containers with name={name}: on: {node}".
77 format(name=image_name, node=host_ip)) 78 format(name=image_name, node=host_ip))
78 for container in result.stdout_json: 79 try:
79 raw_out = container['Config']['Labels'] 80 for container in result.stdout_json:
80 labels = json.dumps( 81 raw_out = container['Config']['Labels']
81 raw_out, 82 labels = json.dumps(
82 indent=4, 83 raw_out,
83 separators=(',', ': '), 84 indent=4,
84 sort_keys=True 85 separators=(',', ': '),
85 ) 86 sort_keys=True
86 LOG.info("Docker container {name} Labels: {labels}".format( 87 )
87 name=container['Name'], 88 LOG.info("Docker container {name} Labels: {labels}".format(
88 labels=labels) 89 name=container['Name'],
89 ) 90 labels=labels)
91 )
92 except DevopsError:
93 LOG.info("{} stdout is not a valid json. Stdout:{}".format(
94 cmd, result.stdout))