Hi Airflow experts,

I am trying to set a branch operator which will be executed another one branch 
at a time in one Dag, the codes looks like this,

bbt_migrate_vm = DummyOperator()
bbt_migrate_vm_back = DummyOperator()

def migrate_choice():
    is_even = Variable.get("is_even")
    if is_even == "True":
        Variable.set("is_even", "False")
        return "bbt_migrate_vm_back"
    else:
        Variable.set("is_even", "True")
        return "bbt_migrate_vm"

But the problem is, I still need to check the previous status of the last 
iteration, say for example, when I execute bbt_migrate_vm_back, I need to check 
the status of previous bbt_might_vm in last run is pass, how should I achieve 
that?

Larry

Reply via email to