Skip to content

Commit

Permalink
UDN: add wait_for_network_ready (#2265)
Browse files Browse the repository at this point in the history
* UDN: add wait_for_network_ready

* Add missing typing and docstring
  • Loading branch information
myakove authored Jan 14, 2025
1 parent b96f3b4 commit 9b1abb0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ocp_resources/user_defined_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@ def to_dict(self) -> None:

# End of generated code

def wait_for_network_ready(self, timeout: int = 30) -> None:
"""
Wait for the network to be ready.
Args:
timeout (int, optional): Maximum time to wait in seconds. Defaults to 30.
Raises:
TimeoutExpiredError: If the network is not ready within the specified timeout.
"""
self.wait_for_condition(
condition=self.Condition.NETWORK_READY,
status=self.Condition.Status.TRUE,
timeout=timeout,
)


class Layer2UserDefinedNetwork(UserDefinedNetwork):
"""
Expand Down
1 change: 1 addition & 0 deletions ocp_resources/utils/resource_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Condition:
RECONCILE_COMPLETE: str = "ReconcileComplete"
READY: str = "Ready"
FAILING: str = "Failing"
NETWORK_READY = "NetworkReady"

class Status:
TRUE: str = "True"
Expand Down

0 comments on commit 9b1abb0

Please sign in to comment.