-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this ensures more consistent on-disk data
- Loading branch information
Showing
6 changed files
with
142 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Checks::Pulpcore | ||
class NoRunningTasks < ForemanMaintain::Check | ||
metadata do | ||
for_feature :pulpcore | ||
description 'Check for running pulpcore tasks' | ||
tags :pre_upgrade | ||
end | ||
|
||
def run | ||
tasks = feature(:pulpcore).running_tasks | ||
assert(tasks.empty?, failure_message(tasks.length), | ||
:next_steps => [Procedures::Pulpcore::WaitForTasks.new]) | ||
end | ||
|
||
private | ||
|
||
def failure_message(task_count) | ||
"There are #{task_count} active task(s) in the system." \ | ||
"\nPlease wait for these to complete." | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Procedures::Pulpcore | ||
class WaitForTasks < ForemanMaintain::Procedure | ||
metadata do | ||
for_feature :pulpcore | ||
description 'Fetch tasks status and wait till they finish' | ||
advanced_run false | ||
end | ||
|
||
def run | ||
with_spinner("waiting for tasks to finish") do |spinner| | ||
feature(:foreman_tasks).wait_for_tasks(spinner) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters