Ñò i'dWc @s«dZddkZddkZddkZddkZddkZddklZddk l Z ddk l Z ddk lZeddƒZd efd „ƒYZdS( si configuration Configuration object class for handling the elements in the manifest. iÿÿÿÿN(tetree(t ParsingError(tDataObjectCache(tSimpleXmlHandlerBases /dev/nullsr+t ConfigurationcBs°eZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdddgZdddddgZd„Zd„Zed„ƒZed„ƒZRS(t configurationtnametsourcetarchivettypetdestt validationtpathtargston_errortnetworktusertsysconftzonetfilethttpthttpstftpcCsGtt|ƒi|ƒd|_d|_d|_d|_d|_dS(N( tsuperRt__init__tNoneRRR R R (tselfR((s../configuration.pyREs     cCs=titiƒ}|iti|iƒ|idj o|iti |iƒn|i dj o|iti |i ƒn|i dj o|iti |i ƒn|idj o|iti|iƒn|idj oYti|tiƒ}xA|iiƒD],\}}|i||ƒ|i||ƒqWn|S(N(RtElementRtTAG_NAMEtsett NAME_LABELRRRt SOURCE_LABELRtZONE_ARCHIVE_LABELR t TYPE_LABELR t DEST_LABELR t SubElementtVALIDATION_LABELtitems(Rtelementtvalidation_elementtkeytvalue((s../configuration.pytto_xmlNs$   cCsr|i|ijotS|i|iƒdjotSx5|i|igD]!}|i|ƒdj otSqIWtS(s© Returns True if element has: - the tag 'configuration' - a name attribute - a source attribute Otherwise returns False N( ttagRtFalsetgetRRR RtTrue(tclsR&tentry((s../configuration.pyt can_handlehs  cCs<h}|i|iƒ}|i|iƒ}|i|iƒ}|i|iƒ}|i|iƒ}|i|iƒ}d}d} ||ijo |dj o|} |i} nD|} |i } t i |ƒi djot d|i dƒ‚nt i | ddƒ} | i | jo(t d|i d| i | fƒ‚n|dj o[|dj oNt i |ddƒ} | i djo%| iot d|i d ƒ‚q¦nt i| ƒ}yti|ƒ}Wn_tj o*}t d|i d | |fƒ‚n+tj o| i d joq*‚nXxí|iƒD]ß}|i|ijoÆ|i|iƒ}|i|iƒ} |i|iƒ}|dj oCtii|ƒo|||i's0of the manifest. Unable to open source (%s): %sRs/Invalid element specified in the %s section of s0the manifest. validation path does not exist: %ststdouttstderrsError reading %s soelement from the source manifest. Source manifest specified could not be validated: %s. CalledProcessError: %s((R-RRR"R!R RtTYPE_VALUE_ZONEtARCHIVE_SUPPORTED_SCHEMEStSOURCE_SUPPORTED_SCHEMESturlparseR2RRtnetloct urlunparseturllibturlopentIOErrort Exceptiont iterchildrenR+R$t PATH_LABELt ARGS_LABELtON_ERROR_LABELtosR texiststsplitt subprocesst check_callt_NULLtCalledProcessErrorRRR R RR (R/R&R RRR R RR R tcfg_srctschemestcfg_srcptsrcpt cfg_srcuptfileobjtioet subelementRtcmdterrorR((s../configuration.pytfrom_xml~sž                      (t__name__t __module__RRRR R!R"R$R@RARBtTYPE_VALUE_NETWORKtTYPE_VALUE_USERtTYPE_VALUE_SYSCONFR5R6R7RR*t classmethodR1RT(((s../configuration.pyR1s( (t__doc__RFtsystos.pathRCR;R8tlxmlRtsolaris_install.data_objectRt!solaris_install.data_object.cacheRt"solaris_install.data_object.simpleRtopenRHR(((s../configuration.pyt s