'Run a method in the compute api class.'

def run_compute_api_method(self, message, method_info):

    method = method_info['method']
    fn = getattr(self.compute_api, method, None)
    if (not fn):
        detail = _("Unknown    method    '%(method)s'    in    compute    API")
        raise exception.CellServiceAPIMethodNotFound(detail=(detail % {'method': method}))
    args = list(method_info['method_args'])
    instance_uuid = args[0]
    expected_attrs = ['metadata', 'system_metadata', 'security_groups', 'info_cache']
    try:
        instance = objects.Instance.get_by_uuid(message.ctxt, instance_uuid, expected_attrs=expected_attrs)
        args[0] = instance
    except exception.InstanceNotFound:
        with excutils.save_and_reraise_exception():
            instance = objects.Instance(context=message.ctxt, uuid=instance_uuid)
            self.msg_runner.instance_destroy_at_top(message.ctxt, instance)
    return fn(message.ctxt, *args, **method_info['method_kwargs'])
