Merge "Drop redundant check of sqlite3 module availability"

This commit is contained in:
Zuul
2025-07-10 15:27:15 +00:00
committed by Gerrit Code Review
2 changed files with 3 additions and 22 deletions

View File

@@ -1742,10 +1742,9 @@ One main configuration file option affects the image cache.
be :ref:`migrated <sqlite-to-centralized_db-migration>` to
central database on service restart during upgrade process.
The ``sqlite`` cache driver has no special dependencies, other
than the ``python-sqlite3`` library, which is installed on virtually
all operating systems with modern versions of Python. It stores
information about the cached files in a SQLite database.
The ``sqlite`` cache driver has no special dependencies, and uses
the built-in ``sqlite3`` module. It stores information about the cached
files in a SQLite database.
**NOTE**
In Caracal release ``sqlite`` cache driver has been deprecated and will

View File

@@ -619,26 +619,8 @@ class TestImageCacheSqlite(test_utils.BaseTestCase,
"""Tests image caching when SQLite is used in cache"""
def setUp(self):
"""
Test to see if the pre-requisites for the image cache
are working (python-sqlite3 installed)
"""
super(TestImageCacheSqlite, self).setUp()
if getattr(self, 'disable', False):
return
if not getattr(self, 'inited', False):
try:
import sqlite3 # noqa
except ImportError:
self.inited = True
self.disabled = True
self.disabled_message = ("python-sqlite3 not installed.")
return
self.inited = True
self.disabled = False
self.cache_dir = self.useFixture(fixtures.TempDir()).path
self.config(image_cache_dir=self.cache_dir,
image_cache_driver='sqlite',