def configure_node(testbed_instance, guid):
node = testbed_instance._elements[guid]
+ # Just inject configuration stuff
+ node.home_path = "nepi-node-%s" % (guid,)
+ node.ident_path = testbed_instance.sliceSSHKey
+ node.slicename = testbed_instance.slicename
+
# If we have only one candidate, simply use it
candidates = node.find_candidates(
filter_slice_id = testbed_instance.slice_id)
import operator
import rspawn
import time
+import os
class Node(object):
BASEFILTERS = {
# Testbed-derived attributes
self.slicename = None
self.ident_path = None
+ self.home_path = None
# Those are filled when an actual node is allocated
self._node_id = None
self.max_num_external_ifaces = len(info['interface_ids'])
def validate(self):
- pass
+ if self.home_path is None:
+ raise AssertionError, "Misconfigured node: missing home path"
+ if self.ident_path is None or not os.access(self.ident_path, os.R_OK):
+ raise AssertionError, "Misconfigured node: missing slice SSH key"
+ if self.slicename is None:
+ raise AssertionError, "Misconfigured node: unspecified slice"
def install_dependencies(self):
if self.required_packages: