summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2013-05-03 13:40:54 -0500
committerGeorge Kraft <george.kraft@calxeda.com>2013-05-03 13:40:54 -0500
commit3656128eed018e8e225b1acd49c6d73af30abf51 (patch)
tree9b40b64881045348ba90b9508310112668197137
parentcd8d7018844bca8c764b4122c0857de7b361cf65 (diff)
downloadcxmanage-3656128eed018e8e225b1acd49c6d73af30abf51.tar.gz
Node: Remove "fabric" from many of the method names
To align them with the method names in the Fabric class. In general, Node methods should have "fabric" in the name if it applies to all the nodes in the fabric, i.e. get_fabric_ipinfo which returns IP addresses for ALL the nodes.
-rw-r--r--cxmanage_api/fabric.py8
-rw-r--r--cxmanage_api/node.py8
-rw-r--r--cxmanage_test/fabric_test.py30
-rw-r--r--cxmanage_test/node_test.py24
4 files changed, 35 insertions, 35 deletions
diff --git a/cxmanage_api/fabric.py b/cxmanage_api/fabric.py
index be93c0d..3a7b2b9 100644
--- a/cxmanage_api/fabric.py
+++ b/cxmanage_api/fabric.py
@@ -837,7 +837,7 @@ class Fabric(object):
:rtype: dictionary
"""
- return self._run_on_all_nodes(async, "get_fabric_link_stats", link)
+ return self._run_on_all_nodes(async, "get_link_stats", link)
def get_linkmap(self, async=False):
"""Get the linkmap for each node in the fabric.
@@ -850,7 +850,7 @@ class Fabric(object):
:rtype: dectionary
"""
- return self._run_on_all_nodes(async, "get_fabric_linkmap")
+ return self._run_on_all_nodes(async, "get_linkmap")
def get_routing_table(self, async=False):
"""Get the routing_table for the fabric.
@@ -863,7 +863,7 @@ class Fabric(object):
:rtype: dictionary
"""
- return self._run_on_all_nodes(async, "get_fabric_routing_table")
+ return self._run_on_all_nodes(async, "get_routing_table")
def get_depth_chart(self, async=False):
"""Get the depth_chart for the fabric.
@@ -876,7 +876,7 @@ class Fabric(object):
:rtype: dictionary
"""
- return self._run_on_all_nodes(async, "get_fabric_depth_chart")
+ return self._run_on_all_nodes(async, "get_depth_chart")
def _run_on_all_nodes(self, async, name, *args):
"""Start a command on all nodes."""
diff --git a/cxmanage_api/node.py b/cxmanage_api/node.py
index dcab895..9ccae97 100644
--- a/cxmanage_api/node.py
+++ b/cxmanage_api/node.py
@@ -1012,7 +1012,7 @@ class Node(object):
return results
- def get_fabric_link_stats(self, link=0):
+ def get_link_stats(self, link=0):
"""Gets the linkstats for the link specified.
:param link: The link to get stats for (0-4).
@@ -1049,7 +1049,7 @@ class Node(object):
return results
- def get_fabric_linkmap(self):
+ def get_linkmap(self):
"""Gets the src and destination of each link on a node.
:return: Returns a map of link_id->node_id.
@@ -1080,7 +1080,7 @@ class Node(object):
return results
- def get_fabric_routing_table(self):
+ def get_routing_table(self):
"""Gets the routing table as instantiated in the fabric switch.
:return: Returns a map of node_id->rt_entries.
@@ -1113,7 +1113,7 @@ class Node(object):
return results
- def get_fabric_depth_chart(self):
+ def get_depth_chart(self):
"""Gets a table indicating the distance from a given node to all other
nodes on each fabric link.
diff --git a/cxmanage_test/fabric_test.py b/cxmanage_test/fabric_test.py
index db6d466..fb234c5 100644
--- a/cxmanage_test/fabric_test.py
+++ b/cxmanage_test/fabric_test.py
@@ -273,28 +273,28 @@ class FabricTest(unittest.TestCase):
def test_get_link_stats(self):
"""Test the get_link_stats() method."""
- stats = self.fabric.get_link_stats()
- for nn, node in self.fabric.nodes.items():
- for i in range(0, 5):
- self.assertIn(('get_fabric_link_stats', i), node.executed)
+ for i in range(0, 5):
+ stats = self.fabric.get_link_stats(i)
+ for nn, node in self.fabric.nodes.items():
+ self.assertIn(('get_link_stats', i), node.executed)
def test_get_linkmap(self):
"""Test the get_linkmap method"""
maps = self.fabric.get_linkmap()
for nn, node in self.fabric.nodes.items():
- self.assertIn('get_fabric_linkmap', node.executed)
+ self.assertIn('get_linkmap', node.executed)
def test_get_routing_table(self):
"""Test the get_routing_table method"""
maps = self.fabric.get_routing_table()
for nn, node in self.fabric.nodes.items():
- self.assertIn('get_fabric_routing_table', node.executed)
+ self.assertIn('get_routing_table', node.executed)
def test_get_depth_chart(self):
"""Test the depth_chart method"""
maps = self.fabric.get_depth_chart()
for nn, node in self.fabric.nodes.items():
- self.assertIn('get_fabric_depth_chart', node.executed)
+ self.assertIn('get_depth_chart', node.executed)
def test_get_link_users_factor(self):
"""Test the get_link_users_factor method
@@ -456,8 +456,8 @@ class DummyNode(object):
results[n] = {'eth0': 0, 'eth1': 0, 'mgmt': 0}
return results
- def get_fabric_link_stats(self, link=0):
- self.executed.append(('get_fabric_link_stats', link))
+ def get_link_stats(self, link=0):
+ self.executed.append(('get_link_stats', link))
return {
'FS_LC%s_BYTE_CNT_0' % link: '0x0',
'FS_LC%s_BYTE_CNT_1' % link: '0x0',
@@ -480,15 +480,15 @@ class DummyNode(object):
'FS_LC%s_TPKTSCNT' % link: '0x1'
}
- def get_fabric_linkmap(self):
- self.executed.append('get_fabric_linkmap')
+ def get_linkmap(self):
+ self.executed.append('get_linkmap')
results = {}
for n in range(0, NUM_NODES):
results[n] = {n: {1: 2, 3: 1, 4: 3}}
return results
- def get_fabric_routing_table(self):
- self.executed.append('get_fabric_routing_table')
+ def get_routing_table(self):
+ self.executed.append('get_routing_table')
results = {}
for n in range(0, NUM_NODES):
results[n] = {n: {1: [0, 0, 0, 3, 0],
@@ -496,8 +496,8 @@ class DummyNode(object):
3: [0, 2, 0, 0, 3]}}
return results
- def get_fabric_depth_chart(self):
- self.executed.append('get_fabric_depth_chart')
+ def get_depth_chart(self):
+ self.executed.append('get_depth_chart')
results = {}
for n in range(0, NUM_NODES):
results[n] = {n: {1: {'shortest': (0, 0)},
diff --git a/cxmanage_test/node_test.py b/cxmanage_test/node_test.py
index 29ecbfe..d5d9445 100644
--- a/cxmanage_test/node_test.py
+++ b/cxmanage_test/node_test.py
@@ -315,34 +315,34 @@ class NodeTest(unittest.TestCase):
for x in node.bmc.executed:
self.assertEqual(x, "fabric_config_get_uplink_info")
- def test_get_fabric_linkmap(self):
- """ Test node.get_fabric_linkmap method """
+ def test_get_linkmap(self):
+ """ Test node.get_linkmap method """
for node in self.nodes:
- result = node.get_fabric_linkmap()
+ result = node.get_linkmap()
for x in node.bmc.executed:
self.assertEqual(x, "fabric_info_get_link_map")
- def test_get_fabric_routing_table(self):
- """ Test node.get_fabric_routing_table method """
+ def test_get_routing_table(self):
+ """ Test node.get_routing_table method """
for node in self.nodes:
- result = node.get_fabric_routing_table()
+ result = node.get_routing_table()
for x in node.bmc.executed:
self.assertEqual(x, "fabric_info_get_routing_table")
- def test_get_fabric_depth_chart(self):
- """ Test node.get_fabric_depth_chart method """
+ def test_get_depth_chart(self):
+ """ Test node.get_depth_chart method """
for node in self.nodes:
- result = node.get_fabric_depth_chart()
+ result = node.get_depth_chart()
for x in node.bmc.executed:
self.assertEqual(x, "fabric_info_get_depth_chart")
- def test_get_fabric_link_stats(self):
- """ Test node.get_fabric_link_stats() """
+ def test_get_link_stats(self):
+ """ Test node.get_link_stats() """
for node in self.nodes:
- result = node.get_fabric_link_stats()
+ result = node.get_link_stats()
self.assertEqual(node.bmc.executed[0], ('fabric_get_linkstats', 0))
def test_get_server_ip(self):