@contextmanager
def primary_disconnection_time(tconf, value):
    old_tolarate_disconnection = tconf.ToleratePrimaryDisconnection
    tconf.ToleratePrimaryDisconnection = value
    (yield tconf)
    tconf.ToleratePrimaryDisconnection = old_tolarate_disconnection
@contextmanager
def primary_disconnection_time(tconf, value):
    old_tolarate_disconnection = tconf.ToleratePrimaryDisconnection
    tconf.ToleratePrimaryDisconnection = value
    (yield tconf)
    tconf.ToleratePrimaryDisconnection = old_tolarate_disconnection