2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00

vlog: Fix "/dev/log" test

commit 7905aae3fc
("vlog: Don't fail syslog initialization in chroot.")
uses os.path.isfile("/dev/log"), which tests if the given path
is a regular file, to see if syslog can be usable.

However, /dev/log is not a regular file for platforms I looked at.
    * On Ubuntu 14.04 and CentOS 6.5, /dev/log is a socket
    * On NetBSD-6, /dev/log is a symlink to a socket

Replace the test with os.path.exists() so that it can work
as intended for these platforms.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
This commit is contained in:
YAMAMOTO Takashi
2015-02-02 11:57:05 +09:00
parent 115f248163
commit c1419aa1d8

View File

@@ -295,7 +295,7 @@ class Vlog:
logger = logging.getLogger('syslog')
# If there is no infrastructure to support python syslog, increase
# the logging severity level to avoid repeated errors.
if not os.path.isfile("/dev/log"):
if not os.path.exists("/dev/log"):
logger.setLevel(logging.CRITICAL)
return