import logging


def _parse_str_list(obj, name, cmd_name):
    """ Return the list from the parsed str or an empty list if object is None. """
    if type(obj) is str:
        return obj.split(" ")
    elif type(obj) is not list:
        if obj is not None:
            logging.warning("Invalid parameter in command '{}': {} must be a str or a list".format(cmd_name, name))
        return []