kytos
kytos copied to clipboard
Create update_or_create_interface method on Switch class
The method update_interface always set the interface argument to be the interface value associated with the given port number. In fact, it is creating a new interface if it does not exist, or replacing an existing one. The idea now is to create a new method update_or_create_interface so it is clear that this method also creates an interface. Also, when the interface already exists, it must be updated, not replaced by another instance.
@ajoaoff FYI, it's been fixed here: https://github.com/kytos/kytos/pull/840/files.