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
This commit is contained in:
OTSUKA, Yuanying 2016-07-21 16:01:21 +09:00
parent cb06efa809
commit 7963f205ce
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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):