def config_present(name):
    ret = {'name': name,
           'result': False,
           'changes': {},
           'comment': ''}

    matches = __salt__['nxos.cmd']('find', name)

    if matches:
        ret['result'] = True
        ret['comment'] = 'Config is already set'

    elif __opts__['test'] is True:
        ret['result'] = None
        ret['comment'] = 'Config will be added'
        ret['changes']['new'] = name

    else:
        __salt__['nxos.cmd']('add_config', name)
        matches = __salt__['nxos.cmd']('find', name)
        if matches:
            ret['result'] = True
            ret['comment'] = 'Successfully added config'
            ret['changes']['new'] = name
        else:
            ret['result'] = False
            ret['comment'] = 'Failed to add config'

    return ret
Creates a live, modal PyQt user interface for a specified UI object.
dataset/ETHPy150Open saltstack/salt/salt/states/nxos.py/config_present--crossover with--dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/ui_live.py/ui_livemodal