X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2Fnepi%2Fcore%2Fexecute.py;h=b89d7605c39ae6d1ab0472333d117dd2e877b82d;hb=67a5d232414a375c224e06058fbef0ae63be58c9;hp=a657c5356cd3cb5cb7576569ec22080aa2032f51;hpb=17c85d161444f91bc5a34eea4c4a150fe3927f4b;p=nepi.git diff --git a/src/nepi/core/execute.py b/src/nepi/core/execute.py index a657c535..cf32e6a4 100644 --- a/src/nepi/core/execute.py +++ b/src/nepi/core/execute.py @@ -3,225 +3,1159 @@ from nepi.core.attributes import Attribute, AttributesMap from nepi.util import validation +from nepi.util.constants import ApplicationStatus as AS, TestbedStatus as TS, TIME_NOW, DeploymentConfiguration as DC +from nepi.util.parser._xml import XmlExperimentParser import sys +import re +import threading +import ConfigParser +import os +import collections +import functools +import time +import logging +logging.basicConfig() -class ConnectorType(object): - def __init__(self, testbed_id, factory_id, name, max = -1, min = 0): - super(ConnectorType, self).__init__() - if max == -1: - max = sys.maxint - elif max <= 0: - raise RuntimeError( - "The maximum number of connections allowed need to be more than 0") - if min < 0: - raise RuntimeError( - "The minimum number of connections allowed needs to be at least 0") - # connector_type_id -- univoquely identifies a connector type - # across testbeds - self._connector_type_id = (testbed_id.lower(), factory_id.lower(), - name.lower()) - # name -- display name for the connector type - self._name = name - # max -- maximum amount of connections that this type support, - # -1 for no limit - self._max = max - # min -- minimum amount of connections required by this type of connector - self._min = min - # from_connections -- connections where the other connector is the "From" - # to_connections -- connections where the other connector is the "To" - # keys in the dictionary correspond to the - # connector_type_id for possible connections. The value is a tuple: - # (can_cross, connect) - # can_cross: indicates if the connection is allowed accros different - # testbed instances - # code: is the connection function to be invoked when the elements - # are connected - self._from_connections = dict() - self._to_connections = dict() +ATTRIBUTE_PATTERN_BASE = re.compile(r"\{#\[(?P