Example #1
0
 def _get_switch(self, dpid):
     """
     Returns the switch representation
     of the datapath id.
     """
     if dpid in self.dpids:
         switch = Switch(self.dpids[dpid])
         for ofpport in self.port_state[dpid].values():
             switch.add_port(ofpport)
         return switch