(itemkey, itemid)
return results
Lookup a redis hash
Lookup a redis hash
Lookup a redis hash
def lookupRedis(itemkey, itemid):
    ''' Lookup a redis hash '''
    cachekey = itemkey + ":" + itemid
    results = json.loads(r_server.get(cachekey))
    results['id'] = itemid
    if "encrypted" in results:
        if results['encrypted'] is True:
            crypto = Fernet(config['crypto_key'])
            results['data'] = json.loads(crypto.decrypt(bytes(results['data'])))
    if "status" in results:
        results['status'] = r_server.get(cachekey + ":status")
    if "failcount" in results:
        results['failcount'] = r_server.get(cachekey + ":failcount")
    if "lastrun" in results:
        results['lastrun'] = r_server.get(cachekey + ":lastrun")
    return results
def lookupRedis ( itemkey , itemid ) : cachekey = itemkey + ":" + itemid results = json . loads ( r_server . get ( cachekey ) ) results [ 'id' ] = itemid if "encrypted" in results : if results [ 'encrypted' ] is True : crypto = Fernet ( config [ 'crypto_key' ] ) results [ 'data' ] = json . loads ( crypto . decrypt ( bytes ( results [ 'data' ] ) ) ) if "status" in results : results [ 'status' ] = r_server . get ( cachekey + ":status" ) if "failcount" in results : results [ 'failcount' ] = r_server . get ( cachekey + ":failcount" ) if "lastrun" in results : results [ 'lastrun' ] = r_server . get ( cachekey + ":lastrun" ) return results