In deprecated HostAPI methods get_ip and get_prefix we had default
IP address index set to 0, so calling get_ip(iface) would return
first IP address assigned to the interface.
This patch adds this functionality to InterfaceAPI methods get_ip and
get_prefix so calling iface.get_ip() will return first IP address assigned
to that interface.
Also InterfaceAPI methods get_ip_addr and get_ip_prefix are patched, but
they are now marked as deprecated.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/Task.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index 49ea816..01aadab 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -374,25 +374,25 @@ class InterfaceAPI(object):
def get_hwaddr(self):
return VolatileValue(self._if.get_hwaddr)
- def get_ip(self, ip_index):
+ def get_ip(self, ip_index=0):
return VolatileValue(self._if.get_address, ip_index)
def get_ips(self):
return VolatileValue(self._if.get_addresses)
@deprecated
- def get_ip_addr(self, ip_index):
+ def get_ip_addr(self, ip_index=0):
return self.get_ip(ip_index)
@deprecated
def get_ip_addrs(self):
return self.get_ips()
- def get_prefix(self, ip_index):
+ def get_prefix(self, ip_index=0):
return VolatileValue(self._if.get_prefix, ip_index)
@deprecated
- def get_ip_prefix(self, ip_index):
+ def get_ip_prefix(self, ip_index=0):
return self.get_prefix(ip_index)
def get_mtu(self):
--
2.4.3
Show replies by thread