Skip to content

Commit

Permalink
revert changes on init admin user
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaAltieri committed Sep 20, 2023
1 parent 58d91fa commit 80c8bf9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def _on_secret_changed(self, event: SecretChangedEvent):
before=before_log(logger, logging.DEBUG),
)
def _init_operator_user(self) -> None:
"""Creates initial specified admin user.
"""Creates initial admin user for MongoDB.
Initial admin user can be created only through localhost connection.
see https://www.mongodb.com/docs/manual/core/localhost-exception/
Expand All @@ -637,10 +637,6 @@ def _init_operator_user(self) -> None:
As a result, where are only hackish ways to create initial user.
It is needed to install mongodb-clients inside charm container to make
this function work correctly.
Args:
user: User to create
mongos: whether or not the user should be created on mongos router
"""
if self._is_user_created(OperatorUser) or not self.unit.is_leader():
return
Expand Down Expand Up @@ -808,7 +804,7 @@ def _open_ports_tcp(self, ports: int) -> None:
"""Open the given port.
Args:
ports: The port to open.
ports: The ports to open.
"""
for port in ports:
try:
Expand Down

0 comments on commit 80c8bf9

Please sign in to comment.