Use of python-swift on Ubuntu buildd fails, attempts to access /dev/log

Bug #961871 reported by Adam Gandelman
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Medium
Soren Hansen
swift (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Other openstack components may be importing python's libraries to be used in middleware during unit tests. Keystone is one such package, and its swift tests fail to build on Ubuntu buildds:

======================================================================
ERROR: test_operator_roles (test_swift_auth_middleware.SwiftAuth)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/buildd/keystone-2012.1+git201203212110/tests/test_swift_auth_middleware.py", line 84, in setUp
    self.test_auth = self.auth.filter_factory({})(FakeApp())
  File "/build/buildd/keystone-2012.1+git201203212110/keystone/middleware/swift_auth.py", line 227, in auth_filter
    return SwiftAuth(app, conf)
  File "/build/buildd/keystone-2012.1+git201203212110/keystone/middleware/swift_auth.py", line 83, in __init__
    self.logger = swift_utils.get_logger(conf, log_route='keystoneauth')
  File "/usr/lib/python2.7/dist-packages/swift/common/utils.py", line 436, in get_logger
    handler = SysLogHandler(address='/dev/log', facility=facility)
  File "/usr/lib/python2.7/logging/handlers.py", line 729, in __init__
    self._connect_unixsocket(address)
  File "/usr/lib/python2.7/logging/handlers.py", line 745, in _connect_unixsocket
    self.socket.connect(address)
  File "/usr/lib/python2.7/dist-packages/eventlet/greenio.py", line 167, in connect
    while not socket_connect(fd, address):
  File "/usr/lib/python2.7/dist-packages/eventlet/greenio.py", line 37, in socket_connect
    raise socket.error(err, errno.errorcode[err])
error: [Errno 2] ENOENT

It appears that swift unconditionally sets its logging to use syslog via /dev/log, even if (in this case) the log handlers will probably never be used. There is no way for users of library (keystone's swift_auth middleware, in this case) to specify alternative log methods, or to disable entirely. This is a problem for anyone attempting to run unit tests in a constrained environment.

Revision history for this message
James Page (james-page) wrote :
Changed in swift (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Chuck Short (zulcss)
Changed in swift (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

This is getting addressed by victor in https://review.openstack.org/#/c/7565/ hopefully this should be configurable when we have this landed. (Thanks for doing that victor).

Changed in swift:
importance: Undecided → Low
importance: Low → Medium
status: New → Confirmed
assignee: nobody → Victor Rodionov (vito-ordaz)
Revision history for this message
gholt (gholt) wrote :

The previous commit did not seem to fix this completely; Soren is working a new patch now.

Changed in swift:
assignee: Victor Rodionov (vito-ordaz) → Soren Hansen (soren)
Soren Hansen (soren)
Changed in swift:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
milestone: none → 1.7.5
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.