Skip to content

Commit 23dec2f

Browse files
ProjectRequest to return Project on deploy (#2444) (#2448)
Co-authored-by: Ruth Netser <[email protected]>
1 parent fc5979c commit 23dec2f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

ocp_resources/project_request.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from typing import Any, Optional
44

5-
from ocp_resources.project_project_openshift_io import Project
65
from ocp_resources.resource import Resource
6+
from ocp_resources.project_project_openshift_io import Project
77

88

99
class ProjectRequest(Resource):
@@ -45,5 +45,18 @@ def to_dict(self) -> None:
4545

4646
# End of generated code
4747

48+
def deploy(self, wait: bool = False) -> Project:
49+
super().deploy(wait=wait)
50+
51+
project = Project(
52+
name=self.name,
53+
client=self.client,
54+
teardown=self.teardown,
55+
delete_timeout=self.delete_timeout,
56+
)
57+
project.wait_for_status(status=project.Status.ACTIVE)
58+
59+
return project
60+
4861
def clean_up(self, wait: bool = True, timeout: Optional[int] = None) -> bool:
4962
return Project(name=self.name, client=self.client).clean_up(wait=wait, timeout=timeout)

0 commit comments

Comments
 (0)