ó b=0Yc@s;ddlZdefd„ƒYZdd„Zd„ZdS(iÿÿÿÿNtExternalProgramFailedcBseZd„ZRS(cCstj||ƒdS(N(t Exceptiont__init__(tselftmessage((s2/usr/lib/python2.7/site-packages/clcommon/utils.pyRs(t__name__t __module__R(((s2/usr/lib/python2.7/site-packages/clcommon/utils.pyRsc CsÂdj|ƒ}y=tj|dtdƒdtjdtjdtd|ƒ}Wn/tk r}}td|t |ƒfƒ‚nX|j ƒ\}}|j d kr¾t|pµd ||fƒ‚n|S( sv Runs external process and returns output @param cmd: command and arguments as a list @return: string t tstdins /dev/nulltstdouttstderrt close_fdstenvs%s. Can not run command: %sisoutput of the command: %s %s( tjoint subprocesstPopentopentPIPEtSTDOUTtTruetOSErrorRtstrt communicatet returncode(tcmdtenv_datatcmd_linetoutputtoserrtstd_outtstd_err((s2/usr/lib/python2.7/site-packages/clcommon/utils.pyt run_command s     cCs}t}t|dƒ}|jƒ}|jdƒx4|D],}|d|kr[|j|ƒq5t}q5W|jƒ|jƒ|S(s Delete line from file. Return True when line(s) have been deleted, False otherwise (specified line is not found) :param path: path to file :type path: string :param line: line to delete without EOL (' ') :type line: string :rtype bool sr+is%s (tFalseRt readlinestseektwriteRttruncatetclose(tpathtlinetfoundtftlinestl((s2/usr/lib/python2.7/site-packages/clcommon/utils.pytdelete_line_from_file#s       (RRRtNoneRR,(((s2/usr/lib/python2.7/site-packages/clcommon/utils.pyts