ocs_ci/ocs/machine.py
def delete_machine_and_check_state_of_new_spinned_machine(machine_name):
    """
    Deletes a machine and checks the state of the newly spinned
    machine

    Args:
        machine_name (str): Name of the machine you want to delete

    Returns:
        bool: True in case of success, False otherwise
    """
    machine_type = get_machine_type(machine_name)
    machines = get_machines(machine_type=machine_type)
    delete_machine(machine_name)
    for machine in machines:
        if re.match(machine.name[:-6], machine_name):
            log.info(f"New spinned machine name is {machine.name}")
            new_machine = machine
            break
    if new_machine is not None:
        log.info(
            f"Checking the state of new spinned machine {new_machine.name}"
        )
        state = new_machine.get().get(
            'metadata'
        ).get('annotations').get(
            'machine.openshift.io/instance-state'
        )
        log.info(f"{new_machine.name} is in {state} state")
        return state == constants.STATUS_RUNNING.islower()
    return False

    Deletes a machine and checks the state of the newly spinned
    machine

    Args:
        machine_name (str): Name of the machine you want to delete

    Returns:
        bool: True in case of success, False otherwise
    
Deletes a machine and checks the state of the newly spinned
machine
Deletes a machine and checks the state of the newly spinned machine
def delete_machine_and_check_state_of_new_spinned_machine(machine_name):
    machine_type = get_machine_type(machine_name)
    machines = get_machines(machine_type=machine_type)
    delete_machine(machine_name)
    for machine in machines:
        if re.match(machine.name[:-6], machine_name):
            log.info(f"New spinned machine name is {machine.name}")
            new_machine = machine
            break
    if new_machine is not None:
        log.info(
            f"Checking the state of new spinned machine {new_machine.name}"
        )
        state = new_machine.get().get(
            'metadata'
        ).get('annotations').get(
            'machine.openshift.io/instance-state'
        )
        log.info(f"{new_machine.name} is in {state} state")
        return state == constants.STATUS_RUNNING.islower()
    return False
def delete_machine_and_check_state_of_new_spinned_machine ( machine_name ) : machine_type = get_machine_type ( machine_name ) machines = get_machines ( machine_type = machine_type ) delete_machine ( machine_name ) for machine in machines : if re . match ( machine . name [ : - 6 ] , machine_name ) : log . info ( f"New spinned machine name is {machine.name}" ) new_machine = machine break if new_machine is not None : log . info ( f"Checking the state of new spinned machine {new_machine.name}" ) state = new_machine . get ( ) . get ( 'metadata' ) . get ( 'annotations' ) . get ( 'machine.openshift.io/instance-state' ) log . info ( f"{new_machine.name} is in {state} state" ) return state == constants . STATUS_RUNNING . islower ( ) return False
Deletes a machine and checks the state of the newly spinned
machine
Deletes a machine and checks the state of the newly spinned machine
"""
    Deletes a machine and checks the state of the newly spinned
    machine

    Args:
        machine_name (str): Name of the machine you want to delete

    Returns:
        bool: True in case of success, False otherwise
    """
True in case of success, False otherwise
True in case of success False otherwise
bool
machine_name
Name of the machine you want to delete
Name of the machine you want to delete