• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python _i18n._LI函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中neutron._i18n._LI函数的典型用法代码示例。如果您正苦于以下问题:Python _LI函数的具体用法?Python _LI怎么用?Python _LI使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了_LI函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _create_resource_instance

    def _create_resource_instance(self, resource_name, plural_name):
        """Factory function for quota Resource.

        This routine returns a resource instance of the appropriate type
        according to system configuration.

        If QUOTAS.track_quota_usage is True, and there is a model mapping for
        the current resource, this function will return an instance of
        AccountedResource; otherwise an instance of CountableResource.
        """

        if (not cfg.CONF.QUOTAS.track_quota_usage or
            resource_name not in self._tracked_resource_mappings):
            LOG.info(_LI("Creating instance of CountableResource for "
                         "resource:%s"), resource_name)
            return resource.CountableResource(
                resource_name, resource._count_resource,
                'quota_%s' % resource_name)
        else:
            LOG.info(_LI("Creating instance of TrackedResource for "
                         "resource:%s"), resource_name)
            return resource.TrackedResource(
                resource_name,
                self._tracked_resource_mappings[resource_name],
                'quota_%s' % resource_name)
开发者ID:sebrandon1,项目名称:neutron,代码行数:25,代码来源:resource_registry.py


示例2: _schedule_network

 def _schedule_network(self, context, network_id, dhcp_notifier):
     LOG.info(_LI("Scheduling unhosted network %s"), network_id)
     try:
         # TODO(enikanorov): have to issue redundant db query
         # to satisfy scheduling interface
         network = self.get_network(context, network_id)
         agents = self.schedule_network(context, network)
         if not agents:
             LOG.info(_LI("Failed to schedule network %s, "
                          "no eligible agents or it might be "
                          "already scheduled by another server"),
                      network_id)
             return
         if not dhcp_notifier:
             return
         for agent in agents:
             LOG.info(_LI("Adding network %(net)s to agent "
                          "%(agent)s on host %(host)s"),
                      {'net': network_id,
                       'agent': agent.id,
                       'host': agent.host})
             dhcp_notifier.network_added_to_agent(
                 context, network_id, agent.host)
     except Exception:
         # catching any exception during scheduling
         # so if _schedule_network is invoked in the loop it could
         # continue in any case
         LOG.exception(_LE("Failed to schedule network %s"), network_id)
开发者ID:coreycb,项目名称:neutron,代码行数:28,代码来源:agentschedulers_db.py


示例3: delete_router

    def delete_router(self, context, id):
        router_db = self._get_router(context, id)
        super(L3_HA_NAT_db_mixin, self).delete_router(context, id)

        if router_db.extra_attributes.ha:
            ha_network = self.get_ha_network(context, router_db.tenant_id)
            if ha_network:
                self._delete_vr_id_allocation(context, ha_network, router_db.extra_attributes.ha_vr_id)
                self._delete_ha_interfaces(context, router_db.id)

                # In case that create HA router failed because of the failure
                # in HA network creation. So here put this deleting HA network
                # procedure under 'if ha_network' block.
                if not self._ha_routers_present(context, router_db.tenant_id):
                    try:
                        self._delete_ha_network(context, ha_network)
                    except (n_exc.NetworkNotFound, orm.exc.ObjectDeletedError):
                        LOG.debug("HA network for tenant %s was already deleted.", router_db.tenant_id)
                    except sa.exc.InvalidRequestError:
                        LOG.info(_LI("HA network %s can not be deleted."), ha_network.network_id)
                    except n_exc.NetworkInUse:
                        LOG.debug("HA network %s is still in use.", ha_network.network_id)
                    else:
                        LOG.info(
                            _LI(
                                "HA network %(network)s was deleted as "
                                "no HA routers are present in tenant "
                                "%(tenant)s."
                            ),
                            {"network": ha_network.network_id, "tenant": router_db.tenant_id},
                        )
