File: //opt/omi/lib/Scripts/OmsConfigHostHelpers.pyc
�
SRBac @ s� d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d d � Z d � Z d � Z d d � Z d � Z
d S( i����Nt t INFOc
C sj d } t j j | d � } t j j | � s= t j | � n t j j | � r� t | � �H } y t j | � } Wn+ i } d | d <d | d <d | d <n XWd QXn1 t j | � i } d | d <d | d <d | d <d } t
j
j t j � � j
d � } | | t j � | d
| d
t j | � f } | d c | 7<t | d � � } t j | | � Wd QXd S( Ns# /var/opt/microsoft/omsconfig/statust
omsconfighostt operationR t messagei t successs; <OMSCONFIGLOG>[%s] [%d] [%s] [%d] [%s:%d] %s</OMSCONFIGLOG>s %Y/%m/%d %H:%M:%Si s w+( t ost patht joint existst makedirst isfilet opent jsont loadt mknodt datetimet
fromtimestampt timet strftimet getpidt dumpst dump(
R t pathToCurrentScriptt levelt omsagent_telemetry_patht dsc_host_telemetry_patht host_telemetry_filet host_telemetry_jsont msg_templatet timestampt
msg_buffer( ( s8 /opt/microsoft/omsconfig/Scripts/OmsConfigHostHelpers.pyt write_omsconfig_host_telemetry s0
!.c C sJ d } t j j | � rF t | d � � } | j d � } | SWd QXn d S( Ns# /etc/opt/omi/conf/omsconfig/agentidt ri$ s$ 00000000-0000-0000-0000-000000000000( R R R R t read( t agentid_patht agentid_filet agent_id( ( s8 /opt/microsoft/omsconfig/Scripts/OmsConfigHostHelpers.pyt get_agent_id) s
c C s9 | r d } n d } d t � | f } t | | � d S( Ns Using dsc_hosts Falling back to OMIs [%s] %s( R&