views.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:mos-horizon 作者: Mirantis 项目源码 文件源码
def _set_external_network(self, router, ext_net_dict):
        gateway_info = router.external_gateway_info
        if gateway_info:
            ext_net_id = gateway_info['network_id']
            if ext_net_id in ext_net_dict:
                gateway_info['network'] = ext_net_dict[ext_net_id]
            else:
                msg_params = {'ext_net_id': ext_net_id, 'router_id': router.id}
                msg = _('External network "%(ext_net_id)s" expected but not '
                        'found for router "%(router_id)s".') % msg_params
                messages.error(self.request, msg)
                # gateway_info['network'] is just the network name, so putting
                # in a smallish error message in the table is reasonable.
                # Translators: The usage is "<UUID of ext_net> (Not Found)"
                gateway_info['network'] = pgettext_lazy(
                    'External network not found',
                    u'%s (Not Found)') % ext_net_id
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号