示例#1
0
def send_to_orchestration():
    dg = nx.MultiDiGraph()
    events = {}
    changed_nodes = []

    for logitem in data.SL():
        events[logitem.resource] = evapi.all_events(logitem.resource)
        changed_nodes.append(logitem.resource)

        state_change = StateChange(logitem.resource, logitem.action)
        state_change.insert(changed_nodes, dg)

    evapi.build_edges(dg, events)

    # what `name` should be?
    dg.graph['name'] = 'system_log'
    return graph.create_plan_from_graph(dg)
示例#2
0
文件: change.py 项目: openstack/solar
def send_to_orchestration(tags=None):
    dg = nx.MultiDiGraph()
    events = {}
    changed_nodes = []

    if tags:
        staged_log = LogItem.log_items_by_tags(tags)
    else:
        staged_log = data.SL()
    for logitem in staged_log:
        events[logitem.resource] = evapi.all_events(logitem.resource)
        changed_nodes.append(logitem.resource)

        state_change = StateChange(logitem.resource, logitem.action)
        state_change.insert(changed_nodes, dg)

    evapi.build_edges(dg, events)
    # what `name` should be?
    dg.graph['name'] = 'system_log'
    built_graph = graph.create_plan_from_graph(dg)
    graph.assign_weights_nested(built_graph)
    return built_graph