Current File : //usr/libexec/kcare/python/kcarectl/__pycache__/serverid.cpython-36.pyc
3

��whv�@srddlZddlmZddlmZddlmZdZdZdZd	d
�Z	dd�Z
d
d�Zejdd��Z
dd�Zdd�ZdS)�N�)�errors)�utils)�json_loads_nstrz/etc/sysconfig/kcare/systemidz&/etc/sysconfig/kcare/systemid.almacarez/var/imunify360/license.jsoncCsltjjt�sdSttd��H}x@|D]8}|jd�\}}}|j�dkrJ|j�Stjdj	t���q"WWdQRXdS)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	Cs2tjjt�sdSttd��}|j�j�SQRXdS)Nr)r	r
r�
ALMA_SYSTEMIDr
�readliner)�frrr�_alma_systemid"srcCs`tjjt�sdSi}tt��4}|j�}|rLyt|�}Wntk
rJYnXWdQRX|jd�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_serverid:sr&cCstjt�dS)N)r	�unlinkrrrrr�rm_serveridDsr(cCstjtdj|��dS)Nzserver_id={0}
)r�atomic_writerr)rrrr�
set_server_idIsr*)r	�rr�py23rrrrrrr%�cachedr&r(r*rrrr�<module>s

Page not found – Hello World !