Remove network, including all connected containers

def _remove_network(network):
    '''
    Remove network, including all connected containers
    '''
    ret = {'name': network['Name'],
           'changes': {},
           'result': False,
           'comment': ''}

    errors = []
    for cid in network['Containers']:
        try:
            cinfo = __salt__['docker.inspect_container'](cid)
        except CommandExecutionError:
            # Fall back to container ID
            cname = cid
        else:
            cname = cinfo.get('Name', '').lstrip('/')

        try:
            __salt__['docker.disconnect_container_from_network'](cid, network['Name'])
        except CommandExecutionError as exc:
            errors = \
                'Failed to disconnect container \'{0}\' : {1}'.format(
                    cname, exc
                )
        else:
            ret['changes'].setdefault('disconnected', []).append(cname)

    if errors:
        ret['comment'] = '\n'.join(errors)
        return ret

    try:
        __salt__['docker.remove_network'](network['Name'])
    except CommandExecutionError as exc:
        ret['comment'] = 'Failed to remove network: {0}'.format(exc)
    else:
        ret['changes']['removed'] = True
        ret['result'] = True
        ret['comment'] = 'Removed network \'{0}\''.format(network['Name'])

    return ret