Decision making inside a for loop and taking certain path based on output from gathered results
问题 I would love to simplify my code, with better utilisation of for loop indexes. The goal is to change out all UP once for new UP once, which means take down each UP one and bring it up again. There should always be one in UP state while this process takes place, so I need to cover the following scenarios: up - up == delete -> create -> delete -> create down - down == delete -> create -> delete -> create up - down == delete -> create -> delete -> create down - up == delete -> create -> delete -