boto3-refresh-session 0.1.15__tar.gz → 0.1.16__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: boto3-refresh-session
3
- Version: 0.1.15
3
+ Version: 0.1.16
4
4
  Summary: A simple Python package for refreshing boto3 sessions automatically.
5
5
  License: MIT
6
6
  Keywords: boto3,botocore,aws
@@ -14,6 +14,7 @@ object.
14
14
  """
15
15
  __all__ = ["AutoRefreshableSession"]
16
16
 
17
+ from logging import getLogger
17
18
  from typing import Type
18
19
 
19
20
  from attrs import define, field
@@ -25,6 +26,9 @@ from botocore.credentials import (
25
26
  )
26
27
  from botocore.session import get_session
27
28
 
29
+ logger = getLogger(__name__)
30
+ has_logged = False
31
+
28
32
 
29
33
  @define
30
34
  class AutoRefreshableSession:
@@ -124,6 +128,12 @@ class AutoRefreshableSession:
124
128
  AWS temporary credentials.
125
129
  """
126
130
 
131
+ global has_logged
132
+ logger.info(
133
+ f"{'Fetching' if not has_logged else 'Refreshing'} temporary AWS credentials"
134
+ )
135
+ has_logged = True
136
+
127
137
  __sts_client = client(
128
138
  service_name="sts", region_name=self.region, **self.client_kwargs
129
139
  )
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "boto3-refresh-session"
3
- version = "0.1.15"
3
+ version = "0.1.16"
4
4
  description = "A simple Python package for refreshing boto3 sessions automatically."
5
5
  authors = [
6
6
  {name = "Mike Letts",email = "lettsmt@gmail.com"}