Ńņ i'dWc@sldZddklZddklZdefd„ƒYZdefd„ƒYZdefd „ƒYZd S( s| boot_spec.py -- library containing class definitions for boot DOC objects, including BootMods, BootEntry, and BootAdm. i’’’’(tetree(t DataObjecttBootModscBs_eZdZdZdZdZdZd„Zd„Zd„Z e d„ƒZ e d „ƒZ RS( sc Subclass of DataObject to contain the boot_mods information in the Data Object Cache. t boot_modsttitlettimeouttfirmwarecCs5tt|ƒi|ƒd|_d|_d|_dS(s5 Initialize the DataObject object with name. N(tsuperRt__init__tNoneRRR(tselftname((s../boot_spec.pyR,s  cCsyd}|idj o|d|i7}n|idj o|d|i7}n|idj o|d|i7}n|S(s5 String representation of a BootMods object. s BootMods: s title="%s"; s timeout=%d; s firmware="%s"N(RR RR(R trep((s../boot_spec.pyt__repr__4scCsštitiƒ}|idj o|iti|iƒn|idj o |iti t |iƒƒn|i dj o|iti |i ƒn|S(s5 Method to create the xml boot_mods element. N( RtElementRtBOOT_MODS_LABELRR tsett TITLE_LABELRt TIMEOUT_LABELtstrRtFIRMWARE_LABEL(R telement((s../boot_spec.pytto_xml@s cCs|itijotStS(s\ Returns True if element has tag: "boot_mods". Returns False otherwise. (ttagRRtTruetFalse(tclsR((s../boot_spec.pyt can_handlePscCs|itiƒ}|itiƒ}|itiƒ}ttiƒ}|dj o ||_n|dj ot|ƒ|_ n|dj o ||_ n|S(s5 Method to create the DOC boot_mods element. N( tgetRRRRRR RtintRR(RRRRRR((s../boot_spec.pytfrom_xmlYs     ( t__name__t __module__t__doc__RRRRRR Rt classmethodRR(((s../boot_spec.pyR#s   t BootEntrycBseeZdZdZdZdZdZdZd„Zd„Z d„Z e d „ƒZ e d „ƒZ RS( sj Subclass of DataObject to contain a boot_entry objects information in the Data Object Cache. t boot_entryt default_entryt insert_att title_suffixt kernel_argscCs>tt|ƒi|ƒd|_d|_d|_d|_dS(s5 Initialize the DataObject object with name. N(RR#RR R%R&R'R((R R ((s../boot_spec.pyRvs    cCsžd}|idj o|d|i7}n|idj o|d|i7}n|idj o|d|i7}n|idj o|d|i7}n|S(s6 String representation of a BootEntry object. s BootEntry: stitle_suffix="%s"; s default=%s; sinsert_at=%s; skernel_args="%s"N(R'R R%R&R((R R ((s../boot_spec.pyR scCsątitiƒ}|idj o&|itit|iƒi ƒƒn|i dj o|iti |i ƒn|i dj o%ti |tiƒ}|i |_n|idj o%ti |tiƒ}|i|_n|S(s6 Method to create the xml boot_entry element. N(RRR#tBOOT_ENTRY_LABELR%R RtDEFAULT_ENTRY_LABELRtlowerR&tINSERT_AT_LABELR't SubElementtTITLE_SUFFIX_LABELttextR(tKERNEL_ARGS_LABEL(R Rt title_elementt kargs_element((s../boot_spec.pyRs     cCsk|itijotSd}x4|iƒD]&}|itijo |i}q+q+W|djotStS(s¢ Returns True if element has the tag "boot_entry", and a sub-elemenent that has the tag: "title_suffix". Returns False otherwise. N( RR#R)RR t iterchildrenR.R/R(RRR't subelement((s../boot_spec.pyR£s  cCs9d}d}|itiƒ}|itiƒ}xT|iƒD]F}|itijo |i}n|iti jo |i}q=q=Wtti ƒ}|dj o ||_ n|dj o ||_ n|dj o ||_ n|dj oD|iƒdjo t|_q5|iƒdjo t|_q5n|S(s4 Method to create a DOC boot_entry element. ttruetfalseN(R RR#R*R,R3RR.R/R0R)R&R'R(R+RR%R(RRR'R(R%R&R4R$((s../boot_spec.pyR·s.          (RR R!R)R*R,R.R0RR RR"RR(((s../boot_spec.pyR#ls  tBootAdmcBsSeZdZdZdZd„Zd„Zd„Zed„ƒZ ed„ƒZ RS(s] Subclass of DataObject to contain the bootadm command in the Data Object Cache. tbootadmtcmdcCs&tt|ƒi|ƒtƒ|_dS(s5 Initialize the DataObject object with name. N(RR7Rtlisttcmd_list(R R ((s../boot_spec.pyRŽscCs@d}|idj o&x#|iD]}|d|7}q Wn|S(s4 String representation of a BootAdm object. s BootAdm: s cmd="%s"; N(R;R (R R R9((s../boot_spec.pyR äs  cCs\titiƒ}|idj o6x3|iD]$}ti|tiƒ}||_q,Wn|S(s3 Method to create the xml bootadm element. N( RRR7tBOOT_ADM_LABELR;R R-t CMD_LABELR/(R RR9t cmd_element((s../boot_spec.pyRķs   cCs|itijotStS(s[ Returns True if element has tag: "boot_cmd". Returns False otherwise. (RR7R<RR(RR((s../boot_spec.pyRśscCsttƒ}x;|iƒD]-}|itijo|i|iƒqqWttiƒ}|dj o ||_ n|S(s3 Method to create the DOC bootadm element. N( R:R3RR7R=tappendR/R<R R;(RRR;R4R8((s../boot_spec.pyRs    ( RR R!R<R=RR RR"RR(((s../boot_spec.pyR7×s   N(R!tlxmlRtsolaris_install.data_objectRRR#R7(((s../boot_spec.pyts Ik