Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
bbca224a
Commit
bbca224a
authored
Oct 10, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: Ensure message is always present
parent
1916c113
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/ComputeNode_getReportedErrorDict.py
...slapos_crm_monitoring/ComputeNode_getReportedErrorDict.py
+10
-5
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/ComputeNode_getReportedErrorDict.py
View file @
bbca224a
...
@@ -14,16 +14,18 @@ error_dict = {
...
@@ -14,16 +14,18 @@ error_dict = {
'compute_node_title'
:
compute_node_title
,
'compute_node_title'
:
compute_node_title
,
'compute_node_id'
:
reference
,
'compute_node_id'
:
reference
,
'last_contact'
:
None
,
'last_contact'
:
None
,
'issue_document_reference'
:
None
'issue_document_reference'
:
None
,
'message'
:
None
}
}
if
compute_node
.
getMonitorScope
()
==
"disabled"
:
if
compute_node
.
getMonitorScope
()
==
"disabled"
:
for
i
in
[
'ticket_title'
,
'ticket_description'
,
'last_contact'
]:
for
i
in
[
'ticket_title'
,
'ticket_description'
,
'last_contact'
,
'message'
]:
error_dict
[
i
]
=
"Monitor is disabled on this Compute Node."
error_dict
[
i
]
=
"Monitor is disabled on this Compute Node."
return
error_dict
return
error_dict
if
d
.
get
(
"no_data"
)
==
1
:
if
d
.
get
(
"no_data"
)
==
1
:
error_dict
[
'last_contact'
]
=
"No Contact Information"
error_dict
[
'last_contact'
]
=
"No Contact Information"
error_dict
[
'message'
]
=
error_dict
[
'last_contact'
]
error_dict
[
'ticket_title'
]
=
"Lost contact with compute_node %s"
%
reference
error_dict
[
'ticket_title'
]
=
"Lost contact with compute_node %s"
%
reference
error_dict
[
'ticket_description'
]
=
\
error_dict
[
'ticket_description'
]
=
\
"The Compute Node %s (%s) has not contacted the server (No Contact Information)"
%
(
"The Compute Node %s (%s) has not contacted the server (No Contact Information)"
%
(
...
@@ -38,6 +40,7 @@ if (now - last_contact) > 0.01:
...
@@ -38,6 +40,7 @@ if (now - last_contact) > 0.01:
error_dict
[
'should_notify'
]
=
True
error_dict
[
'should_notify'
]
=
True
error_dict
[
'ticket_title'
]
=
"Lost contact with compute_node %s"
%
reference
error_dict
[
'ticket_title'
]
=
"Lost contact with compute_node %s"
%
reference
error_dict
[
'last_contact'
]
=
last_contact
error_dict
[
'last_contact'
]
=
last_contact
error_dict
[
'message'
]
=
"Lost contact with %s since %s"
%
(
reference
,
last_contact
)
error_dict
[
'notification_message_reference'
]
=
'slapos-crm-compute_node_check_state.notification'
error_dict
[
'notification_message_reference'
]
=
'slapos-crm-compute_node_check_state.notification'
error_dict
[
'ticket_description'
]
=
"The Compute Node %s (%s) has not contacted the server for more than 30 minutes"
\
error_dict
[
'ticket_description'
]
=
"The Compute Node %s (%s) has not contacted the server for more than 30 minutes"
\
"(last contact date: %s)"
%
(
compute_node_title
,
reference
,
last_contact
)
"(last contact date: %s)"
%
(
compute_node_title
,
reference
,
last_contact
)
...
@@ -50,6 +53,7 @@ if data_array:
...
@@ -50,6 +53,7 @@ if data_array:
error_dict
[
'notification_message_reference'
]
=
"slapos-crm-compute_node_check_modified_file.notification"
error_dict
[
'notification_message_reference'
]
=
"slapos-crm-compute_node_check_modified_file.notification"
error_dict
[
'ticket_title'
]
=
"Compute Node %s has modified file"
%
reference
error_dict
[
'ticket_title'
]
=
"Compute Node %s has modified file"
%
reference
error_dict
[
'issue_document_reference'
]
=
data_array
.
getReference
()
error_dict
[
'issue_document_reference'
]
=
data_array
.
getReference
()
error_dict
[
'message'
]
=
"%s has modified file"
%
reference
error_dict
[
'ticket_description'
]
=
"The Compute Node %s (%s) has modified file: %s"
%
(
error_dict
[
'ticket_description'
]
=
"The Compute Node %s (%s) has modified file: %s"
%
(
compute_node_title
,
reference
,
error_dict
[
'issue_document_reference'
])
compute_node_title
,
reference
,
error_dict
[
'issue_document_reference'
])
return
error_dict
return
error_dict
...
@@ -91,6 +95,7 @@ if compute_partition_uid_list:
...
@@ -91,6 +95,7 @@ if compute_partition_uid_list:
error_dict
[
'ticket_title'
]
=
"Compute Node %s has a stalled instance process"
%
reference
error_dict
[
'ticket_title'
]
=
"Compute Node %s has a stalled instance process"
%
reference
error_dict
[
'ticket_description'
]
=
"The Compute Node %s (%s) didnt process its instances for more than 24 hours, last contact from the node: %s"
%
(
error_dict
[
'ticket_description'
]
=
"The Compute Node %s (%s) didnt process its instances for more than 24 hours, last contact from the node: %s"
%
(
compute_node_title
,
reference
,
last_contact
)
compute_node_title
,
reference
,
last_contact
)
error_dict
[
'message'
]
=
"%s has a stalled instance process"
%
reference
return
error_dict
return
error_dict
for
software_installation
in
portal
.
portal_catalog
(
for
software_installation
in
portal
.
portal_catalog
(
...
@@ -121,15 +126,15 @@ for software_installation in portal.portal_catalog(
...
@@ -121,15 +126,15 @@ for software_installation in portal.portal_catalog(
message_list
=
(
software_installation
.
getUrlString
(),
message_list
=
(
software_installation
.
getUrlString
(),
compute_node_title
,
compute_node_title
,
software_installation
.
getCreationDate
())
software_installation
.
getCreationDate
())
if
access_status_text
.
startswith
(
"#building"
):
if
access_status_text
.
startswith
(
"#building"
):
error_dict
[
'ticket_description'
]
=
\
error_dict
[
'ticket_description'
]
=
\
"The software release %s is building for mode them 12 hours on %s, started on %s"
%
message_list
"The software release %s is building for mode them 12 hours on %s, started on %s"
%
message_list
else
:
else
:
error_dict
[
'ticket_description'
]
=
\
error_dict
[
'ticket_description'
]
=
\
"The software release %s is failing to build for too long on %s, started on %s"
%
message_list
"The software release %s is failing to build for too long on %s, started on %s"
%
message_list
error_dict
[
'message'
]
=
error_dict
[
'ticket_description'
]
error_dict
[
'message'
]
=
error_dict
[
'ticket_description'
]
return
error_dict
return
error_dict
return
error_dict
return
error_dict
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment