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    
Size: Mime:
a

ÑՉgù*ã@s†gd¢ZddlZddlmZddlZddlmZddl	m
Z
ddlmZddl
ZddlZddlmZejjZe e¡ZdadadadaejjgZgZdd	d
dœZdd
„Zddl m!Z!dd„Z"dd„Z#dd„Z$dd„Z%dd„Z&dd„Z'Gdd„dej(ƒZ)Gdd„dej*ƒZ+d5dd „Z,d6d!d"„Z-d#d$„Z.d7d%d&„Z/d8d'd(„Z0d)d*„Z1d+d,„Z2Gd-d.„d.e3ƒZ4Gd/d0„d0e3ƒZ5Gd1d2„d2e
j6ƒZ7d3d4„Z8dS)9)ÚinitÚcleanupÚset_defaultsÚadd_extra_exmodsÚclear_extra_exmodsÚget_allowed_exmodsÚRequestContextSerializerÚ
get_clientÚ
get_serverÚget_notifierÚTRANSPORT_ALIASESéN)Úlog)Ú	jsonutils)Ú
periodic_task)Ú	timeutils)Ú_ZrabbitZqpidZzmq)zcontego.rpc.impl_kombuzcontego.rpc.impl_qpidzcontego.rpc.impl_zmqcCst |¡dS©N)Ú	messagingZset_transport_defaults)Zcontrol_exchange©rú//usr/lib/python3.9/site-packages/contego/rpc.pyr2sr)ÚcfgcCs,tjdgd¢ddddg}|}| |¡dS)NÚnotification_format)ÚunversionedÚ	versionedÚbothrZDEFAULTÚ)ÚchoicesÚdefaultZdeprecated_groupÚhelp)rZStrOptÚ
register_opts)ÚconfZnotification_optsZALL_OPTSrrrr6sûÿ
rcCs°t|ƒtƒ}tj||datj||dattƒƒ}|j	dkr^tj
t|datj
t|ddanN|j	dkrŠtj
t|datj
t|dgdan"tj
t|ddatj
t|dgdadS)	N©Úallowed_remote_exmodsr)Ú
serializerZnoop)r#ZdriverrZversioned_notifications)r#Ztopics)
rrrÚ
get_transportÚ	TRANSPORTZget_notification_transportÚNOTIFICATION_TRANSPORTrÚJsonPayloadSerializerrZNotifierÚLEGACY_NOTIFIERÚNOTIFIER)r Úexmodsr#rrrrEs<ÿ

