HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/libexec/kcare/python/kcarectl/__pycache__/serverid.cpython-38.pyc
U

n�hi�@sjddlZddlmZmZddlmZdZdZdZdd	�Z
d
d�Zdd
�Zej
dd��Zdd�Zdd�ZdS)�N�)�errors�utils)�json_loads_nstrz/etc/sysconfig/kcare/systemidz&/etc/sysconfig/kcare/systemid.almacarez/var/imunify360/license.jsonc
Csxtj�t�sdSttd��T}|D]H}|�d�\}}}|��dkrX|��W5QR�St�d�	t���q W5QRXdS)N�r�=�	server_idzUnable to parse {0}.)
�os�path�exists�SYSTEMID�open�	partition�stripr�
KcareError�format)�fd�line�param�_�value�r�./usr/libexec/kcare/python/kcarectl/serverid.py�	_systemidsrc
Cs>tj�t�sdSttd��}|����W5QR�SQRXdS)Nr)r	r
r�
ALMA_SYSTEMIDr
�readliner)�frrr�_alma_systemid!src	Cs`tj�t�sdSi}tt��4}|��}|rLzt|�}Wntk
rJYnXW5QRX|�d�S)N�id)	r	r
r�IM360_LICENSE_FILEr
�readr�	Exception�get)�datar�contentrrr�_im360_systemid)s
r%cCst�pt�pt�S)zqGet server_id or None if not present.

    Lookup order: SYSTEMID then IM360_LICENSE_FILE then ALMA_SYSTEMID
    )rr%rrrrr�get_serverid9sr&cCst�t�dS)N)r	�unlinkrrrrr�rm_serveridCsr(cCst�td�|��dS)Nzserver_id={0}
)r�atomic_writerr)rrrr�
set_server_idHsr*)r	�rr�py23rrrr�Optionalrrr%�cachedr&r(r*rrrr�<module>s