Skip to content

Make TEManager API easier to use #122

Description

@sajith

It is hard to reason about TEManager because of the amount of state it keeps around, and because of the ways to add/update topologies to it. For example, we instantiate and use TEManager like so:

manager = TEManager(topology1, request)
manager.add_topology(topology2)
manager.add_topology(topology3)

...
manager.update_topology(updated_topology1)
...

graph = temanager.generate_graph_te()
traffic_matrix = temanager.generate_connection_te()

...

It would be nicer to use TEManager like so:

manager = TEManager()

for topology in [topology1, topology2, topology3]
    manager.add_topology(topology)

...
# Remove/hide update_topology().  Instead, add_topology() will do the update if a topology already exists.
manager.add_topology(updated_topology1)
...

graph = temanager.generate_graph_te()
traffic_matrix = temanager.generate_connection_te(request)

...

This is related to this TODO item:

# TODO: a nicer thing to do would be to keep less state around.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions