ó b=0Yc@sØddlZddlZddlZyddlZWnek rMdZnXddlmZddlmZm Z dZ d„Z dZ dZ dZdde d „Ze d „Zd „Zd „Zde d „ZdS(iÿÿÿÿN(t NoPackage(t NotSupportedtNoDBAccessDatat ISPManagercCs"tjjdƒp!tjjdƒS(Ns/usr/local/ispmgr/bin/ispmgrs/usr/local/mgr5/sbin/mgrctl(tostpathtisfile(((sE/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/ispmanager.pytdetectss!/usr/local/ispmgr/etc/ispmgr.confs(\S+) "([^"]+)" {([^}]+)}s (\S+)\s+(\S+)cCsœtƒ}d}|r tƒ}x|D]t}|jƒ}t|ƒdkrs|jt|gƒƒ|j|dƒq%t|ƒdkr%|j|dƒq%q%Wnt|ƒ}tƒ} xÖtj t |j ƒƒD]Œ\} } } tj t | ƒ} | |krÎ|d|fkrÎtg| D]0\}}|dks;||kr||f^qƒ}t |jƒƒjt |jƒƒƒrŠ| j|ƒqŠqÎqÎW|jƒ| S(sK /usr/local/ispmgr/etc/ispmgr.conf parser :param sectype: Type sector for example: Service or DbServer or Account :param secname: Name sector. May be different :param seckeys: Name key for retrieving and filtering :param path: path to config file default /usr/local/ispmgr/etc/ispmgr.conf :return: list iiiN(tdicttNonetlisttsplittlentupdatetappendtopentretfindalltSECTION_PATTERNtreadtKEYWORDS_PATTERNtsettitemstissubsettclose(tsectypetsecnametseckeysRtseckeys_filtertseckeys_extractedtkey_valtkey_val_splitedt conf_streamt result_listtstypetsnametsbodytblsttktvtresult((sE/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/ispmanager.pyt conf_parss.      (-' cCsœtƒ}tddddd|ƒ}x^|D]V}y<|d|d <|d|d <|d|d control panel login) pairs from ISPmanager config file :param cplogin_lst: :param _conf_path: :return: iis DbAssign is?WARNING: can not find group name with id %s; line %d in file %ss(WARNING: can not pars line %d in file %sN( RRtgrptgetgrallt enumeratet startswithR R R=tintR t ValueErrorR( t cplogin_lstR4R t grp_tupletgrpid_login_dictt line_numbtlinet line_splitedtdbnametuser_uidtcplogin((sE/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/ispmanager.pyt_dbname_cplogin_pairs_itercs$ 3    (RRRIR<t ImportErrorR tclcommon.cpapi.cpapiexceptionsRRRt __cpname__Rt ISP_DB_CONFRRR)R8RGRHRX(((sE/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/ispmanager.pyts$      $