Skip to content

Commit 7aba973

Browse files
Remove redundant upgrade check (#234)
`KeyError` will never be raised because of assertion on previous line
1 parent 4c88418 commit 7aba973

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/upgrade.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,7 @@ def unit_state(self, value: UnitState) -> None:
7878
def is_compatible(self) -> bool:
7979
"""Whether upgrade is supported from previous versions"""
8080
assert self.versions_set
81-
try:
82-
previous_version_strs: typing.Dict[str, str] = json.loads(
83-
self._app_databag["versions"]
84-
)
85-
except KeyError as exception:
86-
logger.debug("`versions` missing from peer relation", exc_info=exception)
87-
return False
81+
previous_version_strs: typing.Dict[str, str] = json.loads(self._app_databag["versions"])
8882
# TODO charm versioning: remove `.split("+")` (which removes git hash before comparing)
8983
previous_version_strs["charm"] = previous_version_strs["charm"].split("+")[0]
9084
previous_versions: typing.Dict[str, poetry_version.Version] = {

0 commit comments

Comments
 (0)