def _disassociate_project_only(self, req, id, body):
context = req.environ['nova.context']
authorize(context)
# NOTE(shaohe-feng): back-compatible with db layer hard-code
# admin permission checks. call db API objects.Network.associate
nova_context.require_admin_context(context)
try:
self.network_api.associate(context, id, project=None)
except exception.NetworkNotFound:
msg = _("Network not found")
raise exc.HTTPNotFound(explanation=msg)
except NotImplementedError:
msg = _('Disassociate project is not implemented by the '
'configured Network API')
raise exc.HTTPNotImplemented(explanation=msg)
return webob.Response(status_int=202)
networks_associate.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录