ivandasch commented on a change in pull request #8267:
URL: https://github.com/apache/ignite/pull/8267#discussion_r493832026
##########
File path: modules/ducktests/tests/ignitetest/utils/ignite_test.py
##########
@@ -40,3 +44,49 @@ def monotonic():
so that only the difference between the results of consecutive
calls is valid.
"""
return monotonic()
+
+ def copy_ignite_workdir(self):
+ """
+ Copy work dir from service nodes to the results directory.
+
+ If the test passed, only the default set will be collected. If the the
test failed, all logs will be collected.
+ """
+ self.logger.info("copy_ignite_workdir")
+ for service in self.test_context.services:
+ if not isinstance(service, IgniteService):
+ self.test_context.logger.debug("Won't collect service workdir
from %s." %
+ service.service_id)
+ continue
+
+ if service.config.data_storage and
service.config.data_storage.default.persistent:
+ # Try to copy the service logs
+ self.test_context.logger.debug("Copying persistence dir...")
+ try:
+ for node in service.nodes:
+ dest = os.path.join(
+ TestContext.results_dir(self.test_context,
self.test_context.test_index),
+ service.service_id, node.account.hostname)
+ self.test_context.logger.debug("Dest dir " + dest)
+ if not os.path.isdir(dest):
+ mkdir_p(dest)
+
+ tgz_work = '%s.tgz' % PersistenceAware.PERSISTENT_ROOT
+
+
node.account.ssh(compress_cmd(PersistenceAware.PERSISTENT_ROOT, tgz_work))
+ node.account.copy_from(tgz_work, dest)
+ except Exception as e:
Review comment:
You should use `ex` instead of `e`, Disable warning of broad exception
using inline comment:
```
except Exception as ex: # pylint: disable=W0703
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]