ó i'dWc@sdddlZddlZddljZddlmZddlmZdej fd„ƒYZ dS(iÿÿÿÿN(tPopen(tZvolt UpdateDumpAdmcBs,eZdZd„Zd„Zed„ZRS(ssICT checkpoint class updates the dumpadm.conf file to customize it according to the install parameters. cCstt|ƒj|ƒdS(s£Initializes the class Parameters: -name - this arg is required by the AbstractCheckpoint and is not used. N(tsuperRt__init__(tselftname((supdate_dumpadm.pyR&scCsñtƒ}|jjdtƒ}g|D]}|jdkr%|^q%}xq|D]i}|jd k rtjj d|j ƒ}|j j d|ƒ|j |ƒqM|j j dt|ƒƒqMW|rít|ƒdkråtd|ƒ‚n|dSd S( sÆ Returns the dump zvol device specified in the desired target tree. If no dump zvols specified, return None If more than one dump zvol specified, raise RuntimeError. t class_typetdumps /dev/zvol/dsksFound dump zvol %ss#Unable to determine path to zvol %sisMultiple dump devices found: %siN(tlistttargettget_descendantsRtusetparenttNonetostpathtjoint full_realnametloggertdebugtappendtstrtlent RuntimeError(Rt dump_devicestzvolstzvolt dump_zvolst dump_zvolt zvol_path((supdate_dumpadm.pyt_get_dump_device.s" (     cCsƒ|jƒ|jƒ}|rtjd|jd|g}|jjd|ƒ|stj|dtj dtj d|jƒqndS(s( The AbstractCheckpoint class requires this method in sub-classes. Updates the dumpadm.conf file using 'dumpadm -r' to customize it according to the install parameters. Parameters: - the dry_run keyword parameter. The default value is False. If set to True, the log message provides the steps that would be run for the checkpoint. Returns: - Nothing On failure, errors raised are managed by the engine. s-rs-ds Executing: %ststdouttstderrRN( t parse_docRtICTtDUMPADMt target_dirRRRt check_calltSTORE(Rtdry_runt dump_devicetcmd((supdate_dumpadm.pytexecuteMs  (t__name__t __module__t__doc__RRtFalseR+(((supdate_dumpadm.pyR"s  ( Rtshutiltsolaris_install.icttictR#tsolaris_installRtsolaris_install.target.logicalRt ICTBaseClassR(((supdate_dumpadm.pyts