pisi history command privilege warning
BUG:FIXED:8515
This commit is contained in:
@@ -54,7 +54,11 @@ def locked(func):
|
|||||||
Decorator for synchronizing privileged functions
|
Decorator for synchronizing privileged functions
|
||||||
"""
|
"""
|
||||||
def wrapper(*__args,**__kw):
|
def wrapper(*__args,**__kw):
|
||||||
|
try:
|
||||||
lock = file(pisi.util.join_path(pisi.context.config.lock_dir(), 'pisi'), 'w')
|
lock = file(pisi.util.join_path(pisi.context.config.lock_dir(), 'pisi'), 'w')
|
||||||
|
except IOError:
|
||||||
|
raise pisi.errors.PrivilegeError(_("You have to be root for this operation."))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -11,3 +11,6 @@
|
|||||||
|
|
||||||
class AnotherInstanceError(Exception):
|
class AnotherInstanceError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class PrivilegeError(Exception):
|
||||||
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user