'Permit admins to inject network info into a server.'

@wsgi.response(202)
@extensions.expected_errors((404, 409))
@wsgi.action('injectNetworkInfo')
def _inject_network_info(self, req, id, body):

    context = req.environ['nova.context']
    context.can((aa_policies.POLICY_ROOT % 'inject_network_info'))
    instance = common.get_instance(self.compute_api, context, id)
    try:
        self.compute_api.inject_network_info(context, instance)
    except exception.InstanceUnknownCell as e:
        raise exc.HTTPNotFound(explanation=e.format_message())
    except exception.InstanceIsLocked as e:
        raise exc.HTTPConflict(explanation=e.format_message())