开发者ID:qianqunyi,项目名称:neutron,代码行数:31,代码来源:l3_hamode_db.py


示例4: ensure_tenant

    def ensure_tenant(self, plugin_context, tenant_id):
        LOG.info(_LI("APIC AIM MD ensuring tenant_id: %s"), tenant_id)

        self.project_name_cache.ensure_project(tenant_id)

        # TODO(rkukura): Move the following to precommit methods so
        # AIM tenants and application profiles are created whenever
        # needed.
        session = plugin_context.session
        with session.begin(subtransactions=True):
            project_name = self.project_name_cache.get_project_name(tenant_id)
            tenant_name = self.name_mapper.tenant(session, tenant_id,
                                                  project_name)
            LOG.info(_LI("Mapped tenant_id %(id)s to %(apic_name)s"),
                     {'id': tenant_id, 'apic_name': tenant_name})

            aim_ctx = aim_context.AimContext(session)

            tenant = aim_resource.Tenant(name=tenant_name)
            if not self.aim.get(aim_ctx, tenant):
                self.aim.create(aim_ctx, tenant)

            ap = aim_resource.ApplicationProfile(tenant_name=tenant_name,
                                                 name=AP_NAME)
            if not self.aim.get(aim_ctx, ap):
                self.aim.create(aim_ctx, ap)
开发者ID:ashutosh-mishra,项目名称:my-gbp,代码行数:26,代码来源:mechanism_driver.py


示例5: delete_subnet_precommit

    def delete_subnet_precommit(self, context):
        LOG.info(_LI("APIC AIM MD deleting subnet: %s"), context.current)

        gateway_ip_mask = self._gateway_ip_mask(context.current)
        if gateway_ip_mask:
            session = context._plugin_context.session

            network_id = context.current['network_id']
            # REVISIT(rkukura): Should Ml2Plus extend SubnetContext
            # with network?
            network = (session.query(models_v2.Network).
                       filter_by(id=network_id).
                       one())

            tenant_id = network.tenant_id
            tenant_name = self.name_mapper.tenant(session, tenant_id)
            LOG.info(_LI("Mapped tenant_id %(id)s to %(apic_name)s"),
                     {'id': tenant_id, 'apic_name': tenant_name})

            network_name = network.name
            bd_name = self.name_mapper.network(session, network_id,
                                               network_name)
            LOG.info(_LI("Mapped network_id %(id)s with name %(name)s to "
                         "%(apic_name)s"),
                     {'id': network_id, 'name': network_name,
                      'apic_name': bd_name})

            aim_ctx = aim_context.AimContext(session)

            subnet = aim_resource.Subnet(tenant_name=tenant_name,
                                         bd_name=bd_name,
                                         gw_ip_mask=gateway_ip_mask)
            self.aim.delete(aim_ctx, subnet)
开发者ID:ashutosh-mishra,项目名称:my-gbp,代码行数:33,代码来源:mechanism_driver.py


示例6: delete_network_precommit

    def delete_network_precommit(self, context):
        LOG.info(_LI("APIC AIM MD deleting network: %s"), context.current)

        session = context._plugin_context.session

        tenant_id = context.current['tenant_id']
        tenant_name = self.name_mapper.tenant(session, tenant_id)
        LOG.info(_LI("Mapped tenant_id %(id)s to %(apic_name)s"),
                 {'id': tenant_id, 'apic_name': tenant_name})

        id = context.current['id']
        bd_name = self.name_mapper.network(session, id)
        LOG.info(_LI("Mapped network_id %(id)s to %(apic_name)s"),
                 {'id': id, 'apic_name': bd_name})

        aim_ctx = aim_context.AimContext(session)

        epg = aim_resource.EndpointGroup(tenant_name=tenant_name,
                                         app_profile_name=AP_NAME,
                                         name=bd_name)
        self.aim.delete(aim_ctx, epg)

        bd = aim_resource.BridgeDomain(tenant_name=tenant_name,
                                       name=bd_name)
        self.aim.delete(aim_ctx, bd)

        self.name_mapper.delete_apic_name(session, id)
