Commit 0084eb0b authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: Disable checks on Remote until allocation is changed

  For now the system allows allocate with instance_guid on remote, so it is not good
  to check
parent ed92d54a
Pipeline #38657 failed with stage
in 0 seconds
......@@ -73,7 +73,14 @@ if sla_dict:
instance_sla_error_list.append('instance_guid is provided to a Software Instance: %s' % instance_title)
else:
if compute_node.getPortalType() == "Remote Node":
instance_sla_error_list.append('instance_guid provided on %s and it is allocated on a REMOTE NODE' % instance_title)
# RAFAEL: I disabled the following verification until further notice, the
# reasoning is that allocation allows this to happens for now, and we eventually
# need this feature for now.
# Once the implementation changes and this code be merged with allocation code, we will
# re-enable this feature:
# instance_sla_error_list.append(
# 'instance_guid provided on %s and it is allocated on a REMOTE NODE' % instance_title)
pass
else:
software_instance = compute_partition.getAggregateRelatedValue(portal_type='Software Instance')
if software_instance is not None and software_instance.getReference() != instance_guid:
......
......@@ -1490,22 +1490,30 @@ class TestSlapOSCrmSoftwareInstance_checkInstanceTreeMonitoringState(TestSlapOSC
error_dict = software_instance.SoftwareInstance_getReportedErrorDict(tolerance=30)
self.tic()
ticket_title = "Instance Tree %s is failing." % (instance_tree.getTitle())
self.assertEqual(error_dict['ticket_title'], ticket_title)
# For now the assertion is disabled, so we do not generate a ticket for
# this use case. Until allocation is improved to consider this a problem
ticket = self._getGeneratedSupportRequest(instance_tree.getUid())
self.assertEqual(ticket, None)
self.assertEqual(error_dict['should_notify'], None)
self.assertNotEqual(ticket, None)
self.assertEqual(ticket.getTitle(), error_dict['ticket_title'])
event_list = ticket.getFollowUpRelatedValueList()
self.assertEqual(len(event_list), 1)
event = event_list[0]
self.assertIn('has invalid Service Level Aggrement.',
event.getTextContent())
self.assertIn(
' instance_guid provided on test tree and it is allocated on a REMOTE NODE',
event.getTextContent())
self.assertEventTicket(event, ticket, instance_tree)
# Uncommend the following to when the SoftwareInstance_getReportedErrorDict
# changes back.
#ticket_title = "Instance Tree %s is failing." % (instance_tree.getTitle())
#self.assertEqual(error_dict['ticket_title'], ticket_title)
#ticket = self._getGeneratedSupportRequest(instance_tree.getUid())
#self.assertNotEqual(ticket, None)
#self.assertEqual(ticket.getTitle(), error_dict['ticket_title'])
#event_list = ticket.getFollowUpRelatedValueList()
#self.assertEqual(len(event_list), 1)
#event = event_list[0]
#self.assertIn('has invalid Service Level Aggrement.',
# event.getTextContent())
#self.assertIn(
# ' instance_guid provided on test tree and it is allocated on a REMOTE NODE',
# event.getTextContent())
#self.assertEventTicket(event, ticket, instance_tree)
@simulate('Project_isSupportRequestCreationClosed', '', 'return 0')
def test_SoftwareInstance_checkInstanceTreeMonitoringState_script_slaveBadInstanceGuid(self):
......
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