Пример #1
0
def ensure_local_data_file_exists(zk_client, zkroot):
    data_fpath = zkroot + gdata['data_path']
    if not os.path.isfile(data_fpath):
        node_path=gdata["node_path"]
        node_value = zk_utils.node_get(zk_client, node_path)
        data = json_to_dict(node_value) if node_value != None else gdata["default_data"]
        write_data_to_file(data_fpath, data)
Пример #2
0
def ensure_local_data_file_exists(zk_client, zkroot):
    data_fpath = zkroot + gdata['data_path']
    if not os.path.isfile(data_fpath):
        node_path=gdata["node_path"]
        node_value = zk_utils.node_get(zk_client, node_path)
        data = json_to_dict(node_value) if node_value != None else gdata["default_data"]
        write_data_to_file(data_fpath, data)
Пример #3
0
def write_node_value_to_file(zk_client, zkroot, node_path):
    node_value = zk_utils.node_get(zk_client, node_path)
    node_value = node_value.strip()
    if zk_utils.is_json_data(node_value):
        data = seldon_utils.json_to_dict(node_value) if node_value != None and len(node_value)>0 else ""
    else:
        data = str(node_value)
    data_fpath = zkroot + node_path + "/_data_"
    write_data_to_file(data_fpath, data)
Пример #4
0
 def write_node_value_to_file(node_path):
     node_value = zk_utils.node_get(zk_client, node_path)
     node_value = node_value.strip()
     if zk_utils.is_json_data(node_value):
         data = json_to_dict(node_value) if node_value != None and len(node_value)>0 else ""
     else:
         data = str(node_value)
     data_fpath = zkroot + node_path + "/_data_"
     write_data_to_file(data_fpath, data)
Пример #5
0
def subcmd_test(command_data):
    print "-- Testing --"
    zk_client=command_data["zkdetails"]["zk_client"]
    node_path=gdata["node_path"]+'x'
    node_value = zk_utils.node_get(zk_client, node_path)
    pp(node_value)
Пример #6
0
def subcmd_test(command_data):
    print "-- Testing --"
    zk_client = command_data["zkdetails"]["zk_client"]
    node_path = gdata["node_path"] + 'x'
    node_value = zk_utils.node_get(zk_client, node_path)
    pp(node_value)