Exemplo n.º 1
0
    def attachAndSpawnDaemons(self, session, hostname, pid, daemon, d_argv,
                              febe_data, befe_data):
        """Invoke LMON_fe_attachAndSpawnDaemons.

        See the manpages. d_argv is a list.
        befe_data is the size of the desired buffer or None.

        """
        # Need a trailing null entry on the array.
        d_argv += [None]
        _d_argv = lmon.create_array(c_char_p, d_argv)
        if febe_data is not None:
            _febe_data = lmon.udata_serialize(febe_data)
        else:
            _febe_data = cast(None, c_void_p)
        buf = None
        if befe_data is not None:
            buf = create_string_buffer(befe_data)
            _befe_data = cast(buf, c_void_p)
        else:
            _befe_data = cast(None, c_void_p)
        lmon.call(self.lib.LMON_fe_attachAndSpawnDaemons, session, hostname,
                  pid, daemon, _d_argv, _febe_data, _befe_data)
        if befe_data:
            return lmon.udata_unserialize(buf.value)
        else:
            return None
Exemplo n.º 2
0
    def attachAndSpawnDaemons(self, session, hostname, pid, daemon, d_argv,
                              febe_data, befe_data):
        """Invoke LMON_fe_attachAndSpawnDaemons.

        See the manpages. d_argv is a list.
        befe_data is the size of the desired buffer or None.

        """
        # Need a trailing null entry on the array.
        d_argv += [None]
        _d_argv = lmon.create_array(c_char_p, d_argv)
        if febe_data is not None:
            _febe_data = lmon.udata_serialize(febe_data)
        else:
            _febe_data = cast(None, c_void_p)
        buf = None
        if befe_data is not None:
            buf = create_string_buffer(befe_data)
            _befe_data = cast(buf, c_void_p)
        else:
            _befe_data = cast(None, c_void_p)
        lmon.call(self.lib.LMON_fe_attachAndSpawnDaemons, session, hostname,
                  pid, daemon, _d_argv, _febe_data, _befe_data)
        if befe_data:
            return lmon.udata_unserialize(buf.value)
        else:
            return None
Exemplo n.º 3
0
 def launchAndSpawnDaemons(self, session, hostname, launcher, l_argv, daemon, d_argv, febe_data,
                           befe_data):
     """Invoke LMON_fe_launchAndSpawnDaemons."""
     # Need trailing null entries on the arrays.
     l_argv += [None]
     d_argv += [None]
     _l_argv = lmon.create_array(c_char_p, l_argv)
     _d_argv = lmon.create_array(c_char_p, d_argv)
     if febe_data is not None:
         _febe_data = lmon.udata_serialize(febe_data)
     else:
         _febe_data = cast(None, c_void_p)
     buf = None
     if befe_data is not None:
         buf = create_string_buffer(befe_data)
         _befe_data = cast(buf, c_void_p)
     else:
         _befe_data = cast(None, c_void_p)
     lmon.call(self.lib.LMON_fe_launchAndSpawnDaemons, session, hostname, launcher, _l_argv,
               daemon, _d_argv, _febe_data, _befe_data)
     if befe_data:
         return lmon.udata_unserialize(buf.value)
     else:
         return None
Exemplo n.º 4
0
 def launchAndSpawnDaemons(self, session, hostname, launcher, l_argv,
                           daemon, d_argv, febe_data, befe_data):
     """Invoke LMON_fe_launchAndSpawnDaemons."""
     # Need trailing null entries on the arrays.
     l_argv += [None]
     d_argv += [None]
     _l_argv = lmon.create_array(c_char_p, l_argv)
     _d_argv = lmon.create_array(c_char_p, d_argv)
     if febe_data is not None:
         _febe_data = lmon.udata_serialize(febe_data)
     else:
         _febe_data = cast(None, c_void_p)
     buf = None
     if befe_data is not None:
         buf = create_string_buffer(befe_data)
         _befe_data = cast(buf, c_void_p)
     else:
         _befe_data = cast(None, c_void_p)
     lmon.call(self.lib.LMON_fe_launchAndSpawnDaemons, session, hostname,
               launcher, _l_argv, daemon, _d_argv, _febe_data, _befe_data)
     if befe_data:
         return lmon.udata_unserialize(buf.value)
     else:
         return None
Exemplo n.º 5
0
    def init(self, argc, argv):
        """Invoke LMON_be_init.

        argc is the number of arguments in argv.
        argv is a list of arguments to pass as argv.

        """
        _argc = c_int(argc)
        # This is horribly ugly code to properly reconstruct argv for LaunchMON.
        # We stuff the arguments in string buffers (since they can be modified).
        # We stuff those into an array.
        # We add an entry at the end with a bunch of null bytes, since the last
        # argv entry is supposed to be a null and otherwise LaunchMON will make
        # malloc *very* unhappy.
        # We create a pointer to this array.
        # We pass that pointer by reference (another pointer).
        tmp_argv = [cast(create_string_buffer(x), c_char_p) for x in argv]
        tmp_argv.append(cast(create_string_buffer(32), c_char_p))
        _argv = lmon.create_array(c_char_p, tmp_argv)
        argv_ref = c_void_p(addressof(_argv))
        lmon.call(self.lib.LMON_be_init, lmon.LMON_VERSION, byref(_argc),
                  byref(argv_ref))
Exemplo n.º 6
0
    def init(self, argc, argv):
        """Invoke LMON_be_init.

        argc is the number of arguments in argv.
        argv is a list of arguments to pass as argv.

        """
        _argc = c_int(argc)
        # This is horribly ugly code to properly reconstruct argv for LaunchMON.
        # We stuff the arguments in string buffers (since they can be modified).
        # We stuff those into an array.
        # We add an entry at the end with a bunch of null bytes, since the last
        # argv entry is supposed to be a null and otherwise LaunchMON will make
        # malloc *very* unhappy.
        # We create a pointer to this array.
        # We pass that pointer by reference (another pointer).
        tmp_argv = [cast(create_string_buffer(x), c_char_p) for x in argv]
        tmp_argv.append(cast(create_string_buffer(32), c_char_p))
        _argv = lmon.create_array(c_char_p, tmp_argv)
        argv_ref = c_void_p(addressof(_argv))
        lmon.call(self.lib.LMON_be_init, lmon.LMON_VERSION, byref(_argc),
                  byref(argv_ref))