def _do_action(module, **action_args):
    """
    Perform the module action, returning the results as a list.

    Because we know the number of outputs expected (each one is a terminal),
    we can convert no outputs or a single output to lists of length 0 and 1
    respectively.  This makes the module actions more natural to write.
    """
    num_outputs = len(module.outputs)
    result = module.action(**action_args)
    if num_outputs == 1:
        result = [result]
    elif num_outputs == 0:
        result = []
    return result
