summaryrefslogtreecommitdiffstats
path: root/odl-pipeline/lib/utils/node_manager.py
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2017-01-12 12:27:41 -0500
committerTim Rozet <trozet@redhat.com>2017-01-30 14:36:24 -0500
commitc7cbf47421382ef5db5ad8a2f470def52640b21f (patch)
tree78474dd4298b163b7816e038533f50a586df9e8c /odl-pipeline/lib/utils/node_manager.py
parentced7ceab968ee2542b5d4d4255195d971aa61fea (diff)
Updates ODL Pipeline scripts for CSIT
Changes Include: - Change to TripleOInspector which only introspect a current Apex deployment and dump yaml config to be bundled with snapshots. - Add TripleOHelper which consists of all tripleO helper functions. Many this are done to virsh so the idea is to have at. Some point in time a libvirtHelper, or use another libvirt python lib. Thatsway it is a class so that we can inherit later on. - New argument for passing the SSH private key to use to connect to nodes is added to the service utils. - Some general clean up and consolidation of logic JIRA: APEX-363 Change-Id: I792db0fac3f4e81969fe85c05fc298fe5af02537 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'odl-pipeline/lib/utils/node_manager.py')
-rwxr-xr-xodl-pipeline/lib/utils/node_manager.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/odl-pipeline/lib/utils/node_manager.py b/odl-pipeline/lib/utils/node_manager.py
index d11065f..8a320ed 100755
--- a/odl-pipeline/lib/utils/node_manager.py
+++ b/odl-pipeline/lib/utils/node_manager.py
@@ -17,14 +17,15 @@ class NodeManager(object):
primary_controller = None
def __init__(self, config=None):
- if config:
+ if config is not None:
for (node_name, node_config) in config.iteritems():
self.add_node(node_name, node_config)
def add_node(self, node_name, node_config):
from node import Node
if not node_config.get('address'):
- node_config['address'] = self.get_address_of_node(node_name)
+ raise NodeManagerException("IP address missing from node_config:"
+ " {}".format(node_config))
node = Node(node_name, dict=node_config)
self.env_nodes.append(node)
self.env_node_dict[node_name] = node
@@ -41,3 +42,8 @@ class NodeManager(object):
if node not in cls.env_nodes:
cls.env_nodes.append(node)
SshUtil.gen_ssh_config(cls.env_nodes)
+
+
+class NodeManagerException(Exception):
+ def __init__(self, value):
+ self.value = value