| Conditions | 3 |
| Total Lines | 13 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | """Module to create a singleton class to track all switches. After being |
||
| 30 | 1 | def get_switch(self, dpid): |
|
| 31 | """Query the self.switches |
||
| 32 | Args: |
||
| 33 | dpid: datapath id 'str' |
||
| 34 | |||
| 35 | Returns: |
||
| 36 | a kytos.core.switch.Switch() object |
||
| 37 | False if not found |
||
| 38 | """ |
||
| 39 | 1 | for switch in self._switches.values(): |
|
| 40 | 1 | if switch.dpid == dpid: |
|
| 41 | 1 | return self._switches[switch.dpid] |
|
| 42 | 1 | return False |
|
| 43 | |||
| 47 |