Skip to content

Commit 0f55ca0

Browse files
committed
Improve releasing zypp lock
1 parent b527c07 commit 0f55ca0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

zypperoni

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,11 @@ def get_zypp_lock():
155155

156156
# Function to release lock on zypper
157157
def release_zypp_lock():
158-
os.system(f"echo -n > {ZYPPER_PID_FILE} > /dev/null 2>&1")
159-
return True
158+
if os.getuid == 0:
159+
os.system(f"echo -n > {ZYPPER_PID_FILE}")
160+
return True
161+
else:
162+
return False
160163

161164
# Function to unmount temp dirs provided list of UUIDs
162165
def unmount(UUID):

0 commit comments

Comments
 (0)