Skip to content

Commit

Permalink
More robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
sed-i committed Nov 12, 2024
1 parent 712abd7 commit f5eeec2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def _command(self) -> str:

def is_command_changed(self) -> bool:
"""Compare the current command we'd issue with the one in the pebble layer."""
return self._container.get_plan().services[self._name].command != self._command()
if svc := self._container.get_plan().services.get(self._name):
return svc.command != self._command()
return True

def _on_dashboards_changed(self, _event) -> None:
logger.info("updating dashboards")
Expand Down

0 comments on commit f5eeec2

Please sign in to comment.