Skip to content

Commit

Permalink
Set ActiveStatus by default after version checking
Browse files Browse the repository at this point in the history
Prevents a charm from getting stuck in WaitingStatus
  • Loading branch information
knkski committed Apr 26, 2021
1 parent 2f91eab commit f74e0f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def __init__(self, *args):
return
self.log = logging.getLogger(__name__)
self.image = OCIImageResource(self, "oci-image")

try:
self.interfaces = get_interfaces(self)
except NoVersionsListed as err:
Expand All @@ -49,6 +50,9 @@ def __init__(self, *args):
except NoCompatibleVersions as err:
self.model.unit.status = BlockedStatus(str(err))
return
else:
self.model.unit.status = ActiveStatus()

self._stored.set_default(username="admin")
self._stored.set_default(
password="".join(random.choices(string.ascii_letters, k=30))
Expand Down

0 comments on commit f74e0f0

Please sign in to comment.