sovereign 0.19.0__py3-none-any.whl → 0.19.1__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.
Potentially problematic release.
This version of sovereign might be problematic. Click here for more details.
- sovereign/context.py +18 -13
- {sovereign-0.19.0.dist-info → sovereign-0.19.1.dist-info}/METADATA +1 -1
- {sovereign-0.19.0.dist-info → sovereign-0.19.1.dist-info}/RECORD +6 -6
- {sovereign-0.19.0.dist-info → sovereign-0.19.1.dist-info}/LICENSE.txt +0 -0
- {sovereign-0.19.0.dist-info → sovereign-0.19.1.dist-info}/WHEEL +0 -0
- {sovereign-0.19.0.dist-info → sovereign-0.19.1.dist-info}/entry_points.txt +0 -0
sovereign/context.py
CHANGED
|
@@ -26,10 +26,10 @@ class TemplateContext:
|
|
|
26
26
|
self.configured_context = configured_context
|
|
27
27
|
self.crypto = encryption_suite
|
|
28
28
|
self.disabled_suite = disabled_suite
|
|
29
|
-
# initial load
|
|
30
|
-
self.context = self.load_context_variables()
|
|
31
29
|
self.logger = logger
|
|
32
30
|
self.stats = stats
|
|
31
|
+
# initial load
|
|
32
|
+
self.context = self.load_context_variables()
|
|
33
33
|
|
|
34
34
|
async def start_refresh_context(self) -> NoReturn:
|
|
35
35
|
if self.refresh_cron is not None:
|
|
@@ -40,21 +40,26 @@ class TemplateContext:
|
|
|
40
40
|
raise RuntimeError("Failed to start refresh_context, this should never happen")
|
|
41
41
|
|
|
42
42
|
async def refresh_context(self) -> None:
|
|
43
|
-
|
|
44
|
-
self.context = self.load_context_variables()
|
|
45
|
-
self.stats.increment("context.refresh.success")
|
|
46
|
-
# pylint: disable=broad-except
|
|
47
|
-
except Exception as e:
|
|
48
|
-
self.logger(event=e)
|
|
49
|
-
self.stats.increment("context.refresh.error")
|
|
43
|
+
self.context = self.load_context_variables()
|
|
50
44
|
|
|
51
45
|
def load_context_variables(self) -> Dict[str, Any]:
|
|
52
46
|
ret = dict()
|
|
53
47
|
for k, v in self.configured_context.items():
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
try:
|
|
49
|
+
if isinstance(v, Loadable):
|
|
50
|
+
ret[k] = v.load()
|
|
51
|
+
elif isinstance(v, str):
|
|
52
|
+
ret[k] = Loadable.from_legacy_fmt(v).load()
|
|
53
|
+
self.stats.increment(
|
|
54
|
+
"context.refresh.success",
|
|
55
|
+
tags=[f"context:{k}"],
|
|
56
|
+
)
|
|
57
|
+
except Exception as e: # pylint: disable=broad-exception-caught
|
|
58
|
+
self.logger(event=e)
|
|
59
|
+
self.stats.increment(
|
|
60
|
+
"context.refresh.error",
|
|
61
|
+
tags=[f"context:{k}"],
|
|
62
|
+
)
|
|
58
63
|
if "crypto" not in ret:
|
|
59
64
|
ret["crypto"] = self.crypto
|
|
60
65
|
return ret
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
sovereign/__init__.py,sha256=OqRozdp92NTV_6pbYNtyXsTAHxkpHTpxslhNgcrXuNY,3136
|
|
2
2
|
sovereign/app.py,sha256=z5dT5wdVNeAQap5ORRmnLpJstb1euWoj4vXZPrMttNs,4017
|
|
3
3
|
sovereign/config_loader.py,sha256=siuXN6T62Lx3JzMchnEBZ7ZDuSCFH73oWuUk-oTOVQQ,6382
|
|
4
|
-
sovereign/context.py,sha256=
|
|
4
|
+
sovereign/context.py,sha256=VswYtHZNcRMMT-Dlx9CBTxLo398uRXUPl6N--VcqybE,4411
|
|
5
5
|
sovereign/discovery.py,sha256=EIghvk_HMYp14WzEG1aQhnsoGcLXMWSrCncPobJST4c,5885
|
|
6
6
|
sovereign/error_info.py,sha256=r2KXBYq9Fo7AI2pmIpATWFm0pykr2MqfrKH0WWW5Sfk,1488
|
|
7
7
|
sovereign/logs.py,sha256=DZK6F3LMxhch96qFasdXA6NPlQHJcKbjD83_S8W6Rds,4340
|
|
@@ -40,8 +40,8 @@ sovereign/views/crypto.py,sha256=nxp6bkPU9GZw_zOk0fsJdz_XRQPXxPI6cXQDL9-cigU,204
|
|
|
40
40
|
sovereign/views/discovery.py,sha256=dPX0auMsQCCura7eIq-jEGQoS92Avs9QPAsPGDjWL5I,5902
|
|
41
41
|
sovereign/views/healthchecks.py,sha256=_WkMunlrFpqGTLgtNtRr7gCsDCv5kiuYxCyTi-dMEKM,1357
|
|
42
42
|
sovereign/views/interface.py,sha256=2wXb5Kf5CbY_X37dr1v-3Uoep04abvv8x7BaUTNqsPg,7093
|
|
43
|
-
sovereign-0.19.
|
|
44
|
-
sovereign-0.19.
|
|
45
|
-
sovereign-0.19.
|
|
46
|
-
sovereign-0.19.
|
|
47
|
-
sovereign-0.19.
|
|
43
|
+
sovereign-0.19.1.dist-info/entry_points.txt,sha256=kOn848ucVbNvtsGABDuwzOHmNiOb0Ey8dV85Z3dLv3Y,222
|
|
44
|
+
sovereign-0.19.1.dist-info/LICENSE.txt,sha256=2X125zvAb9AYLjCgdMDQZuufhm0kwcg31A8pGKj_-VY,560
|
|
45
|
+
sovereign-0.19.1.dist-info/WHEEL,sha256=vxFmldFsRN_Hx10GDvsdv1wroKq8r5Lzvjp6GZ4OO8c,88
|
|
46
|
+
sovereign-0.19.1.dist-info/METADATA,sha256=gUIo4dFBvurdReBiftpAOL1Je9CbcitbtcigturyikU,6417
|
|
47
|
+
sovereign-0.19.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|