U uZIeU @sddlmZddlmZddlZe ejdedddlmZW5QRXddl m Z ddl m Z m Z mZdd lmZmZmZmZmZdd lmZdd lmZmZeed rejZnddlZd dZeeZeeZddZ ddZ!ddZ"dS))datetime)EINVALNignore)category) load_source)dump)chmodmkdirstat)dirnamejoinisdirisfilerealpath)search)exc_info version_infostrptimecCstt||ddS)Nr)rtimer) date_stringformatrB/opt/microsoft/omsconfig/Scripts/python3/OperationStatusUtility.pyrcCst}t|d}t|S)Nz%Y/%m/%d %H:%M:%S)rnowstrftimestr)ZcurrentDateTimeZcurrentDateTimeFormattedStringrrrget_current_timestamps rcCsd|}t|dd}|S)NZ0o)base)int)ZthreeDigitStringZstrModeZoctModerrrget_permission_in_octs r#cCs8t|}t|r4tt|j|@}||ks4t||dS)N)r#roctr st_moder)ZfilePathZpermissionStringZdesiredPermissionZfilePermissionrrrensure_file_permissions%s r&)#rerrnorwarningscatch_warningsfilterwarningsDeprecationWarningimprjsonrosrr r os.pathr r r rrrersysrrhasattrrr__file__pathToCurrentScriptpathToCommonScriptsFolderrr#r&rrrrs&