osism 0.20250602.0__py3-none-any.whl → 0.20250616.0__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.
- osism/commands/baremetal.py +84 -37
- osism/commands/netbox.py +22 -5
- osism/commands/reconciler.py +6 -28
- osism/commands/sync.py +28 -1
- osism/commands/validate.py +7 -30
- osism/commands/vault.py +9 -1
- osism/commands/wait.py +8 -31
- osism/core/enums.py +1 -0
- osism/services/listener.py +1 -1
- osism/settings.py +12 -2
- osism/tasks/__init__.py +8 -40
- osism/tasks/conductor/__init__.py +61 -0
- osism/tasks/conductor/config.py +92 -0
- osism/tasks/conductor/ironic.py +343 -0
- osism/tasks/conductor/netbox.py +311 -0
- osism/tasks/conductor/sonic.py +1401 -0
- osism/tasks/conductor/utils.py +79 -0
- osism/tasks/conductor.py +15 -470
- osism/tasks/netbox.py +6 -4
- osism/tasks/reconciler.py +4 -5
- osism/utils/__init__.py +51 -4
- {osism-0.20250602.0.dist-info → osism-0.20250616.0.dist-info}/METADATA +4 -4
- {osism-0.20250602.0.dist-info → osism-0.20250616.0.dist-info}/RECORD +29 -23
- {osism-0.20250602.0.dist-info → osism-0.20250616.0.dist-info}/entry_points.txt +1 -0
- osism-0.20250616.0.dist-info/licenses/AUTHORS +1 -0
- osism-0.20250616.0.dist-info/pbr.json +1 -0
- osism-0.20250602.0.dist-info/licenses/AUTHORS +0 -1
- osism-0.20250602.0.dist-info/pbr.json +0 -1
- {osism-0.20250602.0.dist-info → osism-0.20250616.0.dist-info}/WHEEL +0 -0
- {osism-0.20250602.0.dist-info → osism-0.20250616.0.dist-info}/licenses/LICENSE +0 -0
- {osism-0.20250602.0.dist-info → osism-0.20250616.0.dist-info}/top_level.txt +0 -0
osism/utils/__init__.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# SPDX-License-Identifier: Apache-2.0
|
2
2
|
|
3
|
+
import time
|
4
|
+
import os
|
3
5
|
from cryptography.fernet import Fernet
|
4
6
|
import keystoneauth1
|
5
7
|
from loguru import logger
|
@@ -48,12 +50,12 @@ try:
|
|
48
50
|
secondary_nb_list = []
|
49
51
|
if type(secondary_nb_settings_list) is not list:
|
50
52
|
raise TypeError(
|
51
|
-
f"Setting NETBOX_SECONDARIES needs to be an array of mappings containing supported
|
53
|
+
f"Setting NETBOX_SECONDARIES needs to be an array of mappings containing supported NetBox API configuration: {supported_secondary_nb_keys}"
|
52
54
|
)
|
53
55
|
for secondary_nb_settings in secondary_nb_settings_list:
|
54
56
|
if type(secondary_nb_settings) is not dict:
|
55
57
|
raise TypeError(
|
56
|
-
f"Elements in setting NETBOX_SECONDARIES need to be mappings containing supported
|
58
|
+
f"Elements in setting NETBOX_SECONDARIES need to be mappings containing supported NetBox API configuration: {supported_secondary_nb_keys}"
|
57
59
|
)
|
58
60
|
for key in list(secondary_nb_settings.keys()):
|
59
61
|
if key not in supported_secondary_nb_keys:
|
@@ -65,14 +67,14 @@ try:
|
|
65
67
|
or not secondary_nb_settings["NETBOX_URL"]
|
66
68
|
):
|
67
69
|
raise ValueError(
|
68
|
-
"All NETBOX_URL values in the elements of setting NETBOX_SECONDARIES need to be valid
|
70
|
+
"All NETBOX_URL values in the elements of setting NETBOX_SECONDARIES need to be valid NetBox URLs"
|
69
71
|
)
|
70
72
|
if (
|
71
73
|
"NETBOX_TOKEN" not in secondary_nb_settings
|
72
74
|
or not secondary_nb_settings["NETBOX_TOKEN"]
|
73
75
|
):
|
74
76
|
raise ValueError(
|
75
|
-
"All NETBOX_TOKEN values in the elements of setting NETBOX_SECONDARIES need to be valid
|
77
|
+
"All NETBOX_TOKEN values in the elements of setting NETBOX_SECONDARIES need to be valid NetBox tokens"
|
76
78
|
)
|
77
79
|
|
78
80
|
secondary_nb_list.append(
|
@@ -134,3 +136,48 @@ def first(iterable, condition=lambda x: True):
|
|
134
136
|
"""
|
135
137
|
|
136
138
|
return next(x for x in iterable if condition(x))
|
139
|
+
|
140
|
+
|
141
|
+
def fetch_task_output(
|
142
|
+
task_id, timeout=os.environ.get("OSISM_TASK_TIMEOUT", 300), enable_play_recap=False
|
143
|
+
):
|
144
|
+
rc = 0
|
145
|
+
stoptime = time.time() + timeout
|
146
|
+
last_id = 0
|
147
|
+
while time.time() < stoptime:
|
148
|
+
data = redis.xread({str(task_id): last_id}, count=1, block=(timeout * 1000))
|
149
|
+
if data:
|
150
|
+
stoptime = time.time() + timeout
|
151
|
+
messages = data[0]
|
152
|
+
for message_id, message in messages[1]:
|
153
|
+
last_id = message_id.decode()
|
154
|
+
message_type = message[b"type"].decode()
|
155
|
+
message_content = message[b"content"].decode()
|
156
|
+
|
157
|
+
logger.debug(f"Processing message {last_id} of type {message_type}")
|
158
|
+
redis.xdel(str(task_id), last_id)
|
159
|
+
|
160
|
+
if message_type == "stdout":
|
161
|
+
print(message_content, end="")
|
162
|
+
if enable_play_recap and "PLAY RECAP" in message_content:
|
163
|
+
logger.info(
|
164
|
+
"Play has been completed. There may now be a delay until "
|
165
|
+
"all logs have been written."
|
166
|
+
)
|
167
|
+
logger.info("Please wait and do not abort execution.")
|
168
|
+
elif message_type == "rc":
|
169
|
+
rc = int(message_content)
|
170
|
+
elif message_type == "action" and message_content == "quit":
|
171
|
+
redis.close()
|
172
|
+
return rc
|
173
|
+
raise TimeoutError
|
174
|
+
|
175
|
+
|
176
|
+
def push_task_output(task_id, line):
|
177
|
+
redis.xadd(task_id, {"type": "stdout", "content": line})
|
178
|
+
|
179
|
+
|
180
|
+
def finish_task_output(task_id, rc=None):
|
181
|
+
if rc:
|
182
|
+
redis.xadd(task_id, {"type": "rc", "content": rc})
|
183
|
+
redis.xadd(task_id, {"type": "action", "content": "quit"})
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: osism
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.20250616.0
|
4
4
|
Summary: OSISM manager interface
|
5
5
|
Home-page: https://github.com/osism/python-osism
|
6
6
|
Author: OSISM GmbH
|
@@ -36,13 +36,13 @@ Requires-Dist: fastapi==0.115.12
|
|
36
36
|
Requires-Dist: flower==2.0.1
|
37
37
|
Requires-Dist: hiredis==3.2.1
|
38
38
|
Requires-Dist: jc==1.25.5
|
39
|
-
Requires-Dist: keystoneauth1==5.11.
|
39
|
+
Requires-Dist: keystoneauth1==5.11.1
|
40
40
|
Requires-Dist: kombu==5.5.4
|
41
|
-
Requires-Dist: kubernetes==
|
41
|
+
Requires-Dist: kubernetes==33.1.0
|
42
42
|
Requires-Dist: loguru==0.7.3
|
43
43
|
Requires-Dist: nbcli==0.10.0.dev2
|
44
44
|
Requires-Dist: netmiko==4.5.0
|
45
|
-
Requires-Dist: openstacksdk==4.
|
45
|
+
Requires-Dist: openstacksdk==4.6.0
|
46
46
|
Requires-Dist: pottery==3.0.1
|
47
47
|
Requires-Dist: prompt-toolkit==3.0.51
|
48
48
|
Requires-Dist: pynetbox==7.5.0
|
@@ -2,11 +2,11 @@ osism/__init__.py,sha256=1UiNTBus0V0f2AbZQzAtVtu6zkfCCrw0OTq--NwFAqY,341
|
|
2
2
|
osism/__main__.py,sha256=ILe4gu61xEISiBsxanqTQIdSkV-YhpZXTRlguCYyssk,141
|
3
3
|
osism/api.py,sha256=t3HebSzk6fyY7bLJD9P95oEL1qWYXzpX6Yk1o_nVkMo,4356
|
4
4
|
osism/main.py,sha256=Dt2-9sLXcS-Ny4DAz7hrha-KRc7zd7BFUTRdfs_X8z4,893
|
5
|
-
osism/settings.py,sha256=
|
5
|
+
osism/settings.py,sha256=mm94E4FZtyhkA4G7m6BVfl56UOdzRAUUMvgRH-YPdIU,1706
|
6
6
|
osism/actions/__init__.py,sha256=bG7Ffen4LvQtgnYPFEpFccsWs81t4zqqeqn9ZeirH6E,38
|
7
7
|
osism/commands/__init__.py,sha256=Ag4wX_DCgXRdoLn6t069jqb3DdRylsX2nyYkiyCx4uk,456
|
8
8
|
osism/commands/apply.py,sha256=q645f4qxmOAaUjVD7npzM2aNuOqfptVAkCLfE6x5IV8,16833
|
9
|
-
osism/commands/baremetal.py,sha256=
|
9
|
+
osism/commands/baremetal.py,sha256=trIZA-NNylP_PHGr_YtyzoMYTZ9YlJGNY14HObR6oZY,9635
|
10
10
|
osism/commands/compose.py,sha256=iqzG7mS9E1VWaLNN6yQowjOqiHn3BMdj-yfXb3Dc4Ok,1200
|
11
11
|
osism/commands/compute.py,sha256=cgqXWJa5wAvn-7e3FWCgX6hie_aK0yrKRkcNzjLXwDY,25799
|
12
12
|
osism/commands/configuration.py,sha256=sPe8b0dVKFRbr30xoeVdAnHbGwCwgUh0xa_Vzv5pSQQ,954
|
@@ -15,42 +15,48 @@ osism/commands/container.py,sha256=Fku2GaCM3Idq_FxExUtNqjrEM0XYjpVvXmueSVO8S_c,1
|
|
15
15
|
osism/commands/get.py,sha256=ryytjtXWmlMV0NucP5tGkMZu0nIlC4xVtjRk4iMZ06c,8967
|
16
16
|
osism/commands/log.py,sha256=2IpYuosC7FZwwLvM8HmKSU1NRNIelVVYzqjjVMCrOJk,4072
|
17
17
|
osism/commands/manage.py,sha256=WxUZEhylZj2IhydAe3BAr3S5ED6opG243skfSq5q41s,11971
|
18
|
-
osism/commands/netbox.py,sha256=
|
18
|
+
osism/commands/netbox.py,sha256=e65P0kWrjTLw2T9HZthxjDTIRa-KAHgSSJAlvVef7n4,7345
|
19
19
|
osism/commands/noset.py,sha256=7zDFuFMyNpo7DUOKcNiYV8nodtdMOYFp5LDPcuJhlZ8,1481
|
20
|
-
osism/commands/reconciler.py,sha256=
|
20
|
+
osism/commands/reconciler.py,sha256=jy07Qbl219e-WCtWbtV9zh49qHHCjDMm6oVTJM61k1A,1958
|
21
21
|
osism/commands/server.py,sha256=avmoOv5rjOi-fN2A-27cPwOtiy2Q2j6UFtCh3QrfWAI,7512
|
22
22
|
osism/commands/service.py,sha256=A1lgAlGeCJpbFFqF55DRWPcCirIgpU0dzjzVLZ0mz3k,2649
|
23
23
|
osism/commands/set.py,sha256=xLBi2DzbVQo2jb3-cOIE9In5UB3vFxquQJkDN-EsfhM,1425
|
24
24
|
osism/commands/status.py,sha256=X-Rcj-XuNPDBoxsGkf96NswwpmTognxz1V6E2NX2ZgY,1997
|
25
|
-
osism/commands/sync.py,sha256=
|
25
|
+
osism/commands/sync.py,sha256=GpOi45emZmAMZC8cDqHSBH2NmnWSBt5Z1M1g9ufE5rE,1316
|
26
26
|
osism/commands/task.py,sha256=mwJJ7a71Lw3o_FX7j3rR0-NbPdPwMDOjbOAiiXE4uGc,543
|
27
|
-
osism/commands/validate.py,sha256=
|
28
|
-
osism/commands/vault.py,sha256=
|
27
|
+
osism/commands/validate.py,sha256=E1n1kEo6h8J5c7Ns5OHpr0R7i4IU6uj08LE_gt3kBCg,3262
|
28
|
+
osism/commands/vault.py,sha256=llaqNN8UH8t8cCu2KmdaURvprA4zeG6izCen_W7ulPs,2029
|
29
29
|
osism/commands/volume.py,sha256=l6oAk__dFM8KKdLTWOvuSiI7tLh9wAPZp8hwmYF-NX0,6595
|
30
|
-
osism/commands/wait.py,sha256=
|
30
|
+
osism/commands/wait.py,sha256=2Ncx63M0AFq4fq40VZVClf1LS-WHetD8iC_mG2dY_Cw,5275
|
31
31
|
osism/commands/worker.py,sha256=iraCOEhCp7WgfjfZ0-12XQYQPUjpi9rSJK5Z9JfNJk4,1651
|
32
32
|
osism/core/__init__.py,sha256=bG7Ffen4LvQtgnYPFEpFccsWs81t4zqqeqn9ZeirH6E,38
|
33
|
-
osism/core/enums.py,sha256=
|
33
|
+
osism/core/enums.py,sha256=gItIjOK6xWuOZSkMxpMdYLRyt4ezyhzkqA7BGiah2o0,10030
|
34
34
|
osism/core/playbooks.py,sha256=M3T3ajV-8Lt-orsRO3jAoukhaoYFr4EZ2dzYXQjt1kg,728
|
35
35
|
osism/data/__init__.py,sha256=izXdh0J3vPLQI7kBhJI7ibJQzPqU_nlONP0L4Cf_k6A,1504
|
36
36
|
osism/plugins/__init__.py,sha256=bG7Ffen4LvQtgnYPFEpFccsWs81t4zqqeqn9ZeirH6E,38
|
37
37
|
osism/services/__init__.py,sha256=bG7Ffen4LvQtgnYPFEpFccsWs81t4zqqeqn9ZeirH6E,38
|
38
|
-
osism/services/listener.py,sha256=
|
39
|
-
osism/tasks/__init__.py,sha256=
|
38
|
+
osism/services/listener.py,sha256=Vf8LOZkHzlspm40BZ1az3o1O_ar34_i6C83p-D8KzzM,9783
|
39
|
+
osism/tasks/__init__.py,sha256=kocG0q2bARhkkSjMBH2xWdFUIJodesdh5qVsV_DqZmE,7148
|
40
40
|
osism/tasks/ansible.py,sha256=_2zrHwynwwEv9nDnX-LbNCzcwy9dTUGo_yyutt34HyQ,1346
|
41
41
|
osism/tasks/ceph.py,sha256=eIQkah3Kj4INtOkF9kTjHbXJ3_J2lg48EWJKfHc-UYw,615
|
42
|
-
osism/tasks/conductor.py,sha256=
|
42
|
+
osism/tasks/conductor.py,sha256=WBLsoPtr0iGUzRGERs0Xt7CMYrnHQVEwNV9qXBssI3s,274
|
43
43
|
osism/tasks/kolla.py,sha256=wJQpWn_01iWLkr7l7T7RNrQGfRgsgmYi4WQlTmNGvew,618
|
44
44
|
osism/tasks/kubernetes.py,sha256=VzXq_VrYU_CLm4cOruqnE3Kq2ydfO9glZ3p0bp3OYoc,625
|
45
|
-
osism/tasks/netbox.py,sha256=
|
45
|
+
osism/tasks/netbox.py,sha256=g0gL5QImiRTHqixRxze7LfNqPth7cXqLzVWQDUJLDjE,5928
|
46
46
|
osism/tasks/openstack.py,sha256=g15tCll5vP1pC6ysxRCTZxplsdGmXbxaCH3k1Qdv5Xg,6367
|
47
|
-
osism/tasks/reconciler.py,sha256=
|
48
|
-
osism/
|
49
|
-
osism
|
50
|
-
osism
|
51
|
-
osism
|
52
|
-
osism
|
53
|
-
osism
|
54
|
-
osism
|
55
|
-
osism-0.
|
56
|
-
osism-0.
|
47
|
+
osism/tasks/reconciler.py,sha256=6iC0EYxeGvitzU2NsRqQzUEDZWW6Il3jgq_IRTN0sZg,1855
|
48
|
+
osism/tasks/conductor/__init__.py,sha256=EdMVbZgz6VgUDyPBuyBNvAYcyOnyPqOB9w0RCnBkB1M,1527
|
49
|
+
osism/tasks/conductor/config.py,sha256=tvfuYNgvw0F_ZbvrjqnyHfrj3vF6z0zhsRtGNu-Lgvo,3410
|
50
|
+
osism/tasks/conductor/ironic.py,sha256=A3eE-rUTvZYVyDbWxH44IWb1grpMuHyqx401NTbgY2o,16111
|
51
|
+
osism/tasks/conductor/netbox.py,sha256=5Nc7wrriDOtSuru1KDLt9QpA54vC7tXDPB2J0JP9GKo,11393
|
52
|
+
osism/tasks/conductor/sonic.py,sha256=i-BsYSjjSTSqjuHJJX-ReX3qpGhCW-K7AXMivmPT9g4,56743
|
53
|
+
osism/tasks/conductor/utils.py,sha256=-a0-pRuhV4Fjj0SgdgBqtRJtAdGdqck5pzfi6NYBApU,2338
|
54
|
+
osism/utils/__init__.py,sha256=gN5VtLJfrvyn6_snuTte7YR-vDygkpbORopIV8qSEsA,6064
|
55
|
+
osism-0.20250616.0.dist-info/licenses/AUTHORS,sha256=DJIRsjyrFxKjFvmpUNDRDBS04nRiJ5B6FpKcDcfnoGM,36
|
56
|
+
osism-0.20250616.0.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
57
|
+
osism-0.20250616.0.dist-info/METADATA,sha256=DmbIbFQ1sEtgTSaJLXHL4LJT-Ct5xG6RilqVfI86hOc,2903
|
58
|
+
osism-0.20250616.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
59
|
+
osism-0.20250616.0.dist-info/entry_points.txt,sha256=76Aau13zOcw6oxx4Et4zKNgizjYFfk6yVmgKkLMUZJM,3291
|
60
|
+
osism-0.20250616.0.dist-info/pbr.json,sha256=rbKigzydU2eCQu7Pxyea_Ov3W2Hweqk2_GOrTjdFnJA,47
|
61
|
+
osism-0.20250616.0.dist-info/top_level.txt,sha256=8L8dsI9hcaGHsdnR4k_LN9EM78EhwrXRFHyAryPXZtY,6
|
62
|
+
osism-0.20250616.0.dist-info/RECORD,,
|
@@ -60,6 +60,7 @@ sync facts = osism.commands.sync:Facts
|
|
60
60
|
sync inventory = osism.commands.reconciler:Sync
|
61
61
|
sync ironic = osism.commands.netbox:Ironic
|
62
62
|
sync netbox = osism.commands.netbox:Sync
|
63
|
+
sync sonic = osism.commands.sync:Sonic
|
63
64
|
task list = osism.commands.get:Tasks
|
64
65
|
task revoke = osism.commands.task:Revoke
|
65
66
|
validate = osism.commands.validate:Run
|
@@ -0,0 +1 @@
|
|
1
|
+
janhorstmann <horstmann@osism.tech>
|
@@ -0,0 +1 @@
|
|
1
|
+
{"git_version": "6fb60a7", "is_release": false}
|
@@ -1 +0,0 @@
|
|
1
|
-
Christian Berendt <berendt@osism.tech>
|
@@ -1 +0,0 @@
|
|
1
|
-
{"git_version": "e6f441e", "is_release": false}
|
File without changes
|
File without changes
|
File without changes
|