def prompt_for_master_pwd(self, node, cookie, password, cb_cfg_path):
    ns_server_ebin_path = os.path.join(CB_LIB_PATH, 'ns_server', 'erlang', 'lib', 'ns_server', 'ebin')
    babystr_ebin_path = os.path.join(CB_LIB_PATH, 'ns_server', 'erlang', 'lib', 'ns_babysitter', 'ebin')
    inetrc_file = os.path.join(CB_ETC_PATH, 'hosts.cfg')
    dist_cfg_file = os.path.join(cb_cfg_path, 'config', 'dist_cfg')
    if (password == ''):
        password = getpass.getpass('\nEnter master password:')
    name = 'example@example.com'
    args = ['-pa', ns_server_ebin_path, babystr_ebin_path, '-noinput', '-name', name, '-proto_dist', 'cb', '-epmd_module', 'cb_epmd', '-kernel', 'inetrc', f'"{inetrc_file}"', 'dist_config_file', f'"{dist_cfg_file}"', '-setcookie', cookie, '-run', 'encryption_service', 'remote_set_password', node, password]
    (rc, out, err) = self.run_process('erl', args)
    if (rc == 0):
        print('SUCCESS: Password accepted. Node started booting.')
    elif (rc == 101):
        print('Incorrect password.')
        self.prompt_for_master_pwd(node, cookie, '', cb_cfg_path)
    elif (rc == 102):
        _exit_if_errors(['Password was already supplied'])
    elif (rc == 103):
        _exit_if_errors(['The node is down'])
    elif (rc == 104):
        _exit_if_errors(['Incorrect password. Node shuts down.'])
    else:
        _exit_if_errors([f'Unknown error: {rc} {out}, {err}'])
def prompt_for_master_pwd(self, node, cookie, password, cb_cfg_path):
    ns_server_ebin_path = os.path.join(CB_LIB_PATH, 'ns_server', 'erlang', 'lib', 'ns_server', 'ebin')
    babystr_ebin_path = os.path.join(CB_LIB_PATH, 'ns_server', 'erlang', 'lib', 'ns_babysitter', 'ebin')
    inetrc_file = os.path.join(CB_ETC_PATH, 'hosts.cfg')
    dist_cfg_file = os.path.join(cb_cfg_path, 'config', 'dist_cfg')
    if (password == ):
        password = getpass.getpass('\nEnter master password:')
    name = 'example@example.com'
    args = ['-pa', ns_server_ebin_path, babystr_ebin_path, '-noinput', '-name', name, '-proto_dist', 'cb', '-epmd_module', 'cb_epmd', '-kernel', 'inetrc', f'"{inetrc_file}"', 'dist_config_file', f'"{dist_cfg_file}"', '-setcookie', cookie, '-run', 'encryption_service', 'remote_set_password', node, password]
    (rc, out, err) = self.run_process('erl', args)
    if (rc == 0):
        print('SUCCESS: Password accepted. Node started booting.')
    elif (rc == 101):
        print('Incorrect password.')
        self.prompt_for_master_pwd(node, cookie, , cb_cfg_path)
    elif (rc == 102):
        _exit_if_errors(['Password was already supplied'])
    elif (rc == 103):
        _exit_if_errors(['The node is down'])
    elif (rc == 104):
        _exit_if_errors(['Incorrect password. Node shuts down.'])
    else:
        _exit_if_errors([f'Unknown error: {rc} {out}, {err}'])