Skip to content

Commit

Permalink
Error out if we cannot initialize the APT lock
Browse files Browse the repository at this point in the history
If we do not acquire an APT lock, we should immediately bail out because
we have no insight into what might be going wrong on that machine

Thanks: Matthew Maslak
  • Loading branch information
rickysarraf committed Sep 1, 2022
1 parent a131e17 commit 80e3da4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apt_offline_core/AptOfflineCoreLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,9 @@ def __init__(self, args):
return False

AptOfflineLib.Archiver.__init__(self)
LockAPT.__init__(self, apt_lists_lock, apt_packages_lock)
if not LockAPT.__init__(self, apt_lists_lock, apt_packages_lock):
log.err("Couldn't initialize lock on APT dataase\n")
return False

if MagicLib is False:
log.err("Please ensure libmagic is installed\n")
Expand Down

0 comments on commit 80e3da4

Please sign in to comment.