diff options
Diffstat (limited to 'odl-pipeline/lib/utils/node_manager.py')
-rwxr-xr-x | odl-pipeline/lib/utils/node_manager.py | 10 |
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 |