ÿÿ
ÿþþþrcCsTtdusJ‚tdusJ‚tdus$J‚tdus0J‚t ¡t ¡daaaadSr)r%r&r(r)rrrrrrbsrcGst |¡dSr)ÚEXTRA_EXMODSÚextend)ÚargsrrrrpsrcCstdd…=dSr)r+rrrrrtsrcCsttSr)ÚALLOWED_EXMODSr+rrrrrxsrc@seZdZedd„ƒZdS)r'cCstj|ddS)NT)Zconvert_instances)rZto_primitive)ÚcontextÚentityrrrÚserialize_entity}sz&JsonPayloadSerializer.serialize_entityN)Ú__name__Ú
__module__Ú__qualname__Ústaticmethodr1rrrrr'|sr'c@s4eZdZdd„Zdd„Zdd„Zdd„Zd	d
„ZdS)rcCs
||_dSr)Ú_base)ÚselfÚbaserrrÚ__init__„sz!RequestContextSerializer.__init__cCs|js
|S|j ||¡Sr)r6r1©r7r/r0rrrr1‡sz)RequestContextSerializer.serialize_entitycCs|js
|S|j ||¡Sr)r6Údeserialize_entityr:rrrr;Œsz+RequestContextSerializer.deserialize_entitycCs| ¡Sr)Zto_dict©r7r/rrrÚserialize_context‘sz*RequestContextSerializer.serialize_contextcCstjj |¡Sr)Úcontegor/ÚRequestContextZ	from_dictr<rrrÚdeserialize_context”sz,RequestContextSerializer.deserialize_contextN)r2r3r4r9r1r;r=r@rrrrr‚s
rcCstj t|t¡Sr)rZTransportURLÚparseÚCONFr)Zurl_strrrrÚget_transport_url˜srCcCsJtjj}tjjgg}tj||d}|dus0J‚t|ƒ}tj||||dS)Nr!©Úversion_capr#)	r>r rBÚ	exceptionr2rr$rÚ	RPCClient)ÚtargetrEr#r r*r%rrrrœsýrcCstjddd}t|ƒ}|S)NZdmapiz1.0)ZtopicÚversion)rZTargetr)rHÚclientrrrÚget_dmapi_rpc_client©srKcCs(tdusJ‚t|ƒ}tjt||d|dS)NZeventlet)Úexecutorr#)r%rrZget_rpc_server)rHZ	endpointsr#rrrr	¯sür	cCs2tdusJ‚|s"d||ptjf}ttj|dƒS)Nz%s.%s©Úpublisher_id)r(rBÚhostÚLegacyValidatingNotifierÚprepare)ZservicerOrNrrrr
¹s
ÿr
cCstdusJ‚tj|dS)NrM)r)rQrMrrrÚget_versioned_notifierÁsrRcCstƒ}tjt||dS)N)Úurlr")rrr$rB)rSr*rrrÚcreate_transportÆs
þrTc@s:eZdZdZdZdgZedƒZdd„Zdd„Z	d	d
„Z
dS)rPzDWraps an oslo.messaging Notifier and checks for allowed event_types.Fzaggregate.addhost.endze%(event_type)s is not a versioned notification and not whitelisted. See ./doc/source/notification.rstcCs*||_dD]}t||t |j|¡ƒq
dS)N)ÚdebugÚinfoÚwarnÚerrorZcritical)ÚnotifierÚsetattrÚ	functoolsÚpartialÚ_notify)r7rYÚpriorityrrrr9ás
ÿz!LegacyValidatingNotifier.__init__cCsddht| ¡ƒkS)NrFr-)ÚsetÚkeys)r7ÚpayloadrrrÚ_is_wrap_exception_notificationçsz8LegacyValidatingNotifier._is_wrap_exception_notificationcCsX||jvr@| |¡s@|jr.t|jd|iƒ‚nt |jd|i¡t|j|ƒ|||ƒdS)NÚ
event_type)	Ú'allowed_legacy_notification_event_typesrbÚfatalÚAssertionErrorÚmessageÚLOGZwarningÚgetattrrY)r7r^Zctxtrcrarrrr]ðs
ÿz LegacyValidatingNotifier._notifyN)r2r3r4Ú__doc__rerdrrgr9rbr]rrrrrPÍsÿ	rPc@s eZdZdd„Zedd„ƒZdS)Ú
ClientWrappercCs||_t ¡|_dSr)Ú_clientrÚutcnowÚlast_access_time)r7rJrrrr9üszClientWrapper.__init__cCst ¡|_|jSr)rrmrnrl)r7rrrrJs
zClientWrapper.clientN)r2r3r4r9ÚpropertyrJrrrrrkûsrkcs8eZdZdZ‡fdd„Zd	dd„Zejdd„ƒZ‡ZS)
ÚClientRouterzËCreates and caches RPC clients that route to cells or the default.

    The default client connects to the API cell message queue. The rest of the
    clients connect to compute cell message queues.
    csZtt|ƒ t¡i|_t|ƒ|jd<|j|_|j|_t|ddƒ|_	| 
tjj
dd¡dS)Nrr#F)Z	overwrite)Úsuperrpr9rBÚclientsrkrHrErir#Zrun_periodic_tasksr>r/r?)r7Zdefault_client©Ú	__class__rrr9szClientRouter.__init__Nc	Csh|r|j}nd}z|j|j}WnBtybt|jƒ}tj||j|j	|j
d}t|ƒ|j|<Yn0|S)NrrD)ZuuidrrrJÚKeyErrorrTZ
transport_urlrrGrHrEr#rk)r7r/Zcell_mappingÚ	client_idrJZ	transportrrrrls

þzClientRouter._clientcsLd‰‡fdd„}t|j ¡ƒ}|D]$\}}|dkr"|||jƒr"|j|=q"dS)Né<cs"t |ˆ¡rt d||¡dSdS)Nz;Removing stale RPC client: %s as it was last accessed at %sTF)rZ
is_older_thanrhrU)rvrn©ÚtimeoutrrÚstale,sÿz1ClientRouter._remove_stale_clients.<locals>.staler)ÚlistrrÚitemsrn)r7r/rzZ
items_copyrvZclient_wrapperrrxrÚ_remove_stale_clients(s
ÿz"ClientRouter._remove_stale_clients)N)	r2r3r4rjr9rlrr}Ú
__classcell__rrrsrrps

rpcst ˆ¡‡fdd„ƒ}|S)zCCalls decorated method only if versioned notifications are enabled.cs*t ¡r"tjjdvr"ˆ|i|¤ŽSdSdS)N)rr)r)Z
is_enabledrBZ
notificationsr)r-Úkwargs©ÚfrrÚwrapped=s

ÿz)if_notifications_enabled.<locals>.wrapped)r[Úwraps)rr‚rr€rÚif_notifications_enabled;sr„)N)NN)N)NN)9Ú__all__r[Zoslo_logr
ZloggingZoslo_messagingrZoslo_serializationrZoslo_servicerZ
oslo_utilsrZcontego.confr>Zcontego.exceptionZcontego.i18nrr rBZ	getLoggerr2rhr%r(r&r)rFr.r+rrZoslo_configrrrrrrrZNoOpSerializerr'Z
SerializerrrCrrKr	r
rRrTÚobjectrPrkZ
PeriodicTasksrpr„rrrrÚ<module>sT

ý





.5