'Unlock a server instance.'

@wsgi.response(202)
@extensions.expected_errors(404)
@wsgi.action('unlock')
def _unlock(self, req, id, body):

    context = req.environ['nova.context']
    context.can((ls_policies.POLICY_ROOT % 'unlock'))
    instance = common.get_instance(self.compute_api, context, id)
    if (not self.compute_api.is_expected_locked_by(context, instance)):
        context.can((ls_policies.POLICY_ROOT % 'unlock:unlock_override'), instance)
    self.compute_api.unlock(context, instance)
