Current File : //usr/lib/python2.7/site-packages/cloudinit/sources/helpers/vmware/imc/config_passwd.pyo
�
oB�]c@sQddlZddlZddlmZeje�Zdefd��YZdS(i����N(tutiltPasswordConfiguratorcBs eZdZd�Zd�ZRS(sv
    Class for changing configurations related to passwords in a VM. Includes
    setting and expiring passwords.
    cCstjd�|r%tj|�}ng}xMtdd�D]<}|jd�ddkr;|j|jd�d�q;q;Wg}xFtdd�D]5}|jd�d}||kr�|j|�q�q�W|r�tjd	�|jd
|�n|r|j|�ntjd�dS(
s+
        Main method to perform all functionalities based on configuration file
        inputs.
        @param passwd: encoded admin password.
        @param resetPasswd: boolean to determine if password needs to be reset.
        @return cfg: dict to be used by cloud-init set_passwd code.
        sStarting password configurations/etc/passwdtrt:it0is/etc/shadowsSetting admin passwordtrootsConfigure Password completed!N(	tLOGtinfoRtb64dtopentsplittappendt
set_passwdtreset_password(tselftpasswdtresetPasswdtdistrotallRootUserstlinetuidUsersListtuser((sV/usr/lib/python2.7/site-packages/cloudinit/sources/helpers/vmware/imc/config_passwd.pyt	configures$
!
cCs�tjd�x�|D]z}ytjdd|g�Wqtjk
r�}tjjd�rwtjddd|g�q�tjd||�qXqWd	S(
s�
        Method to reset password. Use passwd --expire command. Use chage if
        not succeeded using passwd command. Log failure message otherwise.
        @param: list of users for which to expire password.
        sExpiring password.Rs--expires/usr/bin/chagetchages-dRs/Failed to expire password for %s with error: %sN(	RRRtsubptProcessExecutionErrortostpathtexiststwarning(RtuidUserListRte((sV/usr/lib/python2.7/site-packages/cloudinit/sources/helpers/vmware/imc/config_passwd.pyR
2s

	(t__name__t
__module__t__doc__RR
(((sV/usr/lib/python2.7/site-packages/cloudinit/sources/helpers/vmware/imc/config_passwd.pyRs	(	tloggingRt	cloudinitRt	getLoggerR RtobjectR(((sV/usr/lib/python2.7/site-packages/cloudinit/sources/helpers/vmware/imc/config_passwd.pyt<module>	s