Commit 2dd3ea06 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: Stop to check for Allocation Scope when monitor

   Only Monitor Scope should be taken into account.
parent c2a1055e
...@@ -7,10 +7,6 @@ if not person or \ ...@@ -7,10 +7,6 @@ if not person or \
portal.ERP5Site_isSupportRequestCreationClosed(): portal.ERP5Site_isSupportRequestCreationClosed():
return return
if context.getAllocationScope("open").startswith("close"):
context.setMonitorScope("disabled")
return
reference = context.getReference() reference = context.getReference()
compute_node_title = context.getTitle() compute_node_title = context.getTitle()
......
#
# XXX This ticket contains dupplicated coded found arround SlapOS
# It is required to rewrite this in a generic way.
# See also: InstanceTree_checkSoftwareInstanceState
# See also: ComputeNode_checkState
#
from DateTime import DateTime from DateTime import DateTime
if context.getSimulationState() == "invalidated": if context.getSimulationState() == "invalidated":
...@@ -103,17 +96,11 @@ if aggregate_portal_type == "Instance Tree": ...@@ -103,17 +96,11 @@ if aggregate_portal_type == "Instance Tree":
if instance.getAggregate() is not None: if instance.getAggregate() is not None:
compute_node = instance.getAggregateValue().getParentValue() compute_node = instance.getAggregateValue().getParentValue()
if instance.getPortalType() == "Software Instance" and \ if instance.getPortalType() == "Software Instance" and \
compute_node.getAllocationScope() in ["open/public", "open/friend", "open/subscription"] and \
instance.getSlapState() == "start_requested" and \ instance.getSlapState() == "start_requested" and \
instance.SoftwareInstance_hasReportedError(): instance.SoftwareInstance_hasReportedError():
message_list.append("%s has error (%s, %s at %s scope %s)" % (instance.getReference(), instance.getTitle(), message_list.append("%s has error (%s, %s at %s scope %s)" % (instance.getReference(), instance.getTitle(),
instance.getUrlString(), compute_node.getReference(), instance.getUrlString(), compute_node.getReference(),
compute_node.getAllocationScope())) compute_node.getAllocationScope()))
if instance.getPortalType() == "Software Instance" and \
compute_node.getAllocationScope() in ["closed/outdated", "open/personal"] and \
instance.getSlapState() == "start_requested" and \
instance.SoftwareInstance_hasReportedError():
message_list.append("%s on a %s compute_node" % (instance.getReference(), compute_node.getAllocationScope()) )
else: else:
message_list.append("%s is not allocated" % instance.getReference()) message_list.append("%s is not allocated" % instance.getReference())
return ",".join(message_list) return ",".join(message_list)
......
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