closes #78
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/Task.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index 0aa3d1a..27ba801 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -250,6 +250,22 @@ class HostAPI(object):
iface = self._interfaces[interface_id]
return iface.get_ip_addr(addr_number)
+ def get_all_ips(self, interface_id):
+ """
+ Returns list of all IP addresses of the interface.
+
+ :param interface_id: which interface
+ :type interface_id: string
+
+ :return: list of IP addresses (e.g., ['192.168.1.10',
'2001::10']).
+ :rtype: list of strings
+ """
+ iface = self._interfaces[interface_id]
+ res = []
+ for ip, prefix in iface.get_ip_addrs().get_val():
+ res.append(ip)
+ return res
+
def get_prefix(self, interface_id, addr_number=0):
"""
Returns an IP address prefix (netmask)
--
2.1.0
Show replies by thread