From 7963f205ce2ff9184c60a313633b99b4cd13194b Mon Sep 17 00:00:00 2001 From: "OTSUKA, Yuanying" Date: Thu, 21 Jul 2016 16:01:21 +0900 Subject: [PATCH] Fix copying logs from nodes `_get_nodes_from_stack` will be never called because `_get_nodes_from_bay` always return un-empty list if master_addresses and node_addresses are None. So we can't get logs unless bay is succeeded to create. This patch fixes this issue, so we can get node logs if bay is not create completed. Change-Id: I6e518359d08cf06e95adc0b324c934c8f3e0c27d Closes-Bug: #1605092 --- magnum/tests/functional/common/base.py | 3 +++ magnum/tests/functional/python_client_base.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/magnum/tests/functional/common/base.py b/magnum/tests/functional/common/base.py index b03894336c..9f3c8d3f6c 100644 --- a/magnum/tests/functional/common/base.py +++ b/magnum/tests/functional/common/base.py @@ -58,6 +58,9 @@ class BaseMagnumTest(base.BaseTestCase): full_location = os.path.join(base_path, COPY_LOG_HELPER) def do_copy_logs(prefix, nodes_address): + if not nodes_address: + return + cls.LOG.info("copy logs from : %s" % ','.join(nodes_address)) log_name = prefix + "-" + func_name diff --git a/magnum/tests/functional/python_client_base.py b/magnum/tests/functional/python_client_base.py index 150afbeebf..6fc747b82e 100644 --- a/magnum/tests/functional/python_client_base.py +++ b/magnum/tests/functional/python_client_base.py @@ -274,9 +274,12 @@ extendedKeyUsage = clientAuth def _get_nodes(self): nodes = self._get_nodes_from_bay() - if not nodes: + if not [x for x in nodes if x]: self.LOG.info("the list of nodes from bay is empty") nodes = self._get_nodes_from_stack() + if not [x for x in nodes if x]: + self.LOG.info("the list of nodes from stack is empty") + self.LOG.info("Nodes are: %s" % nodes) return nodes def _get_nodes_from_bay(self):