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    
python3-dmapi / usr / lib / python3.6 / site-packages / dmapi / __pycache__ / exception_wrapper.cpython-36.opt-1.pyc
Size: Mime:
3

ÿn‚a­ã@s¤ddlZddlZddlmZddlZddlmZddlmZddl	m
Z
ddlmZddlmZej
jZdd	„Zejd
d„ƒZdd
„Zddd„Zdd„Zdd„ZdS)éN)Úexcutils)Úbase)Ú	exception)Úfields)Úrpc)Ú
safe_utilscCs t|||||ƒt|||ƒdS)N)Ú#_emit_legacy_exception_notificationÚ&_emit_versioned_exception_notification)ÚnotifierÚcontextÚexÚ
function_nameÚargsÚsource©rú'/usr/lib/python3.6/exception_wrapper.pyÚ_emit_exception_notifications
rcCsRtjj|ƒ}tjtj|d}tjdtj	j
d}tj||tjj
|d}|j|ƒdS)N)ÚhostrZcompute)ÚobjectÚaction)Ú	publisherÚ
event_typeZpriorityÚpayload)rZExceptionPayloadÚfrom_exceptionrZNotificationPublisherÚCONFrZ	EventTyperZNotificationActionZ	EXCEPTIONZExceptionNotificationZNotificationPriorityZERRORÚemit)rrrZversioned_exception_payloadrrZnotificationrrrr	sr	cCst||d}|j|||ƒdS)N)rr)ÚdictÚerror)r
rrr
rrrrrr*srcs‡‡‡fdd„}|S)zšThis decorator wraps a method to catch any exceptions that may
    get thrown. It also optionally sends the exception to the notification
    system.
    cs ‡‡‡‡fdd„}tjˆƒ|ƒS)Ncsˆyˆ||f|ž|ŽStk
r‚}zTtjƒ@ˆs6ˆrhtˆ||f|ž|Ž}ˆj}tˆpZˆƒ||||ˆƒWdQRXWYdd}~XnXdS)N)Ú	ExceptionrZsave_and_reraise_exceptionÚ_get_call_dictÚ__name__r)ÚselfrrÚkwÚeÚ	call_dictr
)ÚbinaryÚfÚget_notifierr
rrÚwrapped6s
z.wrap_exception.<locals>.inner.<locals>.wrapped)Ú	functoolsÚwraps)r&r()r%r'r
)r&rÚinner5szwrap_exception.<locals>.innerr)r
r'r%r+r)r%r'r
rÚwrap_exception0sr,cOs@tj|ƒ}tj|||f|ž|Ž}|jddƒ|jddƒt|ƒS)Nr!r)rZget_wrapped_functionÚinspectZgetcallargsÚpopÚ
_cleanse_dict)Zfunctionr!rrr"Zwrapped_funcr$rrrrIs
rcCsdd„t|jƒƒDƒS)zAStrip all admin_password, new_pass, rescue_pass keys from a dict.cSsi|]\}}d|kr||“qS)Z_passr)Ú.0ÚkÚvrrrú
<dictcomp>Ysz!_cleanse_dict.<locals>.<dictcomp>)ÚlistÚitems)Zoriginalrrrr/Wsr/)NNN)r)r-Z
oslo_utilsrZ
dmapi.confZdmapiZdmapi.notifications.objectsrrZ
dmapi.objectsrrrZconfrrZif_notifications_enabledr	rr,rr/rrrrÚ<module>s