id ,ddlmZmZGddeeZy))Plugin RedHatPluginc.eZdZdZdZdZdZdZdZdZ y)sapnwz SAP NetWeaver)sap)z/usr/sapc n|jdd}|ddk7ryd}d}d}d }t}|d jD]T}d |vs |jd r|j j }t |d krH|d} |d} |d} |j| d| z} |j| s|j| D]tfd| | | fDsd| z} d| z}j }|j|| || |fzd|z|j|| || fz| d| d|j|| || fz| d| d| j}| d|d| d}|j||| fz|W|D]} |jd| zy)Nz9/usr/sap/hostctrl/exe/saphostctrl -function ListInstances SAPInstancessuggest_filenamestatusrz7env -i %s %s/sappfpar all pf=/usr/sap/%s/SYS/profile/%sz7env -i %s %s/sapcontrol -nr %s -function GetProcessListz7env -i %s %s/sapcontrol -nr %s -function GetVersionInfoz:su - %sadm -c "sapcontrol -nr %s -function GetEnvironment"outputDAAzNo instances foundz/usr/sap/%s/SYS/profile/c3&K|]}|v yw)N).0flines :/usr/lib/python3/dist-packages/sos/report/plugins/sapnw.py z/sapnw.collect_list_instances..3sA19Asz'LD_LIBRARY_PATH=/usr/sap/%s/SYS/exe/runz"/usr/sap/%s/SYS/exe/uc/linuxx86_64z %s_parameters_ _GetProcList _GetVersInfoadm__userenvz/usr/sap/%s/*DVEB*/work/dev_w0)collect_cmd_outputset splitlines startswithstripsplitlenadd path_existslistdiralladd_cmd_outputlower add_copy_spec)selfinst_outprof_cmdinst_cmdvers_cmduser_cmd sidsunique inst_linefieldssidinstvhostpathldenvptprofilelowsidfnamers @rcollect_list_instanceszsapnw.collect_list_instancess!** G++  H  " MLLOU "(+668- IY&(()=>"*002v;?Qiayq s#1C7''- LL. DAsD%.@AA IC OBCG"&**,++$r3'@@-r[s4@FFL@Fr@