开发者ID:ashutosh-mishra,项目名称:my-gbp,代码行数:27,代码来源:mechanism_driver.py


示例7: port_bound

    def port_bound(self, port_id, net_uuid,
                   network_type, physical_network, segmentation_id, userid):
        LOG.info(_LI("Start to bind port port_id:%(port_id)s, "
                     "net_uuid:%(net_uuid)s, network_type: %(network_type)s, "
                     "physical_network: %(physical_network)s, "
                     "userid: %(userid)s, segmentation_id:%(seg_id)s"),
                 {'port_id': port_id, 'net_uuid': net_uuid,
                  'network_type': network_type,
                  'physical_network': physical_network,
                  'seg_id': segmentation_id,
                  'userid': userid})

        self._utils.grant_user(self._zhcp_node, physical_network, userid)
        vdev = self._utils.couple_nic_to_vswitch(physical_network, port_id,
                                                 self._zhcp_node, userid)
        self._utils.put_user_direct_online(self._zhcp_node,
                                           self._zhcp_userid)

        if network_type == p_const.TYPE_VLAN:
            LOG.info(_LI('Binding VLAN, VLAN ID: %(segmentation_id)s, '
                         'port_id: %(port_id)s'),
                     {'segmentation_id': segmentation_id,
                      'port_id': port_id})
            self._utils.set_vswitch_port_vlan_id(segmentation_id, port_id,
                                                 vdev, self._zhcp_node,
                                                 physical_network)
        else:
            LOG.info(_LI('Bind %s port done'), port_id)
开发者ID:shilinhuang,项目名称:networking-zvm,代码行数:28,代码来源:zvm_neutron_agent.py


示例8: main

def main():
    """Main method for cleaning up OVS bridges.

    The utility cleans up the integration bridges used by Neutron.
    """

    conf = setup_conf()
    conf()
    config.setup_logging()

    configuration_bridges = set([conf.ovs_integration_bridge,
                                 conf.external_network_bridge])
    ovs = ovs_lib.BaseOVS()
    ovs_bridges = set(ovs.get_bridges())
    available_configuration_bridges = configuration_bridges & ovs_bridges

    if conf.ovs_all_ports:
        bridges = ovs_bridges
    else:
        bridges = available_configuration_bridges

    # Collect existing ports created by Neutron on configuration bridges.
    # After deleting ports from OVS bridges, we cannot determine which
    # ports were created by Neutron, so port information is collected now.
    ports = collect_neutron_ports(available_configuration_bridges)

    for bridge in bridges:
        LOG.info(_LI("Cleaning bridge: %s"), bridge)
        ovs = ovs_lib.OVSBridge(bridge)
        ovs.delete_ports(all_ports=conf.ovs_all_ports)

    # Remove remaining ports created by Neutron (usually veth pair)
    delete_neutron_ports(ports)

    LOG.info(_LI("OVS cleanup completed successfully"))
开发者ID:SUSE-Cloud,项目名称:neutron,代码行数:35,代码来源:ovs_cleanup.py


示例9: remove_empty_bridges

def remove_empty_bridges():
    try:
        interface_mappings = n_utils.parse_mappings(
            cfg.CONF.LINUX_BRIDGE.physical_interface_mappings)
    except ValueError as e:
        LOG.error(_LE("Parsing physical_interface_mappings failed: %s."), e)
        sys.exit(1)
    LOG.info(_LI("Interface mappings: %s."), interface_mappings)

    try:
        bridge_mappings = n_utils.parse_mappings(
            cfg.CONF.LINUX_BRIDGE.bridge_mappings)
    except ValueError as e:
        LOG.error(_LE("Parsing bridge_mappings failed: %s."), e)
        sys.exit(1)
    LOG.info(_LI("Bridge mappings: %s."), bridge_mappings)

    lb_manager = linuxbridge_neutron_agent.LinuxBridgeManager(
        bridge_mappings, interface_mappings)

    bridge_names = lb_manager.get_deletable_bridges()
    for bridge_name in bridge_names:
        if lb_manager.get_tap_devices_count(bridge_name):
            continue

        try:
            lb_manager.delete_bridge(bridge_name)
            LOG.info(_LI("Linux bridge %s deleted"), bridge_name)
        except RuntimeError:
            LOG.exception(_LE("Linux bridge %s delete failed"), bridge_name)
    LOG.info(_LI("Linux bridge cleanup completed successfully"))
