/usr/lib/python3/dist-packages/uaclient/files/__pycache__
Edit: /usr/lib/python3/dist-packages/uaclient/files/__pycache__/notices.cpython-310.pyc (6906B)
o
Ki! @ s d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm Z m
Z
mZmZm
Z
e e
eZe
Zedg dZG dd d eeZG d
d dZdadd
ZdeddfddZdeddfddZdee fddZdS ) N)
namedtuple)Enum)List)defaultsevent_loggermessagessystemutilNoticeFileDetails)order_idlabelis_permanentmessagec @ s* e Zd ZedddejdZedddddZed d
dejdZedddej dZ ed
ddej
dZedddejdZedddej
dZ
edddejdZedddejjdZedddejdZedddejdZedddejdZedddddZedd dejdZed!d"dejdZed#d$dejdZd%S )&Noticecontract_expired5T)r r r
r reboot_required10FzSystem reboot requiredenable_reboot_required11reboot_script_failed12fips_reboot_required20fips_system_reboot_required21fips_install_out_of_date22fips_disable_reboot_required23fips_proc_file_error24fips_manual_disable_url25wrong_fips_metapackage_on_cloudlp_lts_reboot_required30operation_in_progress60z"Operation in progress: {operation}auto_attach_retry_full_notice70auto_attach_total_failure71limited_to_release80N)__name__
__module____qualname__r
r CONTRACT_EXPIREDREBOOT_REQUIREDENABLE_REBOOT_REQUIRED_TMPLENABLE_REBOOT_REQUIREDREBOOT_SCRIPT_FAILEDFIPS_REBOOT_REQUIRED_MSGFIPS_REBOOT_REQUIREDFIPS_SYSTEM_REBOOT_REQUIREDFIPS_INSTALL_OUT_OF_DATEFIPS_DISABLE_REBOOT_REQUIREDFIPS_PROC_FILE_ERRORtmpl_msgNOTICE_FIPS_MANUAL_DISABLE_URLFIPS_MANUAL_DISABLE_URL&NOTICE_WRONG_FIPS_METAPACKAGE_ON_CLOUDWRONG_FIPS_METAPACKAGE_ON_CLOUDLIVEPATCH_LTS_REBOOT_REQUIREDOPERATION_IN_PROGRESSAUTO_ATTACH_RETRY_NOTICEAUTO_ATTACH_RETRY_FULL_NOTICE&AUTO_ATTACH_RETRY_TOTAL_FAILURE_NOTICEAUTO_ATTACH_RETRY_TOTAL_FAILURELIMITED_TO_RELEASE rI rI 8/usr/lib/python3/dist-packages/uaclient/files/notices.pyr s
r c @ s| e Zd ZdedefddZdefddZdedee fd d
Zdedede fdd
Z
dedefddZdee fddZdS )NoticesManagernotice_detailsdescriptionc C s^ t std|jj dS |jjrtjntj }d
|jj|jj}t
tj||| dS )zAdds a notice file. If the notice is found,
it overwrites it.
:param notice_details: Holds details concerning the notice file.
:param description: The content to be written to the notice file.
z.NoticesManager.add(%s) called as non-root userN{}-{})r we_are_currently_rootLOGwarningvaluer r
r NOTICES_PERMANENT_DIRECTORYNOTICES_TEMPORARY_DIRECTORYformatr r
write_fileospathjoin)selfrL rM directoryfilenamerI rI rJ addt s" zNoticesManager.addc C s\ t std|jj dS |jjrtjntj }d
|jj|jj}t
tj|| dS )ziDeletes a notice file.
:param notice_details: Holds details concerning the notice file.
z1NoticesManager.remove(%s) called as non-root userNrN )r rO rP rQ rR r r
r rS rT rU r r ensure_file_absentrW rX rY )rZ rL r[ r\ rI rI rJ remove s zNoticesManager.remover[ returnc s fddt D S )zGets the list of notice file names in the given directory.
:param directory: The directory to search for notice files.
:returns: List of notice file names.
c s2 g | ]}t jt j |r |r|qS rI )rW rX isfilerY _is_valid_notice_file).0 file_namer[ rZ rI rJ