'Helper method to patch g.live_config (with cleanup).'

def patch_liveconfig(self, k, v):

    def cleanup(orig=g.live_config[k]):
        g.live_config[k] = orig
    g.live_config[k] = v
    self.addCleanup(cleanup)
