Beispiel #1
0
    def update_key(self, network_id, tunnel_key):
        if network_id not in self and tunnel_key in self.values():
            raise TunnelKeyAlreadyExist(key=tunnel_key)

        key = self.get(network_id)
        if key is None:
            self._set_key(network_id, tunnel_key)
            return
        if key != tunnel_key:
            raise ryu_exc.NetworkAlreadyExist(network_id=network_id)
Beispiel #2
0
 def register_key(self, network_id, tunnel_key):
     if network_id in self:
         raise ryu_exc.NetworkAlreadyExist(network_id=network_id)
     if tunnel_key in self.values():
         raise TunnelKeyAlreadyExist(tunnel_key=tunnel_key)
     self._set_key(network_id, tunnel_key)