From: Ondrej Lichtner <olichtne(a)redhat.com>
You can now set a Device (RemoteDevice on the Controller) objects as
values for IpParameters. This will get the ip address list of the Device
and use the first address as the value for the IpParam object.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/Parameters.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lnst/Common/Parameters.py b/lnst/Common/Parameters.py
index aa037eb..1b4ac85 100644
--- a/lnst/Common/Parameters.py
+++ b/lnst/Common/Parameters.py
@@ -16,6 +16,7 @@ olichtne(a)redhat.com (Ondrej Lichtner)
from lnst.Common.IpAddress import BaseIpAddress, IpAddress
from lnst.Common.LnstError import LnstError
+from lnst.Devices.RemoteDevice import RemoteDevice
class ParamError(LnstError):
pass
@@ -73,6 +74,8 @@ class IpParam(Param):
self.val = value
elif isinstance(value, str):
self.val = IpAddress(str)
+ elif isinstance(value, RemoteDevice):
+ self.val = value.ips[0]
else:
raise ParamError("Value must be a BaseIpAddress or string
object.")
self.set = True
--
2.12.2