Fri, May 31, 2019 at 11:28:03AM CEST, olichtne(a)redhat.com wrote:
From: Ondrej Lichtner <olichtne(a)redhat.com>
Moving the device related rpc_calls from the RemoteDevice class into the
Machine class which already provides abstractions for all the other rpc
calls that we do. It's also a good place to organize the creation of
Device related event results and add them to the current run log of the
recipe.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/Machine.py | 56 ++++++++++++++++++++++++++++++++++--
lnst/Devices/RemoteDevice.py | 19 ++++++------
2 files changed, 61 insertions(+), 14 deletions(-)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index a74b5a9..5fd5c88 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -20,7 +20,7 @@
from lnst.Common.Version import lnst_version
from lnst.Controller.Common import ControllerError
from lnst.Controller.CtlSecSocket import CtlSecSocket
-from lnst.Controller.RecipeResults import JobStartResult, JobFinishResult
+from lnst.Controller.RecipeResults import JobStartResult, JobFinishResult,
DeviceCreateResult, DeviceMethodCallResult, DeviceAttrSetResult
from lnst.Controller.SlaveObject import SlaveObject
from lnst.Devices import device_classes
from lnst.Devices.Device import Device
@@ -121,6 +121,14 @@ def remote_device_create(self, dev, netns=None):
dev_clsname = dev._dev_cls.__name__
dev_args = dev._dev_args
dev_kwargs = dev._dev_kwargs
+
+ self._add_recipe_result(
+ DeviceCreateResult(
+ success=True,
+ device=dev,
^^^^^
What's the meaning of this trailing comma?
>+ )
>+ )
>+
> ret = self.rpc_call("create_device", clsname=dev_clsname,
> args=dev_args,
> kwargs=dev_kwargs,