This is an automatically generated e-mail. To reply, visit: http://reviewboard-fedoraserver.rhcloud.com/r/127/

src/rolekit/async.py (Diff revision 3)
def input_handler(unused_fd, condition, unused_data):
285
    def demote(user_uid, user_gid):
286
        """
287
        Pass the function 'set_ids' to preexec_fn, rather than just calling
288
        setuid and setgid. This will change the ids for that subprocess only.
289
        We have to contstruct a callable that requires no arguments in order
290
        to pass it to preexec_fn.
291
        """
292

I still think this function is entirely redundant and simply saying preexec_fn = set_ids (not set_ids()) would work, but I can’t provide a tested alternative patch, so… meh.


src/rolekit/async.py (Diff revision 3)
def input_handler(unused_fd, condition, unused_data):
312
    if (uid is not None):

The parentheses are not idiomatic. Not a blocker obviously ?


tests/async_test.py (Diff revision 3)
def test_async_subprocess_signal(self):
199
    def __run_bash_commands_stdin_async(self, commands):
200
        """Demonstrating/testing use of async.subprocess_future."""
201
        args = ["/bin/bash", "-c", "; ".join(commands)]
202
        logging.debug("subprocess: starting %s" % repr(args))
203
        result = yield async.subprocess_future(args, stdin="stdin1")
204
        logging.debug("subprocess: done, got %s" % repr(result))
205
        yield result
This could be generalized to replace __run_bash_commands_async(with a stdin=None optional parameter), but this works just as well.

- Miloslav Trmac


On únor 17th, 2015, 7:57 odp. CET, Stephen Gallagher wrote:

Review request for RoleKit Mailing List, Miloslav Trmac, Stephen Gallagher, and Thomas Woerner.
By Stephen Gallagher.

Updated Úno. 17, 2015, 7:57 odp.

Repository: rolekit

Description

Add utility routine for passing stdin into subprocesses

Diffs

  • src/rolekit/async.py (0f9ddaac1beb27cebdf41ca0383a62a807c4fcb6)
  • tests/async_test.py (12a4c12c8dbf427a6382c9bc82139bf246b08c37)

View Diff