Skip to content

Commit

Permalink
make safer update
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov-aws committed Nov 13, 2024
1 parent 754432c commit eec248e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cid/helpers/quicksight/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,21 @@ def deployed_cid_version(self) -> int:

@property
def latest(self) -> bool:
return self.latest_available_cid_version == self.deployed_cid_version
try:
return self.latest_available_cid_version == self.deployed_cid_version
except Exception as exc:
logger.debug(f'Failed to determine if latest for dashboards: {self.id}. {exc}')
return None

@property
def health(self) -> bool:
return self.status not in ['broken']

@property
def origin_type(self) -> str:
if self.deployedTemplate is not None:
if self.deployedTemplate:
return "TEMPLATE"
elif self.deployedDefinition is not None:
elif self.deployedDefinition:
return "DEFINITION"
else:
return "UNKNOWN"
Expand All @@ -101,9 +105,9 @@ def cid_version(self) -> int:

@property
def latest_available_cid_version(self) -> int:
if self.origin_type == "TEMPLATE":
if self.sourceTemplate:
return self.sourceTemplate.cid_version
elif self.origin_type == "DEFINITION":
elif self.sourceDefinition:
return self.sourceDefinition.cid_version
else:
return None
Expand Down

0 comments on commit eec248e

Please sign in to comment.