def delete_rule(typeid): p = '%s/%s' % (RULES_PATH, typeid) zk = get_zk() if zk.exists(p): zk.delete(p)
def set_rule(typeid, content): p = '%s/%s' % (RULES_PATH, typeid) zk = get_zk() zk.ensure_path(p) zk.set(p, content)