(caller, params, sender)
return executor.apply()
This is the remote function used for mitogen calls
This is the remote function used for mitogen calls
This is the remote function used for mitogen calls
def remote_fn(caller, params, sender):
    """
    This is the remote function used for mitogen calls
    """
    
    # FIXME: REFACTOR: we have a bit of a growing inconsistency between what is a constructor parameter and what is passed around in Context.
    # we should change this to have context objects that have more meat, but also get passed around versus acting globally, and smaller
    # function signatures across the board.

    import dill
    from opsmop.core.executor import Executor

    print("HI!")
    params = dill.loads(zlib.decompress(params))

    host = params['host']
    policy = params['policy']
    role = params['role']
    mode = params['mode']
    checksums = params['checksums']
    relative_root = params['relative_root']
    hostvars = params['hostvars']
    extra_vars = params['extra_vars']

    Context().set_mode(mode)
    Context().set_caller(caller)
    #assert relative_root is not None
    Context().set_checksums(checksums)

    Context().update_globals(hostvars)

    policy.roles = Roles(role)

    Callbacks().set_callbacks([ EventStreamCallbacks(sender=sender), LocalCliCallbacks(), CommonCallbacks() ])
    executor = Executor([ policy ], local_host=host, push=False, extra_vars=extra_vars, relative_root=relative_root) 
    # remove single_role
    # FIXME: needs to send mode over (check/apply)
    return executor.apply()
def remote_fn ( caller , params , sender ) : # FIXME: REFACTOR: we have a bit of a growing inconsistency between what is a constructor parameter and what is passed around in Context. # we should change this to have context objects that have more meat, but also get passed around versus acting globally, and smaller # function signatures across the board. import dill from opsmop . core . executor import Executor print ( "HI!" ) params = dill . loads ( zlib . decompress ( params ) ) host = params [ 'host' ] policy = params [ 'policy' ] role = params [ 'role' ] mode = params [ 'mode' ] checksums = params [ 'checksums' ] relative_root = params [ 'relative_root' ] hostvars = params [ 'hostvars' ] extra_vars = params [ 'extra_vars' ] Context ( ) . set_mode ( mode ) Context ( ) . set_caller ( caller ) #assert relative_root is not None Context ( ) . set_checksums ( checksums ) Context ( ) . update_globals ( hostvars ) policy . roles = Roles ( role ) Callbacks ( ) . set_callbacks ( [ EventStreamCallbacks ( sender = sender ) , LocalCliCallbacks ( ) , CommonCallbacks ( ) ] ) executor = Executor ( [ policy ] , local_host = host , push = False , extra_vars = extra_vars , relative_root = relative_root ) # remove single_role # FIXME: needs to send mode over (check/apply) return executor . apply ( )