Exemple #1
0
def runtime(uri, control_uri, attributes=None, dispatch=False):
    from calvin.utilities.nodecontrol import dispatch_node, start_node
    kwargs = {'attributes': attributes} if attributes else {}
    if dispatch:
        return dispatch_node(uri=uri, control_uri=control_uri, **kwargs)
    else:
        start_node(uri, control_uri, **kwargs)
Exemple #2
0
def runtime(uri, control_uri, attributes=None, dispatch=False):
    from calvin.utilities.nodecontrol import dispatch_node, start_node
    kwargs = {'attributes': attributes} if attributes else {}
    if dispatch:
        return dispatch_node(uri=uri, control_uri=control_uri, **kwargs)
    else:
        start_node(uri, control_uri, **kwargs)
def test_start_node(create_node, create_tracing_node):
    nodecontrol.start_node(URI, CONTROL_URI, attributes={'a': 1})
    create_node.assert_called_with(URI, CONTROL_URI, {'a': 1})
    assert not create_tracing_node.called

    create_node.reset_mock()
    nodecontrol.start_node(URI, CONTROL_URI, trace=True, attributes={'a': 1})
    create_tracing_node.assert_called_with(URI, CONTROL_URI, True, {'a': 1})
    assert not create_node.called
Exemple #4
0
def runtime(uris, control_uri, attributes=None, dispatch=False):
    from calvin.utilities.nodecontrol import dispatch_node, start_node
    kwargs = {'attributes': attributes} if attributes else {}
    try:
        if dispatch:
            return dispatch_node(uris=uris, control_uri=control_uri, **kwargs)
        else:
            start_node(uris, control_uri, **kwargs)
    except Exception as e:
        print "Starting runtime failed:", e
        raise
def runtime(uris, control_uri, attributes=None, dispatch=False):
    from calvin.utilities.nodecontrol import dispatch_node, start_node
    kwargs = {'attributes': attributes} if attributes else {}
    try:
        if dispatch:
            return dispatch_node(uris=uris, control_uri=control_uri, **kwargs)
        else:
            start_node(uris, control_uri, **kwargs)
    except Exception as e:
        print "Starting runtime failed:", e
        raise
Exemple #6
0
def runtime(uri, control_uri, attributes=None, dispatch=False, authz_server=False):
    from calvin.utilities.nodecontrol import dispatch_node, start_node

    kwargs = {}
    if attributes:
        kwargs['attributes'] = attributes
    if authz_server:
        kwargs['authz_server'] = authz_server   
    try:
        if dispatch:
            return dispatch_node(uri=uri, control_uri=control_uri, **kwargs)
        else:
            start_node(uri, control_uri, **kwargs)
    except Exception as e:
        print "Starting runtime failed:\n%s" % e
        return 1
def test_start_node_runs_node(run):
    nodecontrol.start_node(URI, CONTROL_URI, attributes={'a': 1})
    assert run.called