When OVS unit tests are run inside chroot environment,
there is no syslog infrastructure available. In a
situation like that, don't fail or log additional messages.

Signed-off-by: Gurucharan Shetty <[email protected]>
---
 python/ovs/vlog.py |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/python/ovs/vlog.py b/python/ovs/vlog.py
index 5690924..59318c9 100644
--- a/python/ovs/vlog.py
+++ b/python/ovs/vlog.py
@@ -287,6 +287,11 @@ class Vlog:
     def add_syslog_handler(facility=None):
         global syslog_facility, syslog_handler
 
+        # If there is no infrastructure to support python syslog, there
+        # is nothing to do (This is specially true inside chroot).
+        if not os.path.isfile("/dev/log"):
+            return
+
         # If handler is already added and there is no change in 'facility',
         # there is nothing to do.
         if (not facility or facility == syslog_facility) and syslog_handler:
-- 
1.7.9.5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to