From d7103e97cc1dcaf73126a041af4a481f595a2ec5 Mon Sep 17 00:00:00 2001 From: Neha Oudin Date: Mon, 30 Sep 2024 12:16:56 +0200 Subject: [PATCH] fix: check for _upgrade existence --- lib/charms/mongodb/v0/upgrade_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/charms/mongodb/v0/upgrade_helpers.py b/lib/charms/mongodb/v0/upgrade_helpers.py index a97bb80d8..7a16f0a9b 100644 --- a/lib/charms/mongodb/v0/upgrade_helpers.py +++ b/lib/charms/mongodb/v0/upgrade_helpers.py @@ -33,7 +33,7 @@ # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 2 +LIBPATCH = 3 logger = logging.getLogger(__name__) @@ -692,7 +692,7 @@ def are_pre_upgrade_operations_config_server_successful(self): # again automatically on refresh (just in case the user forgot to). Disabling the balancer # can negatively impact the cluster, so we only disable it once the upgrade sequence has # begun. - if self._upgrade.in_progress: + if self._upgrade and self._upgrade.in_progress: try: self.turn_off_and_wait_for_balancer() except BalancerStillRunningError: