File: //lib/python3/dist-packages/uaclient/__pycache__/lock.cpython-310.pyc
o
0xvc � @ sh d dl Z d dlZd dlZd dlZd dlmZmZ e�d�Zda dd� Z
G dd� d�ZG dd � d e�ZdS )
� N)�config�
exceptionszpro.lockc C s t rt � d S d S �N)�clear_lock_file� r r �//usr/lib/python3/dist-packages/uaclient/lock.py�clear_lock_file_if_present s
�r c @ s4 e Zd ZdZdejdefdd�Zdd� Zdd � Z d
S )�SingleAttemptLocka�
Context manager for gaining exclusive access to the lock file.
Create a lock file if absent. The lock file will contain a pid of the
running process, and a customer-visible description of the lock holder.
:param lock_holder: String with the service name or command which is
holding the lock. This lock_holder string will be customer visible in
status.json.
:raises: LockHeldError if lock is held.
�cfg�lock_holderc G s || _ || _d S r �r
r )�selfr
r �_argsr r r �__init__"