§ ½@¾jÔ ã ó„ — d dl Z d dlZd dlZd dlmZmZ d dlmZ d dlm Z e j e¦ « Z G d„ dee¦ « Z dS )é N)ÚModifyDomainHookÚModifyUserHook)Úlve_supported_or_exit)Úregistry_path_by_usernamec óz — e Zd ZdZdZe dd„¦ « Zed„ ¦ « Zed„ ¦ « Ze d d„¦ « Z dS ) ÚDomainLimitsHookzª Keep the LVD on-disk state (domains.json + binary id-registry) in sync with control-panel domain and user events so that per-domain limits keep working. z/usr/sbin/lvectlNc óN — t |¦ « sd S |p|}| j dd|d|g} |r| d|gz } |r| d|gz } t j | dd¬¦ « } | j d k rNt d | j | j d¬¦ « ¦ « ¦ « d S d S ) Núregenerate-domainsú --usernamez--domainz--old-domainz --old-docrootTF©Úcapture_outputÚcheckr z%regenerate-domains failed (rc=%d): %sÚreplace©Úerrors© r ÚLVECTLÚ subprocessÚrunÚ returncodeÚlogÚwarningÚstderrÚdecodeÚstrip)ÚselfÚusernameÚdomainÚ new_domainÚinclude_subdomainsÚold_docrootÚnew_docrootÚkwargsÚcurrent_domainÚcmdÚresults ú(py/lve_utils/hooks/domain_limits_hook.pyÚpost_modify_domainz#DomainLimitsHook.post_modify_domain så € õ )¨Ñ2Ô2ð ØˆFà#Ð- vˆð ŒKÐ-ؘ(ؘð ˆð ð ,Ø�N FÐ+Ñ+ˆCØð 2Ø�O [Ð1Ñ1ˆCå” °DÀÐFÑFÔFˆØÔ Ò!Ð!Ý�KŠKØ7ØÔ!Ø” ×$Ò$¨IÐ$Ñ6Ô6×<Ò<Ñ>Ô>ñ ô ð ð ð ð "Ð!ó c ó" — t |¦ « sdS | j dd|d|g}t j |dd¬¦ « }|j dk rNt d |j |j d ¬¦ « ¦ « ¦ « dS dS )aç Drop the registrations the deleted domain leaves behind. Nothing else does: the registry entry is written by root, the panel never learns of it, and the single-domain regenerate path needs a docroot the panel can still resolve. Left alone the entry, its domains.json record and its kernel LVE outlive the domain, and every later `lvectl apply` reports the account as holding a registration the panel no longer lists (CLOS-7467). Nr r z--deleted-domainTFr r z;regenerate-domains after domain deletion failed (rc=%d): %sr r r )r r r r# r% r&