Remove files belonging to a published repository. Aptly tries to remove as many files
        belonging to this repository as possible.

    :param str name: The distribution name of the published repository.
    :param str config_path: The path to the configuration file for the aptly instance.
    :param str endpoint: The publishing endpoint.
    :param str prefix: The prefix for publishing.
    :param bool skip_cleanup: Whether to remove unreferenced files.
    :param bool force: Whether to remove the published repository even if component
        cleanup fails.

    :return: A boolean representing whether all changes succeeded.
    :rtype: bool

    CLI Example:

    .. code-block:: bash

        salt '*' aptly.delete_published name="test-dist"

def delete_published(name, config_path=_DEFAULT_CONFIG_PATH, endpoint='', prefix=None,
                     skip_cleanup=False, force=False):
    '''
    Remove files belonging to a published repository. Aptly tries to remove as many files
        belonging to this repository as possible.

    :param str name: The distribution name of the published repository.
    :param str config_path: The path to the configuration file for the aptly instance.
    :param str endpoint: The publishing endpoint.
    :param str prefix: The prefix for publishing.
    :param bool skip_cleanup: Whether to remove unreferenced files.
    :param bool force: Whether to remove the published repository even if component
        cleanup fails.

    :return: A boolean representing whether all changes succeeded.
    :rtype: bool

    CLI Example:

    .. code-block:: bash

        salt '*' aptly.delete_published name="test-dist"
    '''
    _validate_config(config_path)
    force = six.text_type(bool(force)).lower()
    skip_cleanup = six.text_type(bool(skip_cleanup)).lower()

    current_published = __salt__['aptly.get_published'](name=name, config_path=config_path,
                                                        endpoint=endpoint, prefix=prefix)

    if not current_published:
        log.debug('Published repository already absent: %s', name)
        return True

    cmd = ['publish', 'drop', '-config={}'.format(config_path),
           '-force-drop={}'.format(force), '-skip-cleanup={}'.format(skip_cleanup),
           name]

    if prefix:
        cmd.append('{}:{}'.format(endpoint, prefix))

    _cmd_run(cmd)
    published = __salt__['aptly.get_published'](name=name, config_path=config_path,
                                                endpoint=endpoint, prefix=prefix)

    if published:
        log.error('Unable to remove published snapshot: %s', name)
        return False
    log.debug('Removed published snapshot: %s', name)
    return True