Exemplo n.º 1
0
def touch_dc():
    if constants.SKIP_LVL == 1:
        return
    node = crmutils.get_dc()
    if node and node == constants.WE:
        with open(os.path.join(constants.WORKDIR, "DC"), 'w') as f:
            pass
Exemplo n.º 2
0
def before_tag(context, tag):
    # tag @clean means need to stop cluster service
    if tag == "clean":
        time.sleep(3)
        online_nodes = get_online_nodes()
        if online_nodes:
            resource_cleanup()
            while True:
                time.sleep(1)
                if utils.get_dc():
                    break
            utils.get_stdout_or_raise_error("crm cluster stop --all")
Exemplo n.º 3
0
def collect_dc_file():
    if constants.SKIP_LVL:
        return
    node = crmutils.get_dc()
    if node and node == constants.WE:
        open(os.path.join(constants.WORKDIR, "DC"), 'w')
Exemplo n.º 4
0
def step_impl(context):
    while True:
        time.sleep(1)
        if crmutils.get_dc():
            break