setup: Disable install/upgrade when dpkg/apt is running

Show a warning message that a package manager is running. This prevents users
from getting an installation error just because another installation/upgrade is
running.

Closes: #625.
This commit is contained in:
Johannes Keyser authored and Sunil Mohan Adapa committed 2017-04-19 16:50:00 +05:30
1 parent 6a53dd015e
commit 76a63d102b
5 files changed
+49 -17

No files matched your search

+1 -2
View File
@@ -84,11 +84,10 @@ class UpgradesConfigurationView(FormView):
return super().form_valid(form)
def is_package_manager_busy():
"""Return whether a package manager is running."""
try:
actions.superuser_run('upgrades', ['is-package-manager-busy'])
actions.superuser_run('packages', ['is-package-manager-busy'])
return True
except actions.ActionError:
return False