Vladsz83 commented on a change in pull request #8522:
URL: https://github.com/apache/ignite/pull/8522#discussion_r570809855
##########
File path: modules/ducktests/tests/ignitetest/services/ignite.py
##########
@@ -90,3 +91,19 @@ def get_event_time(service, log_node, log_pattern,
from_the_beginning=True, time
return datetime.strptime(re.match("^\\[[^\\[]+\\]",
stdout.read().decode("utf-8")).group(),
"[%Y-%m-%d %H:%M:%S,%f]")
+
+
+def exec_command(node, cmd):
+ """Executes the command passed on the given node and returns result as
string."""
+ return str(node.account.ssh_client.exec_command(cmd)[1].read(),
sys.getdefaultencoding())
+
+
+def node_id(node):
+ """
+ Returns node id from its log if started.
+ This is a remote call. Reuse its results if possible.
+ """
+ regexp = "^>>> Local node \\[ID=([^,]+),.+$"
+ cmd = "grep -E '%s' %s | sed -r 's/%s/\\1/'" % (regexp, node.log_file,
regexp)
+
+ return exec_command(node, cmd).strip().lower()
Review comment:
Because they are 'static' helpers not binded to any instanse. Is it ok?
----------------------------------------------------------------
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]