qontract-reconcile 0.10.2.dev161__py3-none-any.whl → 0.10.2.dev162__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.
- {qontract_reconcile-0.10.2.dev161.dist-info → qontract_reconcile-0.10.2.dev162.dist-info}/METADATA +2 -2
- {qontract_reconcile-0.10.2.dev161.dist-info → qontract_reconcile-0.10.2.dev162.dist-info}/RECORD +5 -5
- reconcile/utils/dynatrace/client.py +0 -31
- {qontract_reconcile-0.10.2.dev161.dist-info → qontract_reconcile-0.10.2.dev162.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.2.dev161.dist-info → qontract_reconcile-0.10.2.dev162.dist-info}/entry_points.txt +0 -0
{qontract_reconcile-0.10.2.dev161.dist-info → qontract_reconcile-0.10.2.dev162.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.2.
|
3
|
+
Version: 0.10.2.dev162
|
4
4
|
Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
|
5
5
|
Project-URL: homepage, https://github.com/app-sre/qontract-reconcile
|
6
6
|
Project-URL: repository, https://github.com/app-sre/qontract-reconcile
|
@@ -20,7 +20,7 @@ Requires-Dist: croniter<1.1.0,>=1.0.15
|
|
20
20
|
Requires-Dist: dateparser~=1.1.7
|
21
21
|
Requires-Dist: deepdiff==6.7.1
|
22
22
|
Requires-Dist: dnspython~=2.1
|
23
|
-
Requires-Dist: dt==1.1.
|
23
|
+
Requires-Dist: dt==1.1.73
|
24
24
|
Requires-Dist: filetype~=1.2.0
|
25
25
|
Requires-Dist: gql==3.1.0
|
26
26
|
Requires-Dist: hvac<0.8.0,>=0.7.0
|
{qontract_reconcile-0.10.2.dev161.dist-info → qontract_reconcile-0.10.2.dev162.dist-info}/RECORD
RENAMED
@@ -691,7 +691,7 @@ reconcile/utils/clusterhealth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
691
691
|
reconcile/utils/clusterhealth/providerbase.py,sha256=DXomGYogckBLqWtXn0PXU0hWYxB6K0F7ernldrkHhVY,1140
|
692
692
|
reconcile/utils/clusterhealth/telemeter.py,sha256=PllSLsJXvGNatmTF4mxCNPVbDrpr_MPk0m5pWj-LT6g,1534
|
693
693
|
reconcile/utils/dynatrace/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
694
|
-
reconcile/utils/dynatrace/client.py,sha256=
|
694
|
+
reconcile/utils/dynatrace/client.py,sha256=H8EjqmZlB1a2ionAjV8_R1ozs9lWbmPCYKLe0J8kZAs,2838
|
695
695
|
reconcile/utils/glitchtip/__init__.py,sha256=FT6iBhGqoe7KExFdbgL8AYUb64iW_4snF5__Dcl7yt0,258
|
696
696
|
reconcile/utils/glitchtip/client.py,sha256=F_x18QMHfeNoS3vS_VvjVm1IKnwGOsXvopjR9iwj4aY,8948
|
697
697
|
reconcile/utils/glitchtip/models.py,sha256=FyNt9EA9IS6tlsvqz-j7SkL9MoT_zIUTun0EiC9No6U,6684
|
@@ -804,7 +804,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
804
804
|
tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
|
805
805
|
tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
|
806
806
|
tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
|
807
|
-
qontract_reconcile-0.10.2.
|
808
|
-
qontract_reconcile-0.10.2.
|
809
|
-
qontract_reconcile-0.10.2.
|
810
|
-
qontract_reconcile-0.10.2.
|
807
|
+
qontract_reconcile-0.10.2.dev162.dist-info/METADATA,sha256=HuDQ0XJUu4_ZT4LGmWTJVTTnfcqy21AIo-LCxVesVYo,24627
|
808
|
+
qontract_reconcile-0.10.2.dev162.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
809
|
+
qontract_reconcile-0.10.2.dev162.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
|
810
|
+
qontract_reconcile-0.10.2.dev162.dist-info/RECORD,,
|
@@ -1,8 +1,6 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
from collections.abc import Iterable
|
4
|
-
from datetime import datetime
|
5
|
-
from unittest.mock import patch
|
6
4
|
|
7
5
|
from dynatrace import Dynatrace
|
8
6
|
from dynatrace.environment_v2.tokens_api import ApiTokenUpdate
|
@@ -35,32 +33,11 @@ class DynatraceAPIToken(BaseModel):
|
|
35
33
|
scopes: list[str]
|
36
34
|
|
37
35
|
|
38
|
-
# TODO: Remove once APPSRE-11428 is resolved #######
|
39
|
-
ISO_8601 = "%Y-%m-%dT%H:%M:%S.%fZ"
|
40
|
-
FIXED_ISO_8601 = "%Y-%m-%dT%H:%M:%SZ"
|
41
|
-
|
42
|
-
|
43
|
-
def custom_iso8601_to_datetime(timestamp: str | None) -> datetime | None:
|
44
|
-
if isinstance(timestamp, str):
|
45
|
-
try:
|
46
|
-
return datetime.strptime(timestamp, ISO_8601)
|
47
|
-
except ValueError:
|
48
|
-
return datetime.strptime(timestamp, FIXED_ISO_8601)
|
49
|
-
return timestamp
|
50
|
-
|
51
|
-
|
52
|
-
################################################
|
53
|
-
|
54
|
-
|
55
36
|
class DynatraceClient:
|
56
37
|
def __init__(self, environment_url: str, api: Dynatrace) -> None:
|
57
38
|
self._environment_url = environment_url
|
58
39
|
self._api = api
|
59
40
|
|
60
|
-
@patch(
|
61
|
-
"dynatrace.environment_v2.tokens_api.iso8601_to_datetime",
|
62
|
-
custom_iso8601_to_datetime,
|
63
|
-
)
|
64
41
|
def create_api_token(
|
65
42
|
self, name: str, scopes: Iterable[str]
|
66
43
|
) -> DynatraceAPITokenCreated:
|
@@ -72,10 +49,6 @@ class DynatraceClient:
|
|
72
49
|
) from e
|
73
50
|
return DynatraceAPITokenCreated(token=token.token, id=token.id)
|
74
51
|
|
75
|
-
@patch(
|
76
|
-
"dynatrace.environment_v2.tokens_api.iso8601_to_datetime",
|
77
|
-
custom_iso8601_to_datetime,
|
78
|
-
)
|
79
52
|
def get_token_ids_map_for_name_prefix(self, prefix: str) -> dict[str, str]:
|
80
53
|
try:
|
81
54
|
dt_tokens = self._api.tokens.list()
|
@@ -87,10 +60,6 @@ class DynatraceClient:
|
|
87
60
|
token.id: token.name for token in dt_tokens if token.name.startswith(prefix)
|
88
61
|
}
|
89
62
|
|
90
|
-
@patch(
|
91
|
-
"dynatrace.environment_v2.tokens_api.iso8601_to_datetime",
|
92
|
-
custom_iso8601_to_datetime,
|
93
|
-
)
|
94
63
|
def get_token_by_id(self, token_id: str) -> DynatraceAPIToken:
|
95
64
|
try:
|
96
65
|
token = self._api.tokens.get(token_id=token_id)
|
{qontract_reconcile-0.10.2.dev161.dist-info → qontract_reconcile-0.10.2.dev162.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|