def get_types(): result = { 'type': get_type_type() } for slug in redis.smembers('types'): src = redis.get('n:type:' + slug) if src is None: redis.srem('types', slug) else: result[slug] = json.loads(src) return result
def unrelate(subj, predicate, obj): redis.srem("r:%s:%s" % (subj, predicate), obj) redis.srem("r:%s:%s" % (obj, predicate), subj) redis.srem("r:%s::%s" % (obj, subj), predicate) redis.srem("n:%s:subj" % subj, "%s:%s" % (predicate, obj)) redis.srem("n:%s:obj" % obj, "%s:%s" % (subj, predicate))
def deprecate_big_ip(ip): redis.srem('big_ip_pool', ip) redis.sadd('big_ip_dep_pool', ip)