Skip to content

Commit 9b1abb0

Browse files
authored
UDN: add wait_for_network_ready (#2265)
* UDN: add wait_for_network_ready * Add missing typing and docstring
1 parent b96f3b4 commit 9b1abb0

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

ocp_resources/user_defined_network.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ def to_dict(self) -> None:
6868

6969
# End of generated code
7070

71+
def wait_for_network_ready(self, timeout: int = 30) -> None:
72+
"""
73+
Wait for the network to be ready.
74+
75+
Args:
76+
timeout (int, optional): Maximum time to wait in seconds. Defaults to 30.
77+
78+
Raises:
79+
TimeoutExpiredError: If the network is not ready within the specified timeout.
80+
"""
81+
self.wait_for_condition(
82+
condition=self.Condition.NETWORK_READY,
83+
status=self.Condition.Status.TRUE,
84+
timeout=timeout,
85+
)
86+
7187

7288
class Layer2UserDefinedNetwork(UserDefinedNetwork):
7389
"""

ocp_resources/utils/resource_constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Condition:
2727
RECONCILE_COMPLETE: str = "ReconcileComplete"
2828
READY: str = "Ready"
2929
FAILING: str = "Failing"
30+
NETWORK_READY = "NetworkReady"
3031

3132
class Status:
3233
TRUE: str = "True"

0 commit comments

Comments
 (0)