Ņō i'dWc@sdddkZddkiZddklZlZlZddkl Z dei fd„ƒYZ dS(iĸĸĸĸN(tDisktSlicet Partition(tZvolt SetupSwapcBs,eZdZd„Zd„Zed„ZRS(sgICT checkpoint that sets up the swap in /etc/vfstab on the target during an AI installation cCstt|ƒi|ƒdS(sĩInitializes the class Parameters: -name - this arg is required by the AbstractCheckpoint and is not used by the checkpoint. N(tsuperRt__init__(tselftname((s../setup_swap.pyR'sc Cs|iidƒd}tƒ}|iidtƒ}g}|D]}|io ||q?q?~}xę|D]â}|id j oF|iid j o3t |it ƒo d|iii |i f}n]|id j o0t |it ƒod|ii |i f}n|iidt|ƒƒqjd|}|iid|ƒ|i|ƒqjW|iidtƒ} g} | D]!} | idjo | | qpqp~ } xs| D]k} | id j o<tiid | iƒ}|iid |ƒ|i|ƒqĄ|iid t| ƒƒqĄW|S( s,Get a list of swap devices from DESIRED treesSearching for swap devicestt class_types%ss%ss$Unable to determine path to slice %ss /dev/dsk/%ssFound swap slice %stswaps /dev/zvol/dsksFound swap zvol %ss#Unable to determine path to zvol %sN(tloggertdebugtlistttargettget_descendantsRtis_swaptparenttNonet isinstanceRtctdRRtstrtappendRtusetostpathtjoint full_realname(Rt swap_patht swap_devicestslicest_[1]tst swap_slicest swap_slicet slice_ctdtzvolst_[2]tzvolt swap_zvolst swap_zvolt zvol_path((s../setup_swap.pyt_get_swap_devices/sD /    5   cCs |iidƒ|iƒtii|itiƒ}|i ƒ}|p―ygt |dƒi i ƒ}zD|~}x4|D],}|i d|ddddddfƒqxWWdQXWqtj oC}|iid|ƒ|iit|ƒƒtd |ƒ‚qXndS( sų The AbstractCheckpoint class requires this method in sub-classes. Looks for swap devices in the DESIRED target tree, and adds each of these to the /etc/vfstab. Parameters: - the dry_run keyword paramater. The default value is False. If set to True, the log message describes the checkpoint tasks. Returns: - Nothing On failure, errors raised are managed by the engine. s)ICT current task: Setting up swap devicessa+s%s %s %s %s %s %s %s t-R tnoNs#Failed to open file %s for writing.s'Unable to setup swap devices in file %s(R R t parse_docRRRt target_dirtICTtVFSTABR+topent__exit__t __enter__twritetIOErrorRt RuntimeError(Rtdry_runtvfstabRR tvftdevicetioe((s../setup_swap.pytexecute_s"  & +  (t__name__t __module__t__doc__RR+tFalseR=(((s../setup_swap.pyR"s  0( Rtsolaris_install.icttictR0tsolaris_install.target.physicalRRRtsolaris_install.target.logicalRt ICTBaseClassR(((s../setup_swap.pyts