boto3-refresh-session 0.1.17__py3-none-any.whl → 0.1.19__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- boto3_refresh_session/session.py +9 -10
- {boto3_refresh_session-0.1.17.dist-info → boto3_refresh_session-0.1.19.dist-info}/METADATA +1 -1
- boto3_refresh_session-0.1.19.dist-info/RECORD +6 -0
- boto3_refresh_session-0.1.17.dist-info/RECORD +0 -6
- {boto3_refresh_session-0.1.17.dist-info → boto3_refresh_session-0.1.19.dist-info}/LICENSE +0 -0
- {boto3_refresh_session-0.1.17.dist-info → boto3_refresh_session-0.1.19.dist-info}/WHEEL +0 -0
boto3_refresh_session/session.py
CHANGED
@@ -14,7 +14,7 @@ object.
|
|
14
14
|
"""
|
15
15
|
__all__ = ["AutoRefreshableSession"]
|
16
16
|
|
17
|
-
import
|
17
|
+
from logging import INFO, basicConfig, getLogger
|
18
18
|
from typing import Type
|
19
19
|
|
20
20
|
from attrs import define, field
|
@@ -27,13 +27,12 @@ from botocore.credentials import (
|
|
27
27
|
from botocore.session import get_session
|
28
28
|
|
29
29
|
# configuring logging
|
30
|
-
|
31
|
-
level=
|
32
|
-
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
30
|
+
basicConfig(
|
31
|
+
level=INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
33
32
|
)
|
34
33
|
|
35
34
|
# creating logger
|
36
|
-
logger =
|
35
|
+
logger = getLogger(__name__)
|
37
36
|
|
38
37
|
|
39
38
|
@define
|
@@ -137,11 +136,11 @@ class AutoRefreshableSession:
|
|
137
136
|
AWS temporary credentials.
|
138
137
|
"""
|
139
138
|
|
140
|
-
|
141
|
-
if self.defer_refresh and self._creds_already_fetched
|
142
|
-
|
143
|
-
|
144
|
-
logger.info(
|
139
|
+
# being careful not to duplicate logs
|
140
|
+
if (self.defer_refresh and self._creds_already_fetched) or (
|
141
|
+
not self.defer_refresh and self._creds_already_fetched > 1
|
142
|
+
):
|
143
|
+
logger.info("Refreshing temporary AWS credentials")
|
145
144
|
else:
|
146
145
|
self._creds_already_fetched += 1
|
147
146
|
|
@@ -0,0 +1,6 @@
|
|
1
|
+
boto3_refresh_session/__init__.py,sha256=OMY8el4qROyEvo0vr1Kv8rtFU7g3xnjHuBss54XRTEA,135
|
2
|
+
boto3_refresh_session/session.py,sha256=wxh9ZXgjrXv6ouN2vpa9ow0KrQG8-O_Jc8_6w2Fa8oo,5537
|
3
|
+
boto3_refresh_session-0.1.19.dist-info/LICENSE,sha256=I3ZYTXAjbIly6bm6J-TvFTuuHwTKws4h89QaY5c5HiY,1067
|
4
|
+
boto3_refresh_session-0.1.19.dist-info/METADATA,sha256=kt5tDN6mR3zr_lwhCkTlOXg-zxtdX5oUJvh3vyWBz_k,4463
|
5
|
+
boto3_refresh_session-0.1.19.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
6
|
+
boto3_refresh_session-0.1.19.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
boto3_refresh_session/__init__.py,sha256=OMY8el4qROyEvo0vr1Kv8rtFU7g3xnjHuBss54XRTEA,135
|
2
|
-
boto3_refresh_session/session.py,sha256=DC12GTqyuoCE1UVpQnYQ870S3yp2x7RZNdX-wtxk5ok,5518
|
3
|
-
boto3_refresh_session-0.1.17.dist-info/LICENSE,sha256=I3ZYTXAjbIly6bm6J-TvFTuuHwTKws4h89QaY5c5HiY,1067
|
4
|
-
boto3_refresh_session-0.1.17.dist-info/METADATA,sha256=ctmV-A0UiknIiwGfA4jgjDbFNuTQN3C86vLf4Epi0CM,4463
|
5
|
-
boto3_refresh_session-0.1.17.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
6
|
-
boto3_refresh_session-0.1.17.dist-info/RECORD,,
|
File without changes
|
File without changes
|