def format_cmd(cmd):
    """Return command in a valid format."""
    if isinstance(cmd, str):
        cmd = [cmd]
    elif not isinstance(cmd, list):
        raise ValueError('Command should be a list or a string and not {}'.
            format(type(cmd)))
    return cmd
