コード例 #1
0
 def prepare_devices_filter(self, device_ids):
     if not device_ids:
         return
     LOG.info(_("Preparing filters for devices %s"), device_ids)
     devices = self.ovs_plugin_rpc.security_group_rules_for_devices(
         self.context, list(device_ids))
     for device in devices.values():
         LOG.info(_("Prepare port filter for %s"), device['device'])
         firewall = self.get_firewall(device['device'], device['device_id'], True)
         with firewall.defer_apply():
             firewall.prepare_port_filter(device)
         self.device_sg[device['device']] = device
コード例 #2
0
 def prepare_devices_filter(self, device_ids):
     if not device_ids:
         return
     LOG.info(_("Preparing filters for devices %s"), device_ids)
     devices = self.ovs_plugin_rpc.security_group_rules_for_devices(
         self.context, list(device_ids))
     for device in devices.values():
         LOG.info(_("Prepare port filter for %s"), device['device'])
         firewall = self.get_firewall(device['device'], device['device_id'],
                                      True)
         with firewall.defer_apply():
             firewall.prepare_port_filter(device)
         self.device_sg[device['device']] = device
コード例 #3
0
 def refresh_firewall(self, device_ids = None):
     if not device_ids:
         device_ids = self.device_sg.keys()
         if not device_ids:
             LOG.info(_("No ports here to refresh firewall"))
             return
     devices = self.ovs_plugin_rpc.security_group_rules_for_devices(
         self.context, device_ids)
     for device in devices.values():
         LOG.info(_("Update port filter for %s"), device['device'])
         firewall = self.get_firewall(device['device'])
         if firewall:
             with firewall.defer_apply():
                 firewall.prepare_port_filter(device)
         else:
             LOG.error(_("Not found firewall when update port"
                             " filter for %s"), device['device'])
コード例 #4
0
 def refresh_firewall(self, device_ids=None):
     if not device_ids:
         device_ids = self.device_sg.keys()
         if not device_ids:
             LOG.info(_("No ports here to refresh firewall"))
             return
     devices = self.ovs_plugin_rpc.security_group_rules_for_devices(
         self.context, device_ids)
     for device in devices.values():
         LOG.info(_("Update port filter for %s"), device['device'])
         firewall = self.get_firewall(device['device'])
         if firewall:
             with firewall.defer_apply():
                 firewall.prepare_port_filter(device)
         else:
             LOG.error(
                 _("Not found firewall when update port"
                   " filter for %s"), device['device'])