Viewing File: /usr/lib/python2.7/site-packages/euca2ools/commands/iam/createaccesskey.pyo

ó
¡ôXc@s†ddlZddlmZddlZddlmZmZmZddlm	Z	ddl
ZddlZdefd„ƒYZ
dS(iÿÿÿÿN(tArg(t
IAMRequestt
AS_ACCOUNTtarg_user(tGetUsertCreateAccessKeycBs’eZdZeddƒeddddddddƒed	d
ddddƒedd
ddddddƒegZd„Zd„Z	d„Z
RS(s"Create a new access key for a userthelpsLuser the new key will belong to
                     (default: current user)s-ws--write-configtactiont
store_truetroute_tos—output access keys and region information in the
                form of a euca2ools.ini(5) configuration file instead of
                by themselvess-ds--domains…the DNS domain
                to use for region information in configuration file
                output (default: based on IAM URL)s-ls--set-default-users®set this user as the default user for the region
                in euca2ools.ini(5) configuration file output.  This
                option is only useful when used with -w.c

Cs3|jjdƒr/tjjjj|jjƒ}|jjdƒs¿|j	j
dƒd}td„|j
dƒDƒƒrœdj|jjƒ}t
j|IJq¿|j	j
ddƒd|jd<ntjjjƒ}|jjdƒrLd|jdkr/d|j	kr/|jdcd|j	j
dƒd7<n|jjpE|jd}d	j|j
dƒdƒ}|j|ƒxattjjƒƒD]J}d
jd|jd|jdd|ƒ}	|j|d
j|ƒ|	ƒq‡W|jjdƒdk	r|j|d|jjdƒƒn|jjdƒdk	rL|j|d|jjdƒƒqLn|djdƒpbd}
|jƒ}|rŒdj||
ƒ}
ndj|
ƒ}|j|ƒ|j|d|ddƒ|j|d|ddƒ|rú|j|d|ƒn|jjdƒr"|j|d|
ƒn||d<ndS(Ntwrite_configtdomaint:icss|]}|jƒVqdS(N(tisdigit(t.0tlabel((sJ/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createaccesskey.pys	<genexpr>;st.swarning: IAM URL {0} refers to a specific IP; for a complete configuration file supply the region's DNS domain with -d/--domainis
region {0}s{scheme}://{service}.{domain}/tschemetservices{0}-urls
verify-tlss
verify-sslt	AccessKeytUserNametroots{0}:{1}suser {0}skey-idtAccessKeyIds
secret-keytSecretAccessKeys
account-idtset_default_usertusert
configfile(targstgettsixtmovesturllibtparseturlparseRtendpointtnetloctsplittalltformattsyststderrtconfigparsertSafeConfigParsertconfigtregiontadd_sectiontsortedt	euca2oolstutiltgenerate_service_namesRtsettget_region_optiontNonetget_user_account_id(
tselftresulttparsedtdnsnametmsgRtregion_nametregion_sectionRturlt	user_namet
account_idtuser_section((sJ/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createaccesskey.pytpostprocess6sV#"*

		
cCsG|jjdƒr)|djtjƒn|ddGH|ddGHdS(NR
RRRR(RRtwriteR'tstdout(R6R7((sJ/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createaccesskey.pytprint_resultqs
cCs®tj|d|jdd|jjdƒƒ}y|jƒ}WnNtjjk
rŽ}|jdkrˆdj	|j
ƒ}tj|IJdS‚nX|dd}|jdƒdS(	NRtDelegateAccounti“s,warning: unable to retrieve account ID ({0})tUsertArnRi(Rt
from_othertparamsRtmainR/t
exceptionstAWSErrortstatus_codeR&tmessageR'R(R4R$(R6treqtresponseterrR:tarn((sJ/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createaccesskey.pyR5xs
N(t__name__t
__module__tDESCRIPTIONRRR4RtARGSRARDR5(((sJ/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createaccesskey.pyR%s		;	(R'trequestbuilderRRteuca2ools.commands.iamRRRteuca2ools.commands.iam.getuserRteuca2ools.exceptionsR/teuca2ools.utilR(((sJ/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createaccesskey.pyt<module>s
Back to Directory File Manager