Commit de16d8e4 authored by Kirk Webb's avatar Kirk Webb
Browse files

Changed logic in libplab to free a node that claims to already have a valid

lease for a slice before we've _successfully_ set one up.
parent e5bf68ad
......@@ -1219,7 +1219,7 @@ class Node:
# attempts.
except xmlrpclib.Fault, e:
if e.faultString.find("already exists") != -1:
print "Lease for %s already exists!" % self.nodeid
print "Lease for %s already exists; deleting." % self.nodeid
nodeleases = tryXmlrpcCmd(nodemgr.getleases)
for mylease in nodeleases:
if mylease.find(self.slice.slicename) != -1:
......@@ -1228,8 +1228,12 @@ class Node:
raise RuntimeError, "Whoop! Couldn't find my lease " \
"even though it was supposed to be present!"
elif e.triesleft > 0:
if self._free():
raise RuntimeError, "Could not delete lingering " \
"lease for slice %s on %s" % \
(self.slice.slicename, self.nodeid)
if e.triesleft > 0:
tries = e.triesleft
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