Skip to content

Commit f4950f8

Browse files
committed
Store fixed initial time outside loop
1 parent 2953317 commit f4950f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ocp_resources/node_network_configuration_policy.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -464,12 +464,13 @@ def _get_nncp_configured_last_transition_time(self):
464464
)
465465
def _wait_for_nncp_with_different_transition_time(self, initial_transition_time):
466466
date_format = "%Y-%m-%dT%H:%M:%SZ"
467+
formatted_initial_transition_time = datetime.strptime(initial_transition_time, date_format)
467468
for condition in self.instance.get("status", {}).get("conditions", []):
468469
if (
469470
condition
470471
and condition["type"] == NodeNetworkConfigurationPolicy.Conditions.Type.AVAILABLE
471472
and datetime.strptime(condition["lastTransitionTime"], date_format)
472-
> datetime.strptime(initial_transition_time, date_format)
473+
> formatted_initial_transition_time
473474
):
474475
return True
475476
return False

0 commit comments

Comments
 (0)