l#g ~ddlZddlZddlmcmZddlmZeeZdZ dZ e e gZ dZ dZ GddZdS) N) getLoggermu_plugin_installationadvice_email_notification!/usr/sbin/cloudlinux-xray-managerc4 tjd}|dD]B}|dj|kr"|ddjcSCn)#t t ttjf$rYdSwxYwdS)Nz/etc/sysconfig/rhn/systemidmembernamevaluer) etreeparseiterfindtextIOError IndexErrorKeyError ParseError)r rhn_systemid_xmlrs ^/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/utils/wordpress_mu_plugin.py get_rhn_valuers ;'DEE&++H55 4 4F{{6""'4//{{7++A.33330 4 Z5+; <tt 4sA*A/-A//"BBc*eZdZedZdZdS)WordPressMuPluginc td}|rWtjddd|ddgdd}td |j|jdSdS) N system_idrzenable-user-agentz --system_idzID-T)capture_outputrz1Activation xray manager captured out: %s, err: %s)r subprocessrunreplaceloggerinfostdoutstderr)rprocs r _setup_agentzWordPressMuPlugin._setup_agents!+..  >7'!%%eR00  $   D KKC         ct|dk|gs8tdt|t|dS|s*tdt|dStjtstd| dS)z Must use plugin works only if xray-user-agent is running So it is a requirement to be sure it is turned on It is expected to be turned on by default after conversion to Cloulinux Pro edition activeznNothing to prepare for Must Use plugin as settings are not turned on, activation status=%s mu_plugin_status=%sNz=Nothing to prepare for Must Use plugin as mu_plugin_status=%szXalt-php-xray rpm package is not installed in the system, please install it and try again) allr warningstrospathexists XRAY_MANAGER ValueErrorr%)selfactivation_statusmu_plugin_statuss r"prepare_for_mu_plugin_installationz4WordPressMuPlugin.prepare_for_mu_plugin_installation.s%13CDEE  NNN%&&$%%     F  NN)$%%    Fw~~l++ A  r&N)__name__ __module__ __qualname__ staticmethodr%r4r&rrrs<\&r&r)rr,xml.etree.ElementTreer ElementTreeloggingrr5r MU_PLUGIN_INSTALLATIONADVICE_EMAIL_NOTIFICATIONMU_PLUGIN_KEYSr/rrr9r&rr@s %%%%%%%%% 8  17(*CD2 4444444444r&