Skip to content

Commit

Permalink
Prohibit upgrade when boot pool is being resilvered (#14073)
Browse files Browse the repository at this point in the history
  • Loading branch information
themylogin authored Jul 24, 2024
1 parent f076938 commit 94ae570
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/middlewared/middlewared/plugins/update_/install_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@
class UpdateService(Service):
@private
def install(self, job, path, options):
state = self.middleware.call_sync("boot.get_state")
if (
state["scan"] and
state["scan"]["function"] == "RESILVER" and
state["scan"]["state"] == "SCANNING"
):
raise CallError(
f"One or more boot pool devices are currently being resilvered. The upgrade cannot continue "
"until the resilvering operation is finished."
)

def progress_callback(progress, description):
job.set_progress((0.5 + 0.5 * progress) * 100, description)

Expand Down

0 comments on commit 94ae570

Please sign in to comment.