SwiftService ctor does not allow passing a Session object

Bug #1843904 reported by Andrew Berezovskiy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
New
Undecided
Unassigned

Bug Description

In order to use SwiftService with an alternative auth mechanism (v3applicationcredential, also tracked in https://bugs.launchpad.net/python-keystoneclient/+bug/1843903). The particular error was reported in https://bugs.launchpad.net/python-swiftclient/+bug/1843901 but this bug report specifically relates to the fact that SwiftService is constructing a Connection itself, without allowing a Session object to be passed (which would be subsequently passed to the Connection ctor).

Revision history for this message
Andrew Berezovskiy (an9rew) wrote :

This is how I patched the SwiftService for the time being:

class SwiftConnectionService(SwiftService):
    def __init__(self, connection, options=None):
        """
        Override the manager before it's used
        """
        SwiftService.__init__(self, options=options)
        def create_connection():
            return connection
        # clean up the resources
        self.thread_manager.__exit__(None, None, None)
        self.thread_manager = MultiThreadingManager(
            create_connection,
            segment_threads=self._options['segment_threads'],
            object_dd_threads=self._options['object_dd_threads'],
            object_uu_threads=self._options['object_uu_threads'],
            container_threads=self._options['container_threads']
        )

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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