def _publish(tgt,
             fun,
             arg=None,
             expr_form='glob',
             returner='',
             timeout=None,
             form='clean',
             roster=None):
    if fun.startswith('publish.'):
        log.info('Cannot publish publish calls. Returning {}')
        return {}

    # TODO: implement returners? Do they make sense for salt-ssh calls?
    if returner:
        log.warning('Returners currently not supported in salt-ssh publish')

    # Make sure args have been processed
    if arg is None:
        arg = []
    elif not isinstance(arg, list):
        arg = [salt.utils.args.yamlify_arg(arg)]
    else:
        arg = [salt.utils.args.yamlify_arg(x) for x in arg]
    if len(arg) == 1 and arg[0] is None:
        arg = []

    # Set up opts for the SSH object
    opts = copy.deepcopy(__opts__)
    if roster:
        opts['roster'] = roster
    if timeout:
        opts['timeout'] = timeout
    opts['argv'] = [fun] + arg
    opts['selected_target_option'] = expr_form
    opts['tgt'] = tgt
    opts['arg'] = arg

    # Create the SSH object to handle the actual call
    ssh = salt.client.ssh.SSH(opts)

    # Run salt-ssh to get the minion returns
    rets = {}
    for ret in ssh.run_iter():
        rets.update(ret)

    if form == 'clean':
        cret = {}
        for host in rets:
            if 'return' in rets[host]:
                cret[host] = rets[host]['return']
            else:
                cret[host] = rets[host]
        return cret
    else:
        return rets
Retire keys from the cache until we're under bytes budget
dataset/ETHPy150Open saltstack/salt/salt/client/ssh/wrapper/publish.py/_publish--crossover with--dataset/ETHPy150Open blaze/cachey/cachey/cache.py/Cache.shrink