Skip to content

Commit

Permalink
Merge branch '6/edge' into fix/shard-transient-incorrect-status
Browse files Browse the repository at this point in the history
  • Loading branch information
Gu1nness authored Oct 3, 2024
2 parents e7449c3 + 0a16ca2 commit e523e29
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/charms/mongodb/v1/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 11
LIBPATCH = 12

# path to store mongodb ketFile
KEY_FILE = "keyFile"
Expand Down Expand Up @@ -89,7 +89,7 @@ def get_create_user_cmd(config: MongoConfiguration, mongo_path=MONGO_SHELL) -> L
"mongodb://localhost/admin",
"--quiet",
"--eval",
"db.createUser({"
'"db.createUser({'
f" user: '{config.username}',"
" pwd: passwordPrompt(),"
" roles:["
Expand All @@ -99,7 +99,7 @@ def get_create_user_cmd(config: MongoConfiguration, mongo_path=MONGO_SHELL) -> L
" ],"
" mechanisms: ['SCRAM-SHA-256'],"
" passwordDigestor: 'server',"
"})",
'})"',
]


Expand All @@ -118,7 +118,7 @@ def get_mongos_args(
binding_ips = (
"--bind_ip_all"
if external_connectivity
else f"--bind_ip {MONGODB_COMMON_DIR}/var/mongodb-27018.sock --filePermissions 755"
else f"--bind_ip {MONGODB_COMMON_DIR}/var/mongodb-27018.sock --filePermissions 0766"
)

# mongos running on the config server communicates through localhost
Expand Down
6 changes: 3 additions & 3 deletions lib/charms/mongodb/v1/shards_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 10
LIBPATCH = 11

KEYFILE_KEY = "key-file"
HOSTS_KEY = "host"
Expand Down Expand Up @@ -557,7 +557,7 @@ def __init__(
super().__init__(charm, self.relation_name)

self.framework.observe(
charm.on[self.relation_name].relation_joined, self._on_relation_joined
charm.on[self.relation_name].relation_created, self.relation_created
)
self.framework.observe(
charm.on[self.relation_name].relation_changed, self._on_relation_changed
Expand Down Expand Up @@ -687,7 +687,7 @@ def sync_cluster_passwords(
# after updating the password of the backup user, restart pbm with correct password
self.charm._connect_pbm_agent()

def _on_relation_joined(self, event: RelationJoinedEvent):
def relation_created(self, event: RelationJoinedEvent):
"""Sets status and flags in relation data relevant to sharding."""
# if re-using an old shard, re-set flags.
self.charm.unit_peer_data["drained"] = json.dumps(False)
Expand Down
2 changes: 1 addition & 1 deletion src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Config:
MONGOD_CONF_DIR = f"{MONGODB_SNAP_DATA_DIR}/etc/mongod"
MONGOD_CONF_FILE_PATH = f"{MONGOD_CONF_DIR}/mongod.conf"
CHARM_INTERNAL_VERSION_FILE = "charm_internal_version"
SNAP_PACKAGES = [("charmed-mongodb", "6/edge", 121)]
SNAP_PACKAGES = [("charmed-mongodb", "6/edge", 123)]

MONGODB_COMMON_PATH = Path("/var/snap/charmed-mongodb/common")

Expand Down

0 comments on commit e523e29

Please sign in to comment.