File: //lib/python2.7/site-packages/azurelinuxagent/pa/provision/cloudinitdetect.pyc
�
d�bc @ sC d Z d d l Z d d l j j Z d � Z d � Z d � Z d S( s0 Module for detecting the existence of cloud-initi����Nc C s| yF t j d d d g d t j �j d � j d d � } | d k } Wn/ t k
rw } t j d j | � � t } n X| S(
s�
Determine whether or not cloud-init is enabled on a systemd machine.
Args:
None
Returns:
bool: True if cloud-init is enabled, False if otherwise.
t systemctls
is-enableds cloud-init-local.servicet stderrs utf-8s
t t enableds; Unable to get cloud-init enabled status from systemctl: {0}(
t
subprocesst check_outputt STDOUTt decodet replacet Exceptiont loggert infot formatt False( t systemctl_outputt unit_is_enabledt exc( ( sP /usr/lib/python2.7/site-packages/azurelinuxagent/pa/provision/cloudinitdetect.pyt _cloud_init_is_enabled_systemd s !
c C s_ y) t j d d d g d t j �t } Wn/ t k
rZ } t j d j | � � t } n X| S( s�
Determine whether or not cloud-init is enabled on a non-systemd machine.
Args:
None
Returns:
bool: True if cloud-init is enabled, False if otherwise.
t services
cloud-initt statusR s9 Unable to get cloud-init enabled status from service: {0}( R R R t TrueR R
R R R
( R R ( ( sP /usr/lib/python2.7/site-packages/azurelinuxagent/pa/provision/cloudinitdetect.pyt _cloud_init_is_enabled_service s
c C s, t � p t � } t j d j | � � | S( s�
Determine whether or not cloud-init is enabled.
Args:
None
Returns:
bool: True if cloud-init is enabled, False if otherwise.
s cloud-init is enabled: {0}( R R R
R R ( R ( ( sP /usr/lib/python2.7/site-packages/azurelinuxagent/pa/provision/cloudinitdetect.pyt cloud_init_is_enabled: s ( t __doc__R t azurelinuxagent.common.loggert commonR
R R R ( ( ( sP /usr/lib/python2.7/site-packages/azurelinuxagent/pa/provision/cloudinitdetect.pyt <module> s