ó –­PSc@ssddljZddlZddlZddlZddlmZddlm Z m Z de fd„ƒYZ dS(iÿÿÿÿN(t DebugValues(tIMG_USERt IMG_ENTIREtActuatorcBs3eZdZeddddddgƒZiieƒd6eƒd6eƒd6ejjjej j fgd6eƒd6eƒd6d6ieƒd6eƒd6eƒd6ejjjej j fgd6eƒd6eƒd6d6ieƒd6eƒd6eƒd6ejjjej j fgd6eƒd6eƒd6d 6Z d „Z e d"d „ƒZe d"d „ƒZe d"d „ƒZd„Zd„Zed„ƒZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d„Z#d„Z$d „Z%d!„Z&RS(#s[Actuators are action attributes that cause side effects on live images when those actions are updated, installed or removed. Since no side effects are caused when the affected image isn't the current root image, the OS may need to cause the equivalent effect during boot. This is Solaris specific for now. s reboot-neededs release-notet refresh_fmrit restart_fmrit suspend_fmrit disable_fmritinstalltremovaltupdatecCs^i|_i|_i|_d|_d|_t|_d|_d|_ t |_ d|_ dS(Nti( RR R tNonet suspend_fmristtmp_suspend_fmristTruet do_nothingtcmd_patht sync_timeouttFalset act_timed_outtzone(tself((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pyt__init__Rs         cCs%tjjtj|jtjd|ƒS(sReturns the serialized state of this object in a format that that can be easily stored using JSON, pickle, etc.tje_state(tpkgtmisct json_encodeRt__name__t__dict__t_Actuator__state__desc(tobjR((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pytgetstate^scCsDt|ƒj}tjj||tjd|ƒ}|jj|ƒdS(sjUpdate the state of this object using previously serialized state obtained via getstate().tjd_stateN( ttypeRRRt json_decodeRRRR (RtstateR!tname((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pytsetstateescCs tƒ}tj|||ƒ|S(s`Allocate a new object using previously serialized state obtained via getstate().(RR&(R$R!trv((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pyt fromstatets cCs ||_dS(s8 Set actuator timeout. 'timeout' Actuator timeout in seconds. The following special values are allowed: 0: don't use synchronous actuators -1: no timeout, wait until finished N(R(Rttimeout((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pyt set_timeout|scCs ||_dS(sƒSpecify if actuators are supposed to be run within a zone. If 'zname' is None, actuators are run in the global zone, otherwise actuators are run in the zone 'zname'. The caller has to make sure the zone exists and is running. If there are any issues with calling an actuator in the zone, it will be ignored.N(R(Rtzname((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pytset_zone…scCs|jS(N(R(R((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pyt timed_outscCs|jp|jp|jS(N(RR R (R((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pyt__bool__“scCst|jp|jp|jƒS(N(tboolRR R (R((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pyt __nonzero__–scCs#|j|j|j|jjƒdS(N(t_Actuator__scanRtdsttptdestination_fmri(Rtap((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pyt scan_installšscCs#|j|j|j|jjƒdS(N(R1R tsrcR3t origin_fmri(RR5((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pyt scan_removalscCsN|jr+|j|j|j|jjƒn|j|j|j|jjƒdS(N(R7R1R R3R4R2(RR5((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pyt scan_update s "cCsµ|j}x¥t|jƒƒ|j@D]Š}|dkry||}t|tƒsZ|g}n|j|tƒƒj|ƒq#|jdkr#|j|tƒƒj ||fƒq#q#WdS(Ns release-notetfile( tattrstsettkeystactuator_attrst isinstancetlistt setdefaultR R%tappend(Rt dictionarytacttfmriR<tatvalues((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pyt__scan¥s     cCsãd„}i}xn|j|j|jgD]T}xK|jƒD]=}x4|||ƒD]"}|j|tƒƒj|ƒqRWq;Wq(W|jƒr¢tdgƒ|dRBR=taddt reboot_needed(RRMtmergetdRGtsmfRF((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pytget_list²s (  cCs&|jjdgƒ|jjdgƒS(s2Returns a list of tuples of possible release notess release-note(R tgetR(R((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pytget_release_note_infoËscCs5g|jƒD]$\}}|dkr ||f^q S(s2Returns a list of services that would be restartedRJRN(struesfalse(RT(RRFRS((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pytget_services_listÐscCsdjd„|jƒDƒƒS(Ns css%|]\}}d||fVqdS(s %16s: %sN((t.0RFRS((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pys Ös(tjoinRT(R((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pyt__str__Õs cCstd|jjdgƒkƒS(sNReturns True if action install execution may require a reboot.RJs reboot-needed(R/RRU(R((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pytreboot_advisedÙscCs@td|jjdgƒkƒp?td|jjdgƒkƒS(sQReturns True if action execution requires a new boot environment.RJs reboot-needed(R/R RUR (R((s9/usr/lib/python2.7/vendor-packages/pkg/client/actuator.pyRPßs!cOs†|jr|j|ds