Skip to content
This repository was archived by the owner on Oct 31, 2019. It is now read-only.

Commit a945dfd

Browse files
Give warning for missing pool and continue
1 parent 22f85e0 commit a945dfd

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

Puli/src/octopus/dispatcher/db/pulidb.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -758,11 +758,14 @@ def restoreStateFromDb(self, tree, rnsAlreadyLoaded):
758758
for num, dbPoolShare in enumerate(poolShares):
759759
id, poolId, nodeId, maxRN, archived = dbPoolShare
760760
#FIXME temp
761-
if nodeId in nodesById.keys():
762-
realPoolShare = PoolShare(id,
763-
poolsById[poolId],
764-
nodesById[nodeId],
765-
maxRN)
761+
if not poolId in poolsById.keys():
762+
print "%s !!! Warning: PoolShare %d references nonexisting pool ID (%d)" % (time.strftime('[%H:%M:%S]', time.gmtime(time.time() - begintime)),id,poolId)
763+
else:
764+
if nodeId in nodesById.keys():
765+
realPoolShare = PoolShare(id,
766+
poolsById[poolId],
767+
nodesById[nodeId],
768+
maxRN)
766769
tree.poolShares[realPoolShare.id] = realPoolShare
767770

768771
print "%s -- poolshares complete --" % (time.strftime('[%H:%M:%S]', time.gmtime(time.time() - begintime)))

0 commit comments

Comments
 (0)