Skip to content

Commit

Permalink
fix(deployment): raises exception when package depends not found
Browse files Browse the repository at this point in the history
This commit fixes the issue where unhelpful error message is displayed
when a package depends referenced in a deployment manifest is not
found.

Wrike Ticket: https://www.wrike.com/open.htm?id=1237582859
  • Loading branch information
pallabpain committed Jan 22, 2024
1 parent 315bf70 commit a67d066
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions riocli/deployment/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ def find_object(self, client: Client) -> typing.Any:
return obj if guid else False

def create_object(self, client: Client, **kwargs) -> typing.Any:
pkg_guid, pkg = self.rc.find_depends(self.metadata.depends,
self.metadata.depends.version)
pkg_guid, pkg = self.rc.find_depends(
self.metadata.depends,
self.metadata.depends.version)

if pkg_guid:
pkg = client.get_package(pkg_guid)

if not pkg:
raise ValueError('package not found: {}'.format(self.metadata.depends))

pkg.update()

default_plan = pkg['plans'][0]
Expand Down

0 comments on commit a67d066

Please sign in to comment.