Commit a55487d8 authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_upgrader: do not run activeSense for post-upgrade step

As results may be inconsistent as long as pre-upgrade and upgrade steps have been run for real
parent 856cd845
...@@ -12,6 +12,9 @@ pre_upgrade_tag = '%s-preupgrade' % tag ...@@ -12,6 +12,9 @@ pre_upgrade_tag = '%s-preupgrade' % tag
upgrade_tag = '%s-upgrade' % tag upgrade_tag = '%s-upgrade' % tag
post_upgrade_tag = '%s-postupgrade' % tag post_upgrade_tag = '%s-postupgrade' % tag
active_process = context.newActiveProcess()
portal_alarms.upgrader_check_pre_upgrade.activate( portal_alarms.upgrader_check_pre_upgrade.activate(
activity='SQLQueue', activity='SQLQueue',
tag=pre_upgrade_tag, tag=pre_upgrade_tag,
...@@ -23,15 +26,28 @@ portal_alarms.upgrader_check_upgrader.activate( ...@@ -23,15 +26,28 @@ portal_alarms.upgrader_check_upgrader.activate(
after_tag=pre_upgrade_tag, after_tag=pre_upgrade_tag,
).activeSense(fixit=fixit, params={'tag': upgrade_tag}) ).activeSense(fixit=fixit, params={'tag': upgrade_tag})
portal_alarms.upgrader_check_post_upgrade.activate( # If we are not running the real upgrade, not need to run activeSense
# of the post-upgrade step : post-upgrade constraints will be run on
# what are *currently* installed, and not on the result of the previous
# steps, which lead to a wrong and misleading consistency check
if fixit:
portal_alarms.upgrader_check_post_upgrade.activate(
activity='SQLQueue', activity='SQLQueue',
tag=post_upgrade_tag, tag=post_upgrade_tag,
after_tag=upgrade_tag, after_tag=upgrade_tag,
).activeSense(fixit=fixit, params={'tag': post_upgrade_tag}) ).activeSense(fixit=fixit, params={'tag': post_upgrade_tag})
else:
summary = "Post-upgrade constraints are not run as their results may differ after "
summary += "upgrader's alarm is solved. To dry-run post-upgrade alarm, please run the pre-ugprade "
summary += "and upgrade steps for real, then run post-upgrade \"Active Sense\" action."
active_process.postActiveResult(
severity=1,
summary=summary,
detail=[m.message for m in constraint_message_list])
# start another activity to collect the results from each upgrader step # start another activity to collect the results from each upgrader step
active_process = context.newActiveProcess()
context.activate(after_tag=post_upgrade_tag).Alarm_postFullUpgradeNeed( context.activate(after_tag=post_upgrade_tag).Alarm_postFullUpgradeNeed(
active_process=active_process.getRelativeUrl()) active_process=active_process.getRelativeUrl())
......
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