aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/topology.py
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2016-02-17 06:59:08 -0800
committerFilip Tehlar <ftehlar@cisco.com>2016-02-17 07:01:28 -0800
commitda15035461569ea175aabbac1df735cd5598b0b3 (patch)
tree39cb6be4f0082c8032f8f455bdd2057a6403baea /resources/libraries/python/topology.py
parentda23519d72dc9415b112f7bab1fd3617750fa79e (diff)
Refactor IPv4 utils
Change-Id: Iae12444efba33e2d37b5d7beb1620e859abd84d7 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'resources/libraries/python/topology.py')
-rw-r--r--resources/libraries/python/topology.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/resources/libraries/python/topology.py b/resources/libraries/python/topology.py
index 6a7ea798cc..8b6905d7e1 100644
--- a/resources/libraries/python/topology.py
+++ b/resources/libraries/python/topology.py
@@ -647,3 +647,20 @@ class Topology(object):
'DUT1_BD_LINKS': dut1_bd_links,
'DUT2_BD_LINKS': dut2_bd_links}
return topology_links
+
+ @staticmethod
+ def is_tg_node(node):
+ """Find out whether the node is TG
+
+ :param node: node to examine
+ :return: True if node is type of TG; False otherwise
+ """
+ return node['type'] == NodeType.TG
+
+ @staticmethod
+ def get_node_hostname(node):
+ """
+ :param node: node dictionary
+ :return: host name as 'str' type
+ """
+ return node['host'] \ No newline at end of file