Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/storage.py
Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | def db(self): | ||||
db = self.get_db() | db = self.get_db() | ||||
yield db | yield db | ||||
finally: | finally: | ||||
if db: | if db: | ||||
self.put_db(db) | self.put_db(db) | ||||
@timed | @timed | ||||
@db_transaction() | @db_transaction() | ||||
def check_config(self, *, check_write, db=None, cur=None): | def check_config(self, *, check_write: bool, db=None, cur=None) -> bool: | ||||
if not self.objstorage.check_config(check_write=check_write): | if not self.objstorage.check_config(check_write=check_write): | ||||
return False | return False | ||||
# Check permissions on one of the tables | # Check permissions on one of the tables | ||||
if check_write: | if check_write: | ||||
check = "INSERT" | check = "INSERT" | ||||
else: | else: | ||||
▲ Show 20 Lines • Show All 1,254 Lines • Show Last 20 Lines |