Commit 5b34b83d authored by Daniele Kruse's avatar Daniele Kruse
Browse files

Fixed root entry fetching bug in OSDB

parent c1155150
......@@ -655,6 +655,7 @@ void OStoreDB::deleteLogicalLibrary(const SecurityIdentity& requester,
const std::string& name) {
RootEntry re(m_objectStore);
ScopedExclusiveLock rel(re);
re.fetch();
// Check we are not deleting a non-empty library
auto tpl = re.dumpTapePools();
for (auto tpp=tpl.begin(); tpp!=tpl.end(); tpp++) {
......@@ -671,7 +672,6 @@ void OStoreDB::deleteLogicalLibrary(const SecurityIdentity& requester,
throw LibraryInUse("In OStoreDB::deleteLogicalLibrary: trying to delete a library used by a tape.");
}
}
re.fetch();
re.removeLibrary(name);
re.commit();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment