candidates = set(filter(predicate, candidates))
# make sure hostnames are resolvable
- hostnames = None
+ hostnames = dict()
if candidates:
self._logger.info(" Found %s candidates. Checking for reachability...", len(candidates))
# -*- coding: utf-8 -*-
+
+import logging
+
from nepi.util.parser import sfa
###
self._slice_nodes = set()
self._all_nodes = dict()
self._slice_id = slice_id
+
+ self._logger = logging.getLogger('nepi.utils.sfiapi')
+
self.FetchSliceInfo()
def FetchSliceInfo(self):
p = sfa.SFAResourcesParser()
import commands
xml = commands.getoutput("sfi.py resources")
- self._all_nodes = p.resources_from_xml(xml)
- xml = commands.getoutput("sfi.py resources %s" % self._slice_id)
- self._slice_tags, self._slice_nodes = p.slice_info_from_xml(xml)
+ try:
+ self._all_nodes = p.resources_from_xml(xml)
+ xml = commands.getoutput("sfi.py resources %s" % self._slice_id)
+ self._slice_tags, self._slice_nodes = p.slice_info_from_xml(xml)
+ except:
+ self._logger.error("Error in SFA responds: %s", xml)
+ raise
def GetSliceNodes(self, slicename):
return list(self._slice_nodes)
pl_desc.set_attribute_value("tapPortBase", self.port_base)
pl_desc.set_attribute_value("p2pDeployment", False) # it's interactive, we don't want it in tests
pl_desc.set_attribute_value("dedicatedSlice", True)
- #pl_desc.set_attribute_value("plLogLevel", "DEBUG")
+ pl_desc.set_attribute_value("plLogLevel", "DEBUG")
if use_sfa:
pl_desc.set_attribute_value("sfa", True)
pl_desc.set_attribute_value("sliceHrn", self.slicehrn)
inst_root_dir = os.path.join(self.root_dir, "instance")
os.mkdir(inst_root_dir)
pl.set_attribute_value(DC.ROOT_DIRECTORY, inst_root_dir)
- #pl.set_attribute_value(DC.LOG_LEVEL, DC.DEBUG_LEVEL)
+ pl.set_attribute_value(DC.LOG_LEVEL, DC.DEBUG_LEVEL)
if environ:
pl.set_attribute_value(DC.DEPLOYMENT_ENVIRONMENT_SETUP, environ)
inst_root_dir = os.path.join(self.root_dir, "instance")
os.mkdir(inst_root_dir)
pl.set_attribute_value(DC.ROOT_DIRECTORY, inst_root_dir)
- #pl.set_attribute_value(DC.LOG_LEVEL, DC.DEBUG_LEVEL)
+ pl.set_attribute_value(DC.LOG_LEVEL, DC.DEBUG_LEVEL)
if environ:
pl.set_attribute_value(DC.DEPLOYMENT_ENVIRONMENT_SETUP, environ)
pl_desc.set_attribute_value("tapPortBase", self.port_base)
pl_desc.set_attribute_value("p2pDeployment", False) # it's interactive, we don't want it in tests
pl_desc.set_attribute_value("dedicatedSlice", True)
- #pl_desc.set_attribute_value("plLogLevel", "DEBUG")
+ pl_desc.set_attribute_value("plLogLevel", "DEBUG")
pl_desc2 = exp_desc.add_testbed_description(pl_provider)
pl_desc2.set_attribute_value("homeDirectory", self.root_dir+"v2")
pl_desc2.set_attribute_value("tapPortBase", self.port_base+500)
pl_desc2.set_attribute_value("p2pDeployment", False) # it's interactive, we don't want it in tests
pl_desc2.set_attribute_value("dedicatedSlice", True)
- #pl_desc2.set_attribute_value("plLogLevel", "DEBUG")
+ pl_desc2.set_attribute_value("plLogLevel", "DEBUG")
return pl_desc, pl_desc2, exp_desc