def configure_runsudo(env):
    env.is_local = env.hosts == ["localhost"]
    if env.is_local:
        env.safe_put = local_put
        env.safe_sed = local_sed
        env.safe_comment = local_comment
        env.safe_contains = local_contains
        env.safe_append = local_append
        env.safe_exists = local_exists
        env.safe_run = run_local()
        env.safe_run_output = run_local(capture=True)
    else:
        env.safe_put = put
        env.safe_sed = sed
        env.safe_comment = comment
        env.safe_contains = contains
        env.safe_append = append
        env.safe_exists = exists
        env.safe_run = run
        env.safe_run_output = run_output
    if isinstance(getattr(env, "use_sudo", "true"), basestring):
        if getattr(env, "use_sudo", "true").lower() in ["true", "yes"]:
            env.use_sudo = True
            if env.is_local:
                env.safe_sudo = run_local(True)
            else:
                env.safe_sudo = sudo
        else:
            env.use_sudo = False
            if env.is_local:
                env.safe_sudo = run_local()
            else:
                env.safe_sudo = run
Call the given callback when the Broker connects.
dataset/ETHPy150Open chapmanb/cloudbiolinux/cloudbio/fabutils.py/configure_runsudo--crossover with--dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/spread/pb.py/Broker.notifyOnConnect