From 3a7a703aff6b13808d871f1305303fa2936c9b96 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 15 Nov 2015 07:59:35 -0500 Subject: [PATCH] Add three pieces of the Session interface In trying to use betamax with a keystoneauth1 Session, which interacts by mounting itself as an adapter, it became clear that our wrapping of requests.Session was incomplete in that regard. Adding an adapters property with a setter and a mount method worked and betamax is now totally usable with keystoneauth1.session. Closes-Bug:#1516382 Change-Id: I1ebc4a726bb516349714e55eb97b384ed40b42cf --- keystoneauth1/session.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/keystoneauth1/session.py b/keystoneauth1/session.py index 93ef5aad..6769523c 100644 --- a/keystoneauth1/session.py +++ b/keystoneauth1/session.py @@ -124,6 +124,17 @@ class Session(object): self._json = _JSONEncoder() + @property + def adapters(self): + return self.session.adapters + + @adapters.setter + def adapters(self, value): + self.session.adapters = value + + def mount(self, scheme, adapter): + self.session.mount(scheme, adapter) + def _remove_service_catalog(self, body): try: data = json.loads(body)