Edit: /opt/dedrads/__pycache__/docroot.cpython-313.pyc (5492B)
}jI S r SSKJr SSKJr SSKrSSKJr SSKrSSKrSS jr SS jr
SS jrS r\
S
:X a \" 5 gg)z
@noaha
Quickly and accurately return the document root of a given domain
owned by the current cPanel user as reported by cPanel userdata
)getuser)argvN)geteuidc [ U SS9 nUR 5 nSSS5 [
R " W[
R S9$ ! , ( d f N2= f! [ a$ U( a [ R " SU - 5 Nae f = f! [
R a. nU( a! [ R " SU SU 35 SnAge SnAff = f)zO
return yaml object from filename and
handle exceptions according exit_on_fail
utf-8encodingNzCould not read file: %s)LoaderzUnable to parse YAML from z:
) openreadOSErrorsysexityamlload
SafeLoader YAMLError)filenameexit_on_failf yaml_texterrs /opt/dedrads/docroot.py load_yamlr s
(W
-I .yy4??;; .
- HH.9: >> HH1(3seDEE sJ
A A A "B
AA A *BBC
#CCC
c U ( d( U( a [ R " S5 [ S5 eU( d( U( a [ R " S5 [ S5 eUR 5 nSU - n[ X25 nUR S5 ( a XS ; a UR
SS5 S nUS U:X d XS ; a S
U SU 3nO[XS ; a S
R XS 5 nO>XS ; a S
R XS U 5 nOU( a [ R " S5 g[ XR5 nUS U:X d" [ R " SU- US 5 ( a US $ U( a [ R " SU 35 g)z
Get the full path to a domain/vhost's document root.
If exit_on_fail is True, the process will exit upon failure
This is in place for use as a module
If disabled, throws: yaml.YAMLError, IOError,
zcPanel user was not specifiedzUser must have valuezDomain was not specifiedzvhost must have valuez/var/cpanel/userdata/%s/mainzwww.sub_domains main_domainz/var/cpanel/userdata//parked_domainsz/var/cpanel/userdata/{}/{}
addon_domainsz Unable to find vhost in userdataN
servernamez(^| )%s( |$)serveraliasdocumentrootz0Something is wrong, the domain was not found in )
r r
ValueErrorlowerr
startswithsplitformatresearch)uservhostr
userdata_fileuserdatadomain_datafiledomain_datas r get_docrootr2 &