summaryrefslogtreecommitdiffstats
path: root/pym/cache/metadata_overlay.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/cache/metadata_overlay.py')
-rw-r--r--pym/cache/metadata_overlay.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pym/cache/metadata_overlay.py b/pym/cache/metadata_overlay.py
index b829ea579..fc99b4011 100644
--- a/pym/cache/metadata_overlay.py
+++ b/pym/cache/metadata_overlay.py
@@ -20,9 +20,12 @@ class database(template.database):
super(database, self).__init__(location, label, auxdbkeys)
self.db_rw = db_rw(location, label, auxdbkeys, **config)
self.commit = self.db_rw.commit
- ro_config = config.copy()
- ro_config["readonly"] = True
- self.db_ro = db_ro(label, "metadata/cache", auxdbkeys, **ro_config)
+ if isinstance(db_ro, type):
+ ro_config = config.copy()
+ ro_config["readonly"] = True
+ self.db_ro = db_ro(label, "metadata/cache", auxdbkeys, **ro_config)
+ else:
+ self.db_ro = db_ro
def __getitem__(self, cpv):
"""funnel whiteout validation through here, since value needs to be fetched"""