anton-vinogradov commented on a change in pull request #8522:
URL: https://github.com/apache/ignite/pull/8522#discussion_r570873894
##########
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:
Why do we want to reduce this helper's scope only to IgniteService, not
to all IgniteAwares?
Seems, this will be a good case to have the same feature at
IgniteApplicationService, especially considering the relocation price is 0?
----------------------------------------------------------------
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]