Skip to content

Commit

Permalink
Add suppress NotFoundError to resource create (#1757) (#1759)
Browse files Browse the repository at this point in the history
Co-authored-by: Jenia Peimer <86722603+jpeimer@users.noreply.github.com>
  • Loading branch information
redhat-qe-bot1 and jpeimer committed Mar 31, 2024
1 parent 47ac683 commit 3ef6570
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ocp_resources/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def create(self, wait=False):
self.logger.info(f"Posting {hashed_res}")
self.logger.debug(f"\n{yaml.dump(hashed_res)}")
resource_ = self.api.create(body=self.res, namespace=self.namespace, dry_run=self.dry_run)
with contextlib.suppress(ForbiddenError, AttributeError):
with contextlib.suppress(ForbiddenError, AttributeError, NotFoundError):
# some resources do not support get() (no instance) or the client do not have permissions
self.initial_resource_version = self.instance.metadata.resourceVersion

Expand Down

0 comments on commit 3ef6570

Please sign in to comment.