Commit ad6e1516 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Romain Courteaud

slapgrid: get Partition before processing it in report

parent bd53f399
......@@ -2054,6 +2054,12 @@ stderr_logfile_backups=1
# Try to process it anyway, it may need to be deleted.
software_path = None
if not self.api_backward_compatibility:
computer_partition = self.slap.jio_api_connector.get({
"portal_type": "Software Instance",
"reference": computer_partition["reference"]
})
local_partition = Partition(
software_path=software_path,
instance_path=os.path.join(self.instance_root,
......
......@@ -2218,10 +2218,11 @@ class TestSlapgridUsageReport(MasterMixin, unittest.TestCase):
self.assertEqual(computer.sequence,
['/api/allDocs/',
'/api/get/',
'/api/put/',
'/api/put/'])
self.assertEqual(instance.sequence[0][1]["reported_state"], 'stopped')
self.assertEqual(instance.sequence[1][1]["reported_state"], 'destroyed')
self.assertEqual(instance.sequence[1][1]["reported_state"], 'stopped')
self.assertEqual(instance.sequence[2][1]["reported_state"], 'destroyed')
self.assertEqual(instance.state, 'destroyed')
def test_partition_list_is_complete_if_empty_destroyed_partition(self):
......@@ -2252,10 +2253,11 @@ class TestSlapgridUsageReport(MasterMixin, unittest.TestCase):
self.assertEqual(computer.sequence,
['/api/allDocs/',
'/api/get/',
'/api/put/',
'/api/put/'])
self.assertEqual(instance.sequence[0][1]["reported_state"], 'stopped')
self.assertEqual(instance.sequence[1][1]["reported_state"], 'destroyed')
self.assertEqual(instance.sequence[1][1]["reported_state"], 'stopped')
self.assertEqual(instance.sequence[2][1]["reported_state"], 'destroyed')
self.assertEqual(instance.state, 'destroyed')
def test_slapgrid_not_destroy_bad_instance(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