|
50 |
from univention.management.console.config import ucr |
50 |
from univention.management.console.config import ucr |
51 |
from univention.management.console.modules.decorators import simple_response, sanitize |
51 |
from univention.management.console.modules.decorators import simple_response, sanitize |
52 |
from univention.management.console.modules.sanitizers import StringSanitizer, ListSanitizer, BooleanSanitizer |
52 |
from univention.management.console.modules.sanitizers import StringSanitizer, ListSanitizer, BooleanSanitizer |
|
|
53 |
from univention.updater.locking import UpdaterLock |
53 |
|
54 |
|
54 |
_ = umc.Translation('univention-management-console-module-join').translate |
55 |
_ = umc.Translation('univention-management-console-module-join').translate |
55 |
|
56 |
|
|
279 |
self.progress_state = Progress() |
280 |
self.progress_state = Progress() |
280 |
|
281 |
|
281 |
@simple_response |
282 |
@simple_response |
282 |
def dpkg_locked(self): |
283 |
def updater_or_dpkg_lock(self): |
283 |
"""Do not execute join scripts when dpkg is running (e.g. via |
284 |
"""Do not execute join scripts when updater or dpkg |
284 |
App Center) |
285 |
are running (e.g. via App Center) |
285 |
""" |
286 |
""" |
286 |
return self._dpkg_locked() |
287 |
try: |
|
|
288 |
with UpdaterLock(): |
289 |
return self._dpkg_locked() |
290 |
except SystemExit: |
291 |
return True |
287 |
|
292 |
|
288 |
def _dpkg_locked(self): |
293 |
def _dpkg_locked(self): |
289 |
fd = apt_pkg.get_lock('/var/lib/dpkg/lock') |
294 |
fd = apt_pkg.get_lock('/var/lib/dpkg/lock') |