Skip to content

Commit

Permalink
Install flows when UNIs are in the same switch.
Browse files Browse the repository at this point in the history
When no path is found but UNIs are on the same switch, install the flows.
Fixes kytos#185
  • Loading branch information
ajoaoff authored and Niehaus committed Dec 21, 2020
1 parent 1348593 commit e373c17
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,12 +590,16 @@ def deploy_to_path(self, path=None):
if use_path:
self._install_nni_flows(use_path)
self._install_uni_flows(use_path)
self.activate()
self.current_path = use_path
self.sync()
log.info(f"{self} was deployed.")
return True
return False
elif self.uni_a.interface.switch == self.uni_z.interface.switch:
self._install_direct_uni_flows()
use_path = Path()
else:
return False
self.activate()
self.current_path = use_path
self.sync()
log.info(f"{self} was deployed.")
return True

def _install_direct_uni_flows(self):
"""Install flows connecting two UNIs.
Expand Down

0 comments on commit e373c17

Please sign in to comment.