Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite6f6955

Browse files
AdamWillConan-Kudo
authored andcommitted
check_lock: treat 'locked by other' differently to 'not locked'
check_lock currently claims the daemon is locked by another appeven if the problem is actually that it *isn't locked at all*.We should distinguish these two cases.Also, here and in a few other places we refer to this as eithera 'dnf lock' or a 'yum lock'. AFAICT it is not either of thosethings, it is a lock that is internal to the daemon. You canhappily perform operations with dnf *directly* while this lockis held. It's confusing to describe this as a 'dnf lock' whenthat isn't what it is, so this changes the description to'dnfdaemon lock' in a few places.Signed-off-by: Adam Williamson <awilliam@redhat.com>
1 parent5858310 commite6f6955

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

‎daemon/dnfdaemon-session.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def Exit(self, sender=None):
9595
sender_keyword='sender')
9696
defLock(self,sender=None):
9797
'''
98-
Get theyum lock
98+
Get thednfdaemon lock
9999
:param sender:
100100
'''
101101
ifnotself._lock:
@@ -367,13 +367,15 @@ def working_ended(self, value=None):
367367

368368
defcheck_lock(self,sender):
369369
'''
370-
Check that the current sender is owning theyum lock
370+
Check that the current sender is owning thednfdaemon lock
371371
:param sender:
372372
'''
373373
ifself._lock==sender:
374374
returnTrue
375+
elifself._lock:
376+
raiseLockedError('dnfdaemon is locked by another application')
375377
else:
376-
raiseLockedError('dnf is locked by another application')
378+
raiseLockedError('dnfdaemon isnotlocked, but was expected to be')
377379

378380

379381
defmain():

‎daemon/dnfdaemon-system.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def Exit(self, sender=None):
104104
sender_keyword='sender')
105105
defLock(self,sender=None):
106106
"""
107-
Get theyum lock
107+
Get thednfdaemon lock
108108
:param sender:
109109
"""
110110
self.check_permission_read(sender)
@@ -699,13 +699,15 @@ def working_ended(self, value=None):
699699

700700
defcheck_lock(self,sender):
701701
"""
702-
Check that the current sender is owning thednf lock
702+
Check that the current sender is owning thednfdaemon lock
703703
:param sender:
704704
"""
705705
ifself._lock==sender:
706706
returnTrue
707+
elifself._lock:
708+
raiseLockedError('dnfdaemon is locked by another application')
707709
else:
708-
raiseLockedError('dnf is locked by another application')
710+
raiseLockedError('dnfdaemon isnotlocked, but was expected to be')
709711

710712
defcheck_permission_write(self,sender):
711713
""" Check for senders permission to update system packages"""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp