Viewing File: /usr/lib/python2.7/site-packages/euca2ools/commands/iam/deleteuser.pyc

ó
¡ôXc@sddlZddlmZddlmZmZmZddlmZddl	m
Z
ddlmZddl
mZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZdefd„ƒYZdS(iÿÿÿÿN(tArg(t
IAMRequestt
AS_ACCOUNTtarg_user(tDeleteAccessKey(tDeleteLoginProfile(tDeleteSigningCertificate(tDeleteUserPolicy(tGetLoginProfile(tListAccessKeys(tListGroupsForUser(tListSigningCertificates(tListUserPolicies(tRemoveUserFromGroup(tAWSErrort
DeleteUserc
Bs˜eZdZeddƒeddddddddƒed	d
dddd
dddejƒeddddddddƒegZ	d„Z
d„ZRS(s
Delete a userthelps%name of the user to delete (required)s-rs--recursivetactiont
store_truetroute_tosOremove all IAM resources associated with the user
                        firsts-Rs--recursive-eucatdesttIsRecursivetstore_consttconstttrues-ps	--pretendsolist the resources that would be deleted instead of
                        actually deleting them. Implies -r.cCsr|jds|jdrtj|d|jdd|jdƒ}|jƒjdgƒ}tj|d|jdd|jdƒ}|jƒjdgƒ}tj|d|jdd|jdƒ}|jƒjdgƒ}tj|d|jdd|jdƒ}|jƒjdgƒ}t	j|d|jdd|jdƒ}y|jƒt
}Wq­tk
r‹}|jd	kr…t
}qŒ‚q­Xng}g}g}g}t
}|jdrái|d
6|d6|d6|d
6|d6S|jdrdxK|D]C}tj|d|jdd|dd|jdƒ}|jƒqõWxG|D]?}	tj|d|jdd|	d|jdƒ}|jƒqCWxK|D]C}
tj|d|jdd|
dd|jdƒ}|jƒqWxN|D]F}tj|d|jdgd|dd|jdƒ}|jƒqÛW|rdtj|d|jdd|jdƒ}|jƒqdn|jƒSdS(Nt	recursivetpretendtUserNametDelegateAccounttAccessKeyMetadatatPolicyNamestCertificatestGroupstNoSuchEntitytkeystpoliciestcertificatestgroupsthas_login_profiletAccessKeyIdt
PolicyNamet
CertificateIdt
user_namest	GroupName(targsR	t
from_othertparamstmaintgetRRR
RtTrueRtcodetFalseRRRR
Rtsend(tselftreqR"R#tcertsR%R&terrtkeytpolicytcerttgroup((sE/usr/lib/python2.7/site-packages/euca2ools/commands/iam/deleteuser.pyR/;s†

	









cCs¬|jdr¨dGHx|dD]}d|dGHqWdGHx|dD]}d|GHqDWdGHx|dD]}d|dGHqgWd	GHx"|d	D]}d|d
GHqŽWndS(NRt
accesskeysR"s	R'R#R$R)R%tArn(R,(R5tresultR9R:R;R<((sE/usr/lib/python2.7/site-packages/euca2ools/commands/iam/deleteuser.pytprint_resultˆs

N(t__name__t
__module__tDESCRIPTIONRRtNonetargparsetSUPPRESSRtARGSR/R@(((sE/usr/lib/python2.7/site-packages/euca2ools/commands/iam/deleteuser.pyR.s		M(REtrequestbuilderRteuca2ools.commands.iamRRRt&euca2ools.commands.iam.deleteaccesskeyRt)euca2ools.commands.iam.deleteloginprofileRt/euca2ools.commands.iam.deletesigningcertificateRt'euca2ools.commands.iam.deleteuserpolicyRt&euca2ools.commands.iam.getloginprofileRt%euca2ools.commands.iam.listaccesskeysR	t(euca2ools.commands.iam.listgroupsforuserR
t.euca2ools.commands.iam.listsigningcertificatesRt'euca2ools.commands.iam.listuserpoliciesRt*euca2ools.commands.iam.removeuserfromgroupR
teuca2ools.exceptionsRR(((sE/usr/lib/python2.7/site-packages/euca2ools/commands/iam/deleteuser.pyt<module>s
Back to Directory File Manager