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: ...@@ -73,7 +73,14 @@ if sla_dict:
instance_sla_error_list.append('instance_guid is provided to a Software Instance: %s' % instance_title) instance_sla_error_list.append('instance_guid is provided to a Software Instance: %s' % instance_title)
else: else:
if compute_node.getPortalType() == "Remote Node": 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: else:
software_instance = compute_partition.getAggregateRelatedValue(portal_type='Software Instance') software_instance = compute_partition.getAggregateRelatedValue(portal_type='Software Instance')
if software_instance is not None and software_instance.getReference() != instance_guid: if software_instance is not None and software_instance.getReference() != instance_guid:
......
...@@ -1490,22 +1490,30 @@ class TestSlapOSCrmSoftwareInstance_checkInstanceTreeMonitoringState(TestSlapOSC ...@@ -1490,22 +1490,30 @@ class TestSlapOSCrmSoftwareInstance_checkInstanceTreeMonitoringState(TestSlapOSC
error_dict = software_instance.SoftwareInstance_getReportedErrorDict(tolerance=30) error_dict = software_instance.SoftwareInstance_getReportedErrorDict(tolerance=30)
self.tic() self.tic()
ticket_title = "Instance Tree %s is failing." % (instance_tree.getTitle()) # For now the assertion is disabled, so we do not generate a ticket for
self.assertEqual(error_dict['ticket_title'], ticket_title) # this use case. Until allocation is improved to consider this a problem
ticket = self._getGeneratedSupportRequest(instance_tree.getUid()) ticket = self._getGeneratedSupportRequest(instance_tree.getUid())
self.assertEqual(ticket, None)
self.assertEqual(error_dict['should_notify'], None)
self.assertNotEqual(ticket, None) # Uncommend the following to when the SoftwareInstance_getReportedErrorDict
self.assertEqual(ticket.getTitle(), error_dict['ticket_title']) # changes back.
event_list = ticket.getFollowUpRelatedValueList() #ticket_title = "Instance Tree %s is failing." % (instance_tree.getTitle())
self.assertEqual(len(event_list), 1) #self.assertEqual(error_dict['ticket_title'], ticket_title)
event = event_list[0] #ticket = self._getGeneratedSupportRequest(instance_tree.getUid())
self.assertIn('has invalid Service Level Aggrement.', #self.assertNotEqual(ticket, None)
event.getTextContent()) #self.assertEqual(ticket.getTitle(), error_dict['ticket_title'])
self.assertIn( #event_list = ticket.getFollowUpRelatedValueList()
' instance_guid provided on test tree and it is allocated on a REMOTE NODE', #self.assertEqual(len(event_list), 1)
event.getTextContent()) #event = event_list[0]
self.assertEventTicket(event, ticket, instance_tree)
#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') @simulate('Project_isSupportRequestCreationClosed', '', 'return 0')
def test_SoftwareInstance_checkInstanceTreeMonitoringState_script_slaveBadInstanceGuid(self): 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