开发者ID:21atlas,项目名称:neutron,代码行数:31,代码来源:linuxbridge_cleanup.py


示例10: main

def main():
    common_config.init(sys.argv[1:])

    common_config.setup_logging()
    try:
        config_parser = SriovNicAgentConfigParser()
        config_parser.parse()
        device_mappings = config_parser.device_mappings
        exclude_devices = config_parser.exclude_devices

    except ValueError:
        LOG.exception(_LE("Failed on Agent configuration parse. "
                          "Agent terminated!"))
        raise SystemExit(1)
    LOG.info(_LI("Physical Devices mappings: %s"), device_mappings)
    LOG.info(_LI("Exclude Devices: %s"), exclude_devices)

    polling_interval = cfg.CONF.AGENT.polling_interval
    try:
        agent = SriovNicSwitchAgent(device_mappings,
                                    exclude_devices,
                                    polling_interval)
    except exc.SriovNicError:
        LOG.exception(_LE("Agent Initialization Failed"))
        raise SystemExit(1)
    # Start everything.
    LOG.info(_LI("Agent initialized successfully, now running... "))
    agent.daemon_loop()
开发者ID:MODITDC,项目名称:neutron,代码行数:28,代码来源:sriov_nic_agent.py


示例11: delete_router

    def delete_router(self, context, id):
        router_db = self._get_router(context, id)
        super(L3_HA_NAT_db_mixin, self).delete_router(context, id)

        if router_db.extra_attributes.ha:
            ha_network = self.get_ha_network(context,
                                             router_db.tenant_id)
            if ha_network:
                self._delete_vr_id_allocation(
                    context, ha_network, router_db.extra_attributes.ha_vr_id)
                self._delete_ha_interfaces(context, router_db.id)

                # always attempt to cleanup the network as the router is
                # deleted. the core plugin will stop us if its in use
                try:
                    self._delete_ha_network(context, ha_network)
                except (n_exc.NetworkNotFound,
                        orm.exc.ObjectDeletedError):
                    LOG.debug(
                        "HA network for tenant %s was already deleted.",
                        router_db.tenant_id)
                except sa.exc.InvalidRequestError:
                    LOG.info(_LI("HA network %s can not be deleted."),
                             ha_network.network_id)
                except n_exc.NetworkInUse:
                    # network is still in use, this is normal so we don't
                    # log anything
                    pass
                else:
                    LOG.info(_LI("HA network %(network)s was deleted as "
                                 "no HA routers are present in tenant "
                                 "%(tenant)s."),
                             {'network': ha_network.network_id,
                              'tenant': router_db.tenant_id})
开发者ID:biruce-openstack,项目名称:neutron,代码行数:34,代码来源:l3_hamode_db.py


