Esempio n. 1
0
def sync_smr_memlog(smr_base_port):
    puts(magenta("Sync SMR memlog. PORT:%d" % smr_base_port))

    # Check memlog
    if exist_smr_memlog(smr_base_port) == False:
        warn(red("[%s] SMR memlog doesn't exist. Aborting..." % env.host_string))
        return False

    # Sync memlog
    smr_log_path = util.make_smr_log_path_str(smr_base_port)
    if smr_logutil("synclog %s" % smr_log_path) == False:
        warn("[%s] Sync memlog fail. Aborting..." % env.host_string)
        return False

    return True
Esempio n. 2
0
def exist_smr_memlog(smr_base_port):
    puts(magenta("Does SMR memlog exist?"))

    # Check smr log path
    smr_log_path = util.make_smr_log_path_str(smr_base_port)
    if path_exist(smr_log_path) == False:
        warn("[%s] SMR log path doesn't exist. Aborting..." % env.host_string)
        return False

    # Check memlog
    file_path = smr_log_path + "/" + "master-log"
    if exists(file_path) == True:
        puts("SMR memlog exists.\n")
        return True
    else:
        puts("SMR memlog doesn't exist.\n")
        return False
Esempio n. 3
0
def exist_smr_memlog(smr_base_port):
    puts(magenta("Does SMR memlog exist?"))

    # Check smr log path
    smr_log_path = util.make_smr_log_path_str(smr_base_port)
    if path_exist(smr_log_path) == False:
        warn("[%s] SMR log path doesn't exist. Aborting..." % env.host_string)
        return False

    # Check memlog
    file_path = smr_log_path + "/" + "master-log"
    if exists(file_path) == True:
        puts("SMR memlog exists.\n")
        return True
    else:
        puts("SMR memlog doesn't exist.\n")
        return False
Esempio n. 4
0
def remove_smr_memlog(smr_base_port):
    puts(magenta("Remove SMR memlog. PORT:%d" % smr_base_port))

    # Chec smr log path
    smr_log_path = util.make_smr_log_path_str(smr_base_port)
    if path_exist(smr_log_path) == False:
        warn("[%s] SMR log path does not exist. Aborting..." % env.host_string)
        return False

    # Delete memlog
    if smr_logutil("deletelog %s" % smr_log_path) == False:
        warn("[%s] Delete memlog fail. Aborting..." % env.host_string)
        return False

    # Check memlog
    if exist_smr_memlog(smr_base_port) == True:
        warn(red("[%s] Delete smr memlog fail. Aborting...") % env.host_string)
        return False

    return True
Esempio n. 5
0
def create_smr_memlog(smr_base_port):
    puts(magenta("Create SMR memlog. PORT:%d" % smr_base_port))

    # Check smr log path
    smr_log_path = util.make_smr_log_path_str(smr_base_port)
    if path_exist(smr_log_path) == False:
        warn("[%s] SMR log path doesn't exist. Aborting..." % env.host_string)
        return False

    # Create memlog
    if smr_logutil("createlog %s" % smr_log_path) == False:
        warn("[%s] Create memlog fail. Aborting..." % env.host_string)
        return False

    # Check memlog
    if exist_smr_memlog(smr_base_port) == False:
        warn(red("[%s] Create smr memlog fail. Aborting..." % env.host_string))
        return False

    return True
Esempio n. 6
0
def remove_smr_memlog(smr_base_port):
    puts(magenta("Remove SMR memlog. PORT:%d" % smr_base_port))

    # Chec smr log path
    smr_log_path = util.make_smr_log_path_str(smr_base_port)
    if path_exist(smr_log_path) == False:
        warn("[%s] SMR log path does not exist. Aborting..." % env.host_string)
        return False

    # Delete memlog
    if smr_logutil("deletelog %s" % smr_log_path) == False:
        warn("[%s] Delete memlog fail. Aborting..." % env.host_string)
        return False

    # Check memlog
    if exist_smr_memlog(smr_base_port) == True:
        warn(red("[%s] Delete smr memlog fail. Aborting...") % env.host_string)
        return False

    return True
Esempio n. 7
0
def create_smr_memlog(smr_base_port):
    puts(magenta("Create SMR memlog. PORT:%d" % smr_base_port))

    # Check smr log path
    smr_log_path = util.make_smr_log_path_str(smr_base_port)
    if path_exist(smr_log_path) == False:
        warn("[%s] SMR log path doesn't exist. Aborting..." % env.host_string)
        return False

    # Create memlog
    if smr_logutil("createlog %s" % smr_log_path) == False:
        warn("[%s] Create memlog fail. Aborting..." % env.host_string)
        return False

    # Check memlog
    if exist_smr_memlog(smr_base_port) == False:
        warn(red("[%s] Create smr memlog fail. Aborting..." % env.host_string))
        return False

    return True