[svn r62984] allow for host to go down if it didn't go up yet
--HG-- branch : trunk
This commit is contained in:
parent
3815c1afc9
commit
009ac242c6
|
@ -170,7 +170,11 @@ class DSession(Session):
|
|||
self.host2pending[host] = []
|
||||
|
||||
def removehost(self, host):
|
||||
try:
|
||||
pending = self.host2pending.pop(host)
|
||||
except KeyError:
|
||||
# this happens if we didn't receive a hostup event yet
|
||||
return []
|
||||
for item in pending:
|
||||
del self.item2host[item]
|
||||
return pending
|
||||
|
|
|
@ -47,7 +47,8 @@ class TestDSession:
|
|||
pending = session.removehost(host)
|
||||
assert pending == [item]
|
||||
assert item not in session.item2host
|
||||
py.test.raises(Exception, "session.removehost(host)")
|
||||
l = session.removehost(host)
|
||||
assert not l
|
||||
|
||||
def test_senditems_removeitems(self, testdir):
|
||||
item = testdir.getitem("def test_func(): pass")
|
||||
|
|
Loading…
Reference in New Issue