Beispiel #1
0
 def _get_dp_by_dpid(self, dpid_int):
     """Get os-ken datapath object for the switch."""
     timeout_sec = cfg.CONF.OVS.of_connect_timeout
     start_time = timeutils.now()
     while True:
         dp = ofctl_api.get_datapath(self._app, dpid_int)
         if dp is not None:
             break
         # The switch has not established a connection to us; retry again
         # until timeout.
         if timeutils.now() > start_time + timeout_sec:
             m = _("Switch connection timeout")
             LOG.error(m)
             # NOTE(yamamoto): use RuntimeError for compat with ovs_lib
             raise RuntimeError(m)
     return dp
Beispiel #2
0
 def _get_dp_by_dpid(self, dpid_int):
     """Get os-ken datapath object for the switch."""
     timeout_sec = cfg.CONF.OVS.of_connect_timeout
     start_time = timeutils.now()
     while True:
         dp = ofctl_api.get_datapath(self._app, dpid_int)
         if dp is not None:
             break
         # The switch has not established a connection to us.
         # Wait for a little.
         if timeutils.now() > start_time + timeout_sec:
             m = _("Switch connection timeout")
             LOG.error(m)
             # NOTE(yamamoto): use RuntimeError for compat with ovs_lib
             raise RuntimeError(m)
         eventlet.sleep(1)
     return dp
Beispiel #3
0
 def _get_dp_by_dpid(self, dpid_int):
     LOG.info('%s(): caller(): %s', log_utils.get_fname(1),
              log_utils.get_fname(2))
     """Get os-ken datapath object for the switch."""
     timeout_sec = cfg.CONF.OVS.of_connect_timeout
     start_time = timeutils.now()
     while True:
         dp = ofctl_api.get_datapath(self._app, dpid_int)
         if dp is not None:
             break
         # The switch has not established a connection to us.
         # Wait for a little.
         if timeutils.now() > start_time + timeout_sec:
             m = _("Switch connection timeout")
             LOG.error(m)
             # NOTE(yamamoto): use RuntimeError for compat with ovs_lib
             raise RuntimeError(m)
         eventlet.sleep(1)
     return dp