示例12: treat_device

    def treat_device(self, device, pci_slot, admin_state_up, spoofcheck=True):
        if self.eswitch_mgr.device_exists(device, pci_slot):
            try:
                self.eswitch_mgr.set_device_spoofcheck(device, pci_slot,
                                                       spoofcheck)
            except Exception:
                LOG.warning(_LW("Failed to set spoofcheck for device %s"),
                            device)
            LOG.info(_LI("Device %(device)s spoofcheck %(spoofcheck)s"),
                     {"device": device, "spoofcheck": spoofcheck})

            try:
                self.eswitch_mgr.set_device_state(device, pci_slot,
                                                  admin_state_up)
            except exc.IpCommandOperationNotSupportedError:
                LOG.warning(_LW("Device %s does not support state change"),
                            device)
            except exc.SriovNicError:
                LOG.warning(_LW("Failed to set device %s state"), device)
                return
            if admin_state_up:
                # update plugin about port status
                self.plugin_rpc.update_device_up(self.context,
                                                 device,
                                                 self.agent_id,
                                                 cfg.CONF.host)
            else:
                self.plugin_rpc.update_device_down(self.context,
                                                   device,
                                                   self.agent_id,
                                                   cfg.CONF.host)
        else:
            LOG.info(_LI("No device with MAC %s defined on agent."), device)
开发者ID:MODITDC,项目名称:neutron,代码行数:33,代码来源:sriov_nic_agent.py


示例13: treat_devices_added_updated

    def treat_devices_added_updated(self, devices_info):
        try:
            macs_list = set([device_info[0] for device_info in devices_info])
            devices_details_list = self.plugin_rpc.get_devices_details_list(
                self.context, macs_list, self.agent_id)
        except Exception as e:
            LOG.debug("Unable to get port details for devices "
                      "with MAC addresses %(devices)s: %(e)s",
                      {'devices': macs_list, 'e': e})
            # resync is needed
            return True

        for device_details in devices_details_list:
            device = device_details['device']
            LOG.debug("Port with MAC address %s is added", device)

            if 'port_id' in device_details:
                LOG.info(_LI("Port %(device)s updated. Details: %(details)s"),
                         {'device': device, 'details': device_details})
                port_id = device_details['port_id']
                profile = device_details['profile']
                spoofcheck = device_details.get('port_security_enabled', True)
                self.treat_device(device,
                                  profile.get('pci_slot'),
                                  device_details['admin_state_up'],
                                  spoofcheck)
                self._update_network_ports(device_details['network_id'],
                                           port_id,
                                           (device, profile.get('pci_slot')))
                self.ext_manager.handle_port(self.context, device_details)
            else:
                LOG.info(_LI("Device with MAC %s not defined on plugin"),
                         device)
        return False
开发者ID:MODITDC,项目名称:neutron,代码行数:34,代码来源:sriov_nic_agent.py


示例14: refresh_firewall

    def refresh_firewall(self, device_ids=None):
        LOG.info(_LI("Refresh firewall rules"))
        if not device_ids:
            device_ids = self.firewall.ports.keys()
            if not device_ids:
                LOG.info(_LI("No ports here to refresh firewall"))
                return
        if self.use_enhanced_rpc:
            devices_info = self.plugin_rpc.security_group_info_for_devices(
                self.context, device_ids)
            devices = devices_info['devices']
            security_groups = devices_info['security_groups']
            security_group_member_ips = devices_info['sg_member_ips']
        else:
            devices = self.plugin_rpc.security_group_rules_for_devices(
                self.context, device_ids)

        with self.firewall.defer_apply():
            if self.use_enhanced_rpc:
                LOG.debug("Update security group information for ports %s",
                          devices.keys())
                self._update_security_group_info(
                    security_groups, security_group_member_ips)
            for device in devices.values():
                LOG.debug("Update port filter for %s", device['device'])
                self.firewall.update_port_filter(device)
开发者ID:21atlas,项目名称:neutron,代码行数:26,代码来源:securitygroups_rpc.py


示例15: main

def main():
    common_config.init(sys.argv[1:])

    common_config.setup_logging()
    try:
        interface_mappings = n_utils.parse_mappings(
            cfg.CONF.LINUX_BRIDGE.physical_interface_mappings)
    except ValueError as e:
        LOG.error(_LE("Parsing physical_interface_mappings failed: %s. "
                      "Agent terminated!"), e)
        sys.exit(1)
    LOG.info(_LI("Interface mappings: %s"), interface_mappings)

    try:
        bridge_mappings = n_utils.parse_mappings(
            cfg.CONF.LINUX_BRIDGE.bridge_mappings)
    except ValueError as e:
        LOG.error(_LE("Parsing bridge_mappings failed: %s. "
                      "Agent terminated!"), e)
        sys.exit(1)
    LOG.info(_LI("Bridge mappings: %s"), bridge_mappings)

    manager = LinuxBridgeManager(bridge_mappings, interface_mappings)

    polling_interval = cfg.CONF.AGENT.polling_interval
    quitting_rpc_timeout = cfg.CONF.AGENT.quitting_rpc_timeout
    agent = ca.CommonAgentLoop(manager, polling_interval, quitting_rpc_timeout,
                               constants.AGENT_TYPE_LINUXBRIDGE,
                               LB_AGENT_BINARY)
    LOG.info(_LI("Agent initialized successfully, now running... "))
    launcher = service.launch(cfg.CONF, agent)
    launcher.wait()
开发者ID:dims,项目名称:neutron,代码行数:32,代码来源:linuxbridge_neutron_agent.py


示例16: _get_dp

    def _get_dp(self):
        """Get (dp, ofp, ofpp) tuple for the switch.

        A convenient method for openflow message composers.
        """
        while True:
            if self._cached_dpid is None:
                dpid_str = self.get_datapath_id()
                LOG.info(_LI("Bridge %(br_name)s has datapath-ID %(dpid)s"),
                         {"br_name": self.br_name, "dpid": dpid_str})
                self._cached_dpid = int(dpid_str, 16)
            try:
                dp = self._get_dp_by_dpid(self._cached_dpid)
                return dp, dp.ofproto, dp.ofproto_parser
            except RuntimeError:
                with excutils.save_and_reraise_exception() as ctx:
                    # Retry if dpid has been changed.
                    # NOTE(yamamoto): Open vSwitch change its dpid on
                    # some events.
                    # REVISIT(yamamoto): Consider to set dpid statically.
                    old_dpid_str = format(self._cached_dpid, '0x')
                    new_dpid_str = self.get_datapath_id()
                    if new_dpid_str != old_dpid_str:
                        LOG.info(_LI("Bridge %(br_name)s changed its "
                                     "datapath-ID from %(old)s to %(new)s"), {
                            "br_name": self.br_name,
                            "old": old_dpid_str,
                            "new": new_dpid_str,
                        })
                        ctx.reraise = False
                    self._cached_dpid = int(new_dpid_str, 16)
开发者ID:AradhanaSingh,项目名称:neutron,代码行数:31,代码来源:ovs_bridge.py


示例17: treat_devices_removed

 def treat_devices_removed(self, devices):
     resync = False
     self.sg_agent.remove_devices_filter(devices)
     for device in devices:
         LOG.info(_LI("Attachment %s removed"), device)
         details = None
         try:
             details = self.plugin_rpc.update_device_down(self.context,
                                                          device,
                                                          self.agent_id,
                                                          cfg.CONF.host)
         except Exception:
             LOG.exception(_LE("Error occurred while removing port %s"),
                           device)
             resync = True
         if details and details['exists']:
             LOG.info(_LI("Port %s updated."), device)
         else:
             LOG.debug("Device %s not defined on plugin", device)
         port_id = self._clean_network_ports(device)
         self.ext_manager.delete_port(self.context,
                                      {'device': device,
                                       'port_id': port_id})
         registry.notify(local_resources.PORT_DEVICE, events.AFTER_DELETE,
                         self, context=self.context, device=device,
                         port_id=port_id)
     if self.prevent_arp_spoofing:
         self.mgr.delete_arp_spoofing_protection(devices)
     return resync
开发者ID:annp,项目名称:neutron,代码行数:29,代码来源:_common_agent.py


示例18: sync_state

    def sync_state(self, networks=None):
        """Sync the local DHCP state with Neutron. If no networks are passed,
        or 'None' is one of the networks, sync all of the networks.
        """
        only_nets = set([] if (not networks or None in networks) else networks)
        LOG.info(_LI('Synchronizing state'))
        pool = eventlet.GreenPool(self.conf.num_sync_threads)
        known_network_ids = set(self.cache.get_network_ids())

        try:
            active_networks = self.plugin_rpc.get_active_networks_info()
            active_network_ids = set(network.id for network in active_networks)
            for deleted_id in known_network_ids - active_network_ids:
                try:
                    self.disable_dhcp_helper(deleted_id)
                except Exception as e:
                    self.schedule_resync(e, deleted_id)
                    LOG.exception(_LE('Unable to sync network state on '
                                      'deleted network %s'), deleted_id)

            for network in active_networks:
                if (not only_nets or  # specifically resync all
                        network.id not in known_network_ids or  # missing net
                        network.id in only_nets):  # specific network to sync
                    pool.spawn(self.safe_configure_dhcp_for_network, network)
            pool.waitall()
            LOG.info(_LI('Synchronizing state complete'))

        except Exception as e:
            if only_nets:
                for network_id in only_nets:
                    self.schedule_resync(e, network_id)
            else:
                self.schedule_resync(e)
            LOG.exception(_LE('Unable to sync network state.'))
开发者ID:punithks,项目名称:neutron,代码行数:35,代码来源:agent.py


示例19: daemon_loop

    def daemon_loop(self):
        LOG.info(_LI("LinuxBridge Agent RPC Daemon Started!"))
        device_info = None
        sync = True

        while True:
            start = time.time()

            if self.fullsync:
                sync = True
                self.fullsync = False

            if sync:
                LOG.info(_LI("Agent out of sync with plugin!"))

            device_info = self.scan_devices(previous=device_info, sync=sync)
            sync = False

            if self._device_info_has_changes(device_info) or self.sg_agent.firewall_refresh_needed():
                LOG.debug("Agent loop found changes! %s", device_info)
                try:
                    sync = self.process_network_devices(device_info)
                except Exception:
                    LOG.exception(_LE("Error in agent loop. Devices info: %s"), device_info)
                    sync = True

            # sleep till end of polling interval
            elapsed = time.time() - start
            if elapsed < self.polling_interval:
                time.sleep(self.polling_interval - elapsed)
            else:
                LOG.debug(
                    "Loop iteration exceeded interval " "(%(polling_interval)s vs. %(elapsed)s)!",
                    {"polling_interval": self.polling_interval, "elapsed": elapsed},
                )
开发者ID:kimcharli,项目名称:neutron,代码行数:35,代码来源:_common_agent.py


示例20: _run_openstack_l3_cmds

    def _run_openstack_l3_cmds(self, commands, server):
        """Execute/sends a CAPI (Command API) command to EOS.

        In this method, list of commands is appended with prefix and
        postfix commands - to make is understandble by EOS.

        :param commands : List of command to be executed on EOS.
        :param server: Server endpoint on the Arista switch to be configured
        """
        command_start = ['enable', 'configure']
        command_end = ['exit']
        full_command = command_start + commands + command_end

        LOG.info(_LI('Executing command on Arista EOS: %s'), full_command)

        try:
            # this returns array of return values for every command in
            # full_command list
            ret = server.runCmds(version=1, cmds=full_command)
            LOG.info(_LI('Results of execution on Arista EOS: %s'), ret)

        except Exception:
            msg = (_('Error occurred while trying to execute '
                     'commands %(cmd)s on EOS %(host)s') %
                   {'cmd': full_command, 'host': server})
            LOG.exception(msg)
            raise arista_exc.AristaServicePluginRpcError(msg=msg)
开发者ID:alexreimers,项目名称:networking-arista,代码行数:27,代码来源:arista_l3_driver.py



注:本文中的neutron._i18n._LI函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python _i18n._LW函数代码示例发布时间:2022-05-27
下一篇:
Python _i18n._LE函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap