v49 n d dl Z d dlZd dlZd dlZd dlZdZdZdZdZ d Z d ZefdZefd Z efd Zd ZdS ) Nz/etc/sysconfig/cloudlinuxhooks;zpython-cllib:clhook:c t t j dd }t |_ | | |S )z6 read config from file_name return config NF) interpolationstrict)configparserConfigParserstroptionxformread) file_nameconfigs /builddir/build/BUILDROOT/alt-python27-cllib-3.4.36-1.el9.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/clhook.py get_configr s8 &T% H H HFF KK M c D | dt j }t |dd 5 }| | ddd n# 1 swxY w Y t j || n/# t $ r"}d| | dt | gcY d}~S d}~ww xY wdd gS ) zG write config to file_name return [BOOLEAN_STATE, MESSAGE] .wzutf-8)encodingNFz write error TOK )osgetpidopenwriteshutilmoveIOErrorr )r r debug_local_nametmp_cfg_path tmpconfiges r write_configr" ! s O#33bikk33 ,g 6 6 6 $)LL### $ $ $ $ $ $ $ $ $ $ $ $ $ $ $L),,,, O O O*MIMMSVVMMNNNNNNNO&>s@ *A/ AA/ AA/ AA/ / B9BBBc g }t | } | t | t }n%# t j t j f$ r d|gcY S w xY wd|gS )z+ return [BOOLEAN_STATE, hook_list] FT)r getHOOK_SECTIONsplitHOOK_SEPARATORr NoOptionErrorNoSectionError)hook_prefixconfig_file hook_listr s r get_hook_list_from_filer- 0 s I $ $F"JJ|[99??OO &(CD " " "y!!!!")s 3A A)(A)c | t dz }t | } | t | t }| |v rd|dz t | z dz gS | | | t |t | nw# t j $ r9 | t | t || Y n0t j $ r | t || Y nw xY wt ||| S )zE add hook to config file return [BOOLEAN_STATE, MESSAGE] zregister_hook:TzHook z already registred )DEBUG_STRINGr r$ r% r&