Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
dmapi / usr / lib / python2.7 / dist-packages / dmapi / objects / service.pyc
Size: Mime:
ó
Éec@sddlmZddlmZddlmZddlmZddl	m
Z
ddl	mZddlmZddlm
Z
ejeƒZd	Zid
d6fZdfd
„ƒYZe
jjde
je
je
jfd„ƒYƒZe
jjde
je
jfd„ƒYƒZdS(iÿÿÿÿ(tlog(tversionutils(t	exception(t_LW(tbase(tfields(tdb(tobjectsis4.13tcompute_rpctServicecBs)eZdZiZeZdZd„ZRS(s1.20icOs4d|kr'tjddddƒ‚nt|_dS(NtversiontactiontinittreasonsVersion field is immutable(RtObjectActionErrortSERVICE_VERSIONR
(tselftargstkwargs((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyt__init__&s

	(t__name__t
__module__tVERSIONt_MIN_VERSION_CACHEtFalset_SERVICE_VERSION_CACHINGRR(((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyR	s
cBsgeZdZi
ejdeƒd6ejƒd6ejdeƒd6ejdeƒd6ejdeƒd6ejƒd6ejƒd	6ejdeƒd
6ejdeƒd6ej	dƒd
6ej
deƒd6ejƒd6ejƒd6ZiZeZ
d„Zd„Zd„Zed„ƒZd„Zejd„ƒZejd„ƒZejd„ƒZejd„ƒZeejed„ƒƒZejed„ƒZejd„ƒZd„Zej d„ƒZ!ej d„ƒZ"d „Z#d!„Z$ej d"„ƒZ%e&d#„ƒZ'e&d$„ƒZ(eejed%„ƒƒZ)ejed&„ƒZ*ejed'„ƒZ+RS((s2.0t	read_onlytidtuuidtnullablethosttbinaryttopictreport_counttdisabledtdisabled_reasontavailability_zonetComputeNodetcompute_nodetlast_seen_uptforced_downR
cOsMd|kr'tjddddƒ‚ntt|ƒj||Žt|_dS(NR
RRR
sVersion field is immutable(RRtsuperR	RRR
(RRR((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyRQs	cCsÜtt|ƒj|||ƒtj|ƒ}|dkrMd|krM|d=n|dkrod|kro|d=n|d
kr‘d|kr‘|d=n|dkr³d	|kr³|d	=n|dkrØ|j|j||ƒndS(NiiRiR
iR(i
R'i
(ii(ii(ii(ii
(ii
(R)R	t!obj_make_compatible_from_manifestRtconvert_version_to_tuplet_do_compute_nodet_context(Rt	primitivettarget_versiontversion_manifestt_target_version((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyR*Zs




cCs`y+|d}tjj||dƒd}Wntk
r?dSX|jd|d|ƒ|d<dS(NR%RiR/R0R&(RtComputeNodeListtget_all_by_hostt	Exceptiontobj_to_primitive(RtcontextR.R0R/tcompute((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyR,ks
	
	cCs½d}x|jD]’}||kr4||kr4qn|dkrFqq|dkrrt|tj|ƒ||ƒq|dkr”|j|ƒr”qq||||<qW||_|jƒ|S(NR$R&R
R(R$(RtsetattrRtget_attrnametgetR-tobj_reset_changes(R6tservicet
db_servicet
allow_missingtkey((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyt_from_db_objectvs 	
cCsÖ|js*tjddd|jƒƒ‚ntjdi|d6|jƒd6|jd6ƒ|dkrƒtjd	dd
d|ƒ‚n|jdkr°t	j
j|j|jƒ}ntj
d
|jƒ‚|d|_dS(Ntmethodt
obj_load_attrtobjtypes-Lazy-loading '%(attr)s' on %(name)s id %(id)stattrtnameRR&RR
sattribute %s not lazy-loadablestvault-contegot
service_idi(R-RtOrphanedObjectErrortobj_nametLOGtdebugRRRRR2R3RtServiceNotFoundR&(Rtattrnamet
compute_nodes((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyRBŠs 		

		cCs(tj||ƒ}|j||ƒ|ƒS(N(Rtservice_getR@(tclsR6RFR=((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyt	get_by_idŸscCs(tj||ƒ}|j||ƒ|ƒS(N(Rtservice_get_by_uuidR@(ROR6tservice_uuidR=((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytget_by_uuid¤scCs+tj|||ƒ}|j||ƒ|ƒS(N(Rtservice_get_by_host_and_topicR@(ROR6RR R=((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytget_by_host_and_topic©scCsGytj|||ƒ}Wntjk
r0dSX|j||ƒ|ƒS(N(Rtservice_get_by_host_and_binaryRtHostBinaryNotFoundR@(ROR6RRR=((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytget_by_host_and_binary®s	cCstj||ƒS(N(Rtservice_get_by_compute_host(R6Rt	use_slave((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyt_db_service_get_by_compute_host·scCs.|j||d|ƒ}|j||ƒ|ƒS(NRZ(R[R@(ROR6RRZR=((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytget_by_compute_host¼s	cCs+tj|||ƒ}|j||ƒ|ƒS(N(RRVR@(ROR6RRR=((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytget_by_argsÂscCso|jdƒsdS|jdƒs&dS|j|j|jƒ}||jkrktjd|jd|ƒ‚ndS(sEnforce that we are not older that the minimum version.
        This is a loose check to avoid creating or updating our service
        record if we would do so with a version that is older that the current
        minimum of all services. This could happen if we were started with
        older code by accident, either due to a rollback or an old and
        un-updated node suddenly coming back onto the network.
        There is technically a race here between the check and the update,
        but since the minimum version should always roll forward and never
        backwards, we don't need to worry about doing it atomically. Further,
        the consequence for getting this wrong is minor, in that we'll just
        fail to send messages that other services understand.
        R
NRtthisvertminver(tobj_attr_is_settget_minimum_versionR-RR
Rt
ServiceTooOld(RR_((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyt_check_minimum_versionÇs
cCs®|jdƒr*tjddddƒ‚n|jƒ|jƒ}d|krltjƒ|d<|d|_ntj	|j
|ƒ}|j|j
||ƒ|jt
jjƒdS(NRRtcreateR
salready createdR(R`RRRctobj_get_changest	uuidutilst
generate_uuidRRtservice_createR-R@t_send_notificationRtNotificationActiontCREATE(RtupdatesR=((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyRdÝs
cCsh|jƒ}|jddƒ|jƒtj|j|j|ƒ}|j|j||ƒ|j	|ƒdS(NR(
RetpoptNoneRcRtservice_updateR-RR@t _send_status_update_notification(RRlR=((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytsaveís
cCs>t|jƒƒjdddhƒr:|jtjjƒndS(NR"R#R((tsettkeystintersectionRiRRjtUPDATE(RRl((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyRp÷sc	Csetj|ƒ}tjdtjj|ƒdtjddd|ƒdtjj	d|ƒj
|jƒdS(Nt	publishert
event_typetobjectR<Rtprioritytpayload(tservice_notificationtServiceStatusPayloadtServiceStatusNotificationtnotificationtNotificationPublishertfrom_service_objt	EventTypeRtNotificationPrioritytINFOtemitR-(RRRz((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyRiüs					cCs-tj|j|jƒ|jtjjƒdS(N(Rtservice_destroyR-RRiRRjtDELETE(R((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytdestroyscCs|jƒt|_dS(N(tclear_min_version_cachetTrueR(RO((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytenable_min_version_caches
cCs
i|_dS(N(R(RO((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyRˆscCstj||ƒS(N(Rtservice_get_minimum_version(R6tbinariesRZ((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyt_db_service_get_minimum_versionscstd„|DƒƒsJtjddj|ƒƒtjddddƒ‚nˆjspt‡fd†|Dƒƒrºˆj||d	|ƒ}|rÐd
„|j	ƒDƒ}ˆj
j|ƒqÐn‡fd†|Dƒ}|rët|j
ƒƒ}nd}t|ƒ}|S(
Ncss|]}|jdƒVqdS(snova-N(t
startswith(t.0R((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pys	<genexpr>ss>get_minimum_version called with likely-incorrect binaries `%s't,RRaR
sInvalid binary prefixc3s|]}|ˆjkVqdS(N(R(RR(RO(s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pys	<genexpr>#sRZcSs%i|]\}}|pd|“qS(i((RRR
((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pys
<dictcomp>(s	cs i|]}ˆj||“qS((R(RR(RO(s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pys
<dictcomp>-s	i(tallRItwarningtjoinRRRtanyRtitemsRtupdatetmintvaluestint(ROR6RŒRZtmin_versionsR
((ROs9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytget_minimum_version_multis*	


cCs|j||gd|ƒS(NRZ(R›(ROR6RRZ((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyRa8s(,RRRRtIntegerFieldR‰t	UUIDFieldtStringFieldtBooleanFieldtObjectFieldt
DateTimeFieldRRRRR*R,tstaticmethodR@RBRtremotable_classmethodRPRSRURXRtselect_db_reader_modeR[R\R]Rct	remotableRdRqRpRiR‡tclassmethodRŠRˆRR›Ra(((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyR	9s^



							
		tServiceListcBs‡eZdZiejdƒd6Zejd„ƒZejed„ƒZ	ejd„ƒZ
ejded„ƒZejd„ƒZ
RS(	s1.0R	RcCs1tj||ƒ}tj|||ƒtj|ƒS(N(Rtservice_get_all_by_topicRt
obj_make_listRR	(ROR6R tdb_services((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytget_by_topicGscCs7tj||d|ƒ}tj|||ƒtj|ƒS(Ntinclude_disabled(Rtservice_get_all_by_binaryRR©RR	(ROR6RR¬Rª((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyt
get_by_binaryMscCs1tj||ƒ}tj|||ƒtj|ƒS(N(Rtservice_get_all_by_hostRR©RR	(ROR6RRª((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytget_by_hostTscCsOtj|d|ƒ}|r0tj||ƒ}ntj|||ƒtj|ƒS(NR"(Rtservice_get_alltavailability_zonestset_availability_zonesRR©RR	(ROR6R"t	set_zonesRª((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytget_allZscCs7tj||dtƒ}tj|||ƒtj|ƒS(NR¬(Rt#service_get_all_computes_by_hv_typeRRR©RR	(ROR6thv_typeRª((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pytget_all_computes_by_hv_typecsN(RRRRtListOfObjectsFieldRR£R«RR®R°RnRµR¸(((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyR§?sN(toslo_logRtloggingt
oslo_utilsRtdmapiRt
dmapi.i18nRt
dmapi.objectsRRRRt	getLoggerRRIRtSERVICE_VERSION_HISTORYR	tContegoObjectRegistrytregistertContegoPersistentObjectt
ContegoObjecttContegoObjectDictCompattObjectListBaseR§(((s9/usr/lib/python2.7/dist-packages/dmapi/objects/service.pyt<module>s"ÿ