def show(self, req, id):
"""Return data for the given key name."""
context = req.environ['nova.context']
authorize(context, action='show')
try:
# The return object needs to be a dict in order to pop the 'type'
# field, since it is incompatible with API version <= 2.1.
keypair = self.api.get_key_pair(context, context.user_id, id)
keypair = self._filter_keypair(keypair, created_at=True,
deleted=True, deleted_at=True,
id=True, user_id=True,
updated_at=True)
except exception.KeypairNotFound as exc:
raise webob.exc.HTTPNotFound(explanation=exc.format_message())
return {'keypair': keypair}
keypairs.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录