Flush tokens on instance delete

Force console auth service to flush all tokens
associated with an instance when it is deleted.
This will fix bug 1125378, where the console for
the wrong instance can be connected to via the
console if the correct circumstances occur. This
change also adds a call to validate the token
when it is used. This check will ensure that all
tokens are valid for their target instances.
Tokens can become scrambled when a compute node is
restarted, because the virt driver may not
assign ports in the same way.

Change-Id: I0d83ec6c4dbfef1af912a200ee15f8052f72da96
fixes: bug 1125378
This commit is contained in:
John Herndon
2013-02-19 22:53:49 +00:00
parent 5e3df86088
commit b5a882de60

View File

@@ -83,3 +83,8 @@ class Client(object):
new_value = int(value) + delta
self.cache[key] = (self.cache[key][0], str(new_value))
return new_value
def delete(self, key, time=0):
"""Deletes the value associated with a key."""
if key in self.cache:
del self.cache[key]