Open duhow opened 8 months ago
✅ Works with latest commit 3c45215 .
so we can close it right?
Sorry, but faced this issue again with latest commit. Apparently this appeared when adding a new minion? Let me get more details on the issue...
line 174, in conformity https://github.com/latenighttales/alcali/blob/v3006.3.0/api/models.py#L174
('str' object has no attribute 'get')
I think this is the cause for the "string":
tag: salt/job/20231024100007873742/ret/midokura-lap127
{"cmd": "_return", "id": "midokura-lap127", "fun": "state.apply", "fun_args": [], "schedule": "salt-apply", "jid": "20231024100007873742", "pid": 22179, "return": "Unhandled exception running state.apply", "success": false, "retcode": 254, "_stamp": "2023-10-24T10:00:07.878783", "out": "highstate", "arg": [], "tgt_type": "glob", "tgt": "midokura-lap127"}
return
is a string.
diff --git a/api/models.py b/api/models.py
index de799c4..0ef5260 100644
--- a/api/models.py
+++ b/api/models.py
@@ -171,6 +171,8 @@ class Minions(models.Model):
for state in return_item:
# One of the state is not ok
+ if isinstance(return_item, str):
+ return False
if not return_item.get(state, {}).get("result"):
return False
return True
This works for me 👍🏻
Sounds good 😊 Do you mind opening a PR?
Describe the bug Unexpected Django error appeared in logs while viewing conformity list of a machine, and list of minions. Apparently caused by a single machine status. Differs from #505 This is blocking to display all minion list.
📝 Logs
Version 3003.1.0