Commit 511a77be authored by Rafael Monnerat's avatar Rafael Monnerat

Minor fixup for CRM/Abyss integration

See merge request nexedi/slapos.core!566
parents e72c1e3c e06e1c23
...@@ -21,4 +21,6 @@ for previous_array in portal.portal_catalog( ...@@ -21,4 +21,6 @@ for previous_array in portal.portal_catalog(
if batch: if batch:
return return
context.Base_redirect('view',keep_items={'portal_status_message': context.Base_translateString("Declared as default data")}) return context.Base_redirect('view',
keep_items={'portal_status_message':
context.Base_translateString("Declared as default data")})
...@@ -39,7 +39,7 @@ else: ...@@ -39,7 +39,7 @@ else:
should_notify = True should_notify = True
notification_message_reference = "slapos-crm-compute_node_check_modified_file.notification" notification_message_reference = "slapos-crm-compute_node_check_modified_file.notification"
ticket_title = "[MONITORING] Compute Node %s has modified file" % reference ticket_title = "[MONITORING] Compute Node %s has modified file" % reference
issue_document_reference = data_array.Reference() issue_document_reference = data_array.getReference()
description = "The Compute Node %s (%s) has modified file: %s" % (compute_node_title, reference, issue_document_reference) description = "The Compute Node %s (%s) has modified file: %s" % (compute_node_title, reference, issue_document_reference)
if not should_notify: if not should_notify:
......
...@@ -23,6 +23,13 @@ if aggregate_portal_type == "Compute Node": ...@@ -23,6 +23,13 @@ if aggregate_portal_type == "Compute Node":
last_contact = DateTime(d.get('created_at')) last_contact = DateTime(d.get('created_at'))
if (now - last_contact) < 0.01: if (now - last_contact) < 0.01:
ComputeNode_hasModifiedFile = getattr(
document, "ComputeNode_hasModifiedFile", None)
if ComputeNode_hasModifiedFile:
data_array = ComputeNode_hasModifiedFile()
if data_array:
return "Compute Node %s (%s) has modified file: %s" % (
document.getTitle(), document.getReference(), data_array.getReference())
# If server has no partitions skip # If server has no partitions skip
compute_partition_uid_list = [ compute_partition_uid_list = [
x.getUid() for x in document.contentValues(portal_type="Compute Partition") x.getUid() for x in document.contentValues(portal_type="Compute Partition")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment