From: Ondrej Lichtner olichtne@redhat.com
Adding the result before calling the method leads to printing a "live log" line that says that the action is a "PASS", but the method wasn't called yet.
Changing the result to False after the method call is therefore only visible in the Result Summary logs, which can lead to confusing PASS/FAIL situations when a tester sees the PASS in live logs, but FAIL in summary for the same action.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com --- lnst/Controller/Machine.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py index 6c6f8d1..e95e58b 100644 --- a/lnst/Controller/Machine.py +++ b/lnst/Controller/Machine.py @@ -148,7 +148,6 @@ class Machine(object): args=args, kwargs=kwargs, ) - self._add_recipe_result(config_res)
try: res = self.rpc_call("dev_method", index, method_name, args, kwargs, @@ -156,6 +155,8 @@ class Machine(object): except: config_res.success = False raise + finally: + self._add_recipe_result(config_res) return res
def remote_device_setattr(self, index, attr_name, value, netns):
On Wed, Oct 23, 2019 at 04:06:14PM +0200, olichtne@redhat.com wrote:
From: Ondrej Lichtner olichtne@redhat.com
Adding the result before calling the method leads to printing a "live log" line that says that the action is a "PASS", but the method wasn't called yet.
Changing the result to False after the method call is therefore only visible in the Result Summary logs, which can lead to confusing PASS/FAIL situations when a tester sees the PASS in live logs, but FAIL in summary for the same action.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com
lnst/Controller/Machine.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py index 6c6f8d1..e95e58b 100644 --- a/lnst/Controller/Machine.py +++ b/lnst/Controller/Machine.py @@ -148,7 +148,6 @@ class Machine(object): args=args, kwargs=kwargs, )
self._add_recipe_result(config_res) try: res = self.rpc_call("dev_method", index, method_name, args, kwargs,
@@ -156,6 +155,8 @@ class Machine(object): except: config_res.success = False raise
finally:
self._add_recipe_result(config_res) return res
def remote_device_setattr(self, index, attr_name, value, netns):
-- 2.23.0
pushed upstream.
-Ondrej
lnst-developers@lists.fedorahosted.org