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

Minor fixup for CRM/Abyss integration

See merge request !566
parents e72c1e3c e06e1c23
Pipeline #29404 failed with stage
in 0 seconds
......@@ -21,4 +21,6 @@ for previous_array in portal.portal_catalog(
if batch:
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:
should_notify = True
notification_message_reference = "slapos-crm-compute_node_check_modified_file.notification"
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)
if not should_notify:
......
......@@ -23,6 +23,13 @@ if aggregate_portal_type == "Compute Node":
last_contact = DateTime(d.get('created_at'))
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
compute_partition_uid_list = [
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