

def add_store(name, store, saltenv='base'):
    '\n    Store a certificate to the given store\n\n    name\n        The certificate to store, this can use local paths\n        or salt:// paths\n\n    store\n        The store to add the certificate to\n\n    saltenv\n        The salt environment to use, this is ignored if a local\n        path is specified\n\n    '
    ret = {
        'name': name,
        'result': True,
        'comment': '',
        'changes': {
            
        },
    }
    cert_file = __salt__['cp.cache_file'](name, saltenv)
    if (cert_file is False):
        ret['result'] = False
        ret['comment'] += 'Certificate file not found.'
    else:
        cert_serial = __salt__['certutil.get_cert_serial'](cert_file)
        serials = __salt__['certutil.get_stored_cert_serials'](store)
        if (cert_serial not in serials):
            out = __salt__['certutil.add_store'](cert_file, store)
            if ('successfully' in out):
                ret['changes']['added'] = name
            else:
                ret['result'] = False
                ret['comment'] += 'Failed to store certificate {0}'.format(name)
        else:
            ret['comment'] += '{0} already stored.'.format(name)
    return ret

dataset/ETHPy150Open saltstack/salt/salt/states/win_certutil.py add_store/original