Commit 66c92e38 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_pdm: Ensure objects are indexed before run the alarm

The order of execution of activities are not linear anymore, so this require ensure objects are indexed to be found by the alarm.
parent 2d40b1a7
...@@ -120,6 +120,7 @@ return %s ...@@ -120,6 +120,7 @@ return %s
computer2.edit(allocation_scope = 'open/personal') computer2.edit(allocation_scope = 'open/personal')
computer3 = self._makeComputer(self.generateNewId()) computer3 = self._makeComputer(self.generateNewId())
computer3.edit(allocation_scope = 'open/friend') computer3.edit(allocation_scope = 'open/friend')
self.tic()
self._simulateScript('Computer_checkAndCreateUpgradeDecision') self._simulateScript('Computer_checkAndCreateUpgradeDecision')
try: try:
...@@ -143,6 +144,8 @@ return %s ...@@ -143,6 +144,8 @@ return %s
hosting_subscription2 = self._makeHostingSubscription() hosting_subscription2 = self._makeHostingSubscription()
hosting_subscription3 = self._makeHostingSubscription() hosting_subscription3 = self._makeHostingSubscription()
self.tic()
self._simulateScript('HostingSubscription_createUpgradeDecision') self._simulateScript('HostingSubscription_createUpgradeDecision')
try: try:
self.portal.portal_alarms.slapos_pdm_hosting_subscription_create_upgrade_decision.\ self.portal.portal_alarms.slapos_pdm_hosting_subscription_create_upgrade_decision.\
...@@ -163,6 +166,7 @@ return %s ...@@ -163,6 +166,7 @@ return %s
def test_alarm_create_upgrade_decision_destroyed_hosting_subscription(self): def test_alarm_create_upgrade_decision_destroyed_hosting_subscription(self):
hosting_subscription = self._makeHostingSubscription(slap_state="destroy_requested") hosting_subscription = self._makeHostingSubscription(slap_state="destroy_requested")
hosting_subscription2 = self._makeHostingSubscription(slap_state="destroy_requested") hosting_subscription2 = self._makeHostingSubscription(slap_state="destroy_requested")
self.tic()
self._simulateScript('HostingSubscription_createUpgradeDecision') self._simulateScript('HostingSubscription_createUpgradeDecision')
try: try:
...@@ -183,6 +187,7 @@ return %s ...@@ -183,6 +187,7 @@ return %s
computer.edit(allocation_scope = 'close/oudtated') computer.edit(allocation_scope = 'close/oudtated')
computer2 = self._makeComputer(self.generateNewId()) computer2 = self._makeComputer(self.generateNewId())
computer2.edit(allocation_scope = 'close/maintenance') computer2.edit(allocation_scope = 'close/maintenance')
self.tic()
self._simulateScript('Computer_checkAndCreateUpgradeDecision') self._simulateScript('Computer_checkAndCreateUpgradeDecision')
try: try:
......
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