diff --git a/src/modules/client/bootenv.py b/src/modules/client/bootenv.py index 16a33d92e..3964f8c7d 100644 --- a/src/modules/client/bootenv.py +++ b/src/modules/client/bootenv.py @@ -554,6 +554,8 @@ def activate_live_be(): release_notes=self.img.imageplan.pd.release_notes_name ) + self.img.close_databases() + if be.beUnmount(self.be_name_clone) != 0: logger.error( _( diff --git a/src/modules/client/image.py b/src/modules/client/image.py index eb4e79c19..0e2133793 100644 --- a/src/modules/client/image.py +++ b/src/modules/client/image.py @@ -4058,6 +4058,18 @@ def gen_tracked_stems(self): if a.name == "depend" and a.attrs["type"] == "group": yield (f, self.strtofmri(a.attrs["fmri"]).pkg_name) + def close_databases(self): + """Close any open connections to the image's sqlite databases""" + + if self.__actioncache is not None: + self.__actioncache.close() + self.__actioncache = None + for cat in self.__catalogs.values(): + close = getattr(cat, "close", None) + if close is not None: + close() + self.__catalogs = {} + def get_action_cache(self, progtrack=None): """Return an ActionCache open for reading and consistent with the installed package catalog, creating or updating the