]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Take Daemon stdin/stdout/stderr args as file objects
authorAngus Lees <gus@inodes.org>
Tue, 21 Apr 2015 01:04:33 +0000 (11:04 +1000)
committerAngus Lees <gus@inodes.org>
Fri, 15 May 2015 07:59:50 +0000 (17:59 +1000)
commit274713450c4f4cc1f5c466e153b72c9764dd96c9
tree83d5670c9f5b777dfb2b7ccea905acbe70102131
parentb13332a12ae47333248606c5a004f042265cd7bc
Take Daemon stdin/stdout/stderr args as file objects

Previously Daemon constructor took stdin/stdout/stderr as
paths (defaulting to '/dev/null') and opened them as regular files.
This greatly limits the type of filehandles supported (no pipes, for
example), and doesn't allow simple things like reusing existing fds.

This change switches to accepting file objects rather than strings,
and uses a sentinal value to represent the previous "open /dev/null"
default behaviour.

Change-Id: I51b36ce912194abd89ed46fad9943802f271444a
neutron/agent/linux/daemon.py
neutron/tests/unit/agent/linux/test_daemon.py