oc-cdtapi 3.21.5__py3-none-any.whl → 3.21.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- oc_cdtapi/PgQAPI.py +1 -1
- oc_cdtapi/VaultAPI.py +8 -5
- {oc_cdtapi-3.21.5.dist-info → oc_cdtapi-3.21.7.dist-info}/METADATA +1 -1
- {oc_cdtapi-3.21.5.dist-info → oc_cdtapi-3.21.7.dist-info}/RECORD +8 -8
- {oc_cdtapi-3.21.5.data → oc_cdtapi-3.21.7.data}/scripts/nexus.py +0 -0
- {oc_cdtapi-3.21.5.dist-info → oc_cdtapi-3.21.7.dist-info}/WHEEL +0 -0
- {oc_cdtapi-3.21.5.dist-info → oc_cdtapi-3.21.7.dist-info}/licenses/LICENSE +0 -0
- {oc_cdtapi-3.21.5.dist-info → oc_cdtapi-3.21.7.dist-info}/top_level.txt +0 -0
oc_cdtapi/PgQAPI.py
CHANGED
@@ -190,7 +190,7 @@ class PgQAPI (object):
|
|
190
190
|
if not queue_id:
|
191
191
|
logging.error('queue [%s] does not exist' % queue_code)
|
192
192
|
return None
|
193
|
-
ds = self.exec_select('select min(id), count(id) from queue_message where queue_type__oid = %s and status = %s', (queue_id, 'N') )
|
193
|
+
ds = self.exec_select('select min(id), count(id) from queue_message where creation_date < current_timestamp - interval \'1 minute\' and queue_type__oid = %s and status = %s', (queue_id, 'N') )
|
194
194
|
if ds[0][1] == 0:
|
195
195
|
logging.debug('currently no new messages in queue [%s]' % queue_code)
|
196
196
|
return None
|
oc_cdtapi/VaultAPI.py
CHANGED
@@ -19,18 +19,21 @@ class VaultAPI:
|
|
19
19
|
self.verify_ssl = verify_ssl
|
20
20
|
self._client = None
|
21
21
|
|
22
|
+
# Create a logger instance for this class
|
23
|
+
self.logger = logging.getLogger(__name__)
|
24
|
+
|
22
25
|
@property
|
23
26
|
def client(self):
|
24
27
|
if not self.vault_enable:
|
25
|
-
|
28
|
+
self.logger.warning("VAULT_ENABLE environment set to false, skip using vault")
|
26
29
|
return None
|
27
30
|
|
28
31
|
if self._client is None:
|
29
32
|
if not self.vault_url:
|
30
|
-
|
33
|
+
self.logger.warning("VAULT_URL environment variable or vault_url parameter is missing, skip using vault")
|
31
34
|
return None
|
32
35
|
if not self.vault_token:
|
33
|
-
|
36
|
+
self.logger.warning("VAULT_TOKEN environment variable or vault_token parameter is missing, skip using vault")
|
34
37
|
return None
|
35
38
|
|
36
39
|
self._client = hvac.Client(
|
@@ -40,7 +43,7 @@ class VaultAPI:
|
|
40
43
|
)
|
41
44
|
|
42
45
|
if not self._client.is_authenticated():
|
43
|
-
|
46
|
+
self.logger.warning("Failed to authenticate with Vault - check credentials, skip using vault")
|
44
47
|
return None
|
45
48
|
|
46
49
|
return self._client
|
@@ -69,7 +72,7 @@ class VaultAPI:
|
|
69
72
|
response = client.secrets.kv.read_secret_version(path=secret_path, mount_point=self.mount_point)
|
70
73
|
return response['data']['data'].get(credentials)
|
71
74
|
except VaultError as e:
|
72
|
-
|
75
|
+
self.logger.warning(f"Failed getting data from vault for path {secret_path} and credentials {credentials}: {e}")
|
73
76
|
return None
|
74
77
|
|
75
78
|
def load_secret(self, name, default=None):
|
@@ -7,14 +7,14 @@ oc_cdtapi/ForemanAPI.py,sha256=9r1MSOsubiSxM1sdzF2MHD7IcSwX9Y4UDJknHqQK07g,44255
|
|
7
7
|
oc_cdtapi/JenkinsAPI.py,sha256=lZ8pe3a4eb_6h53JE7QLuzOSlu7Sqatc9PQwWhio9Vg,15748
|
8
8
|
oc_cdtapi/NexusAPI.py,sha256=uU12GtHvKlWorFaPAnFcQ5AGEc94MZ5SdmfM2Pw3F7A,26122
|
9
9
|
oc_cdtapi/PgAPI.py,sha256=URSz7qu-Ir7AOj0jI3ucTXn2PM-nC96nmPZI746OLjA,14356
|
10
|
-
oc_cdtapi/PgQAPI.py,sha256=
|
10
|
+
oc_cdtapi/PgQAPI.py,sha256=q7FjC4HGotLXg-vZ2h6VcmlWAkBMdV_B37sicDaL7PU,8720
|
11
11
|
oc_cdtapi/RundeckAPI.py,sha256=O3LmcFaHSz8UqeUyIHTTEMJncDD191Utd-iZaeJay2s,24243
|
12
12
|
oc_cdtapi/TestServer.py,sha256=HV97UWg2IK4gOYAp9yaMdwFUWsw9v66MxyZdI3qQctA,2715
|
13
|
-
oc_cdtapi/VaultAPI.py,sha256=
|
13
|
+
oc_cdtapi/VaultAPI.py,sha256=P-x_PsWe_S0mGUKTCmR1KhUjdfs7GmyaltjGQcnWj_s,2967
|
14
14
|
oc_cdtapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
|
-
oc_cdtapi-3.21.
|
16
|
-
oc_cdtapi-3.21.
|
17
|
-
oc_cdtapi-3.21.
|
18
|
-
oc_cdtapi-3.21.
|
19
|
-
oc_cdtapi-3.21.
|
20
|
-
oc_cdtapi-3.21.
|
15
|
+
oc_cdtapi-3.21.7.data/scripts/nexus.py,sha256=4teqZ_KtCSrwHDJVgA7lkreteod4Xt5XJFZNbwb7E6E,6858
|
16
|
+
oc_cdtapi-3.21.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
17
|
+
oc_cdtapi-3.21.7.dist-info/METADATA,sha256=NsB5ky_LG-Wh8vAkA0okUDBpKf0tFh4BhTU7eiRTDBM,504
|
18
|
+
oc_cdtapi-3.21.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
19
|
+
oc_cdtapi-3.21.7.dist-info/top_level.txt,sha256=d4-5-D-0CSeSXYuLCP7-nIFCpjkfmJr-Y_muzds8iVU,10
|
20
|
+
oc_cdtapi-3.21.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|