Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/module_utils/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyo

�
�Udac@sc	ddlZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
mZyddlm
ZWnek
r�dZnXddlmZddljjjjjZededd	d
ddd
ddg�dedd	�dedd	�dedd	de�dedd	de�dedd	de�dedd	de�dedd	de�dedd	dd�dedd	d
ddg�dedd	dd�d edd	de��Zedd!dd"dd#dd$dd%dd&dd'dd(dd)d d*�
Zii
d+d,6ed-d.d/d.d0d1d2d.d3d.�d46d5d66d7d86d9d:6d;d<6d=d>6d=d?6d@dA6dBdC6d6idDd46dEd66dFd86dGd:6dH6ZedIeddJ�dKeddLde��ZdMdNdOgfgZ dPj!e�Z"dQZ#dRZ$ej%dS�Z&dTZ'dUZ(eZ)eZ*eZ+eZ,eZ-eZ.yddl/Z/Wne0k
r�eZ/nXy ddVl1m2Z2eZ3eZ4Wn)e0k
r�eZ2e5Z3ej6�Z4nXyddWl7m8Z8Wn#e0k
rej6�Z.e5Z-nXyddXl9m:Z:ddYl;m<Z<ddZl=m>Z>dd[l;m?Z?dd\l@mAZAmBZBmCZCdd]lDmEZEdd^lFmGZGmHZHdd_lImJZKdd_lLmJZMdd_lNmJZOdd_lPmJZQdd_lRmJZSdd_lTmJZUdd_lVmJZWdd`lXmYZYddalZm[Z[ddbl\m]Z]ddcl^m_Z_dddl`maZaddelbmcZcddfldmeZeddglfmgZgddhlhmiZiddiljmkZkddjllmmZmddklnmoZoddllpmqZqmrZrddmlsmtZtddnlumvZvddolwmxZxddlyjzj{j|Z}ddpl~mZddql�m�Z�ddrl�m�Z�ddsl�m�Z�ddtl�m�Z�ddul�m�Z�ddl�jzj�j|Z�ddvl�m�Z�ddl�jzj�j|Z�ddwl�m�Z�ddxl�m|Z�ddyl�m�Z�ddzlDm�Z�dd{l�m�Z�dd|l�m�Z�Wn+e0k
rAZ�e�Z�ej6�Z*e5Z)nXdd}l�m�Z�m�Z�dd~l�m�Z�ddl�m�Z�dd�l�m�Z�ydd�lm�Z�m�Z�Wn'e0k
r�dd�l�m�Z�m�Z�nXy:dd�l�m�Z�dd�lFm�Z�m�Z�dd�l�m�Z�Wn#e0k
r+e5Z+eZ,eZ�nXd��Z�d��Z�d��Z�e)r�iid�d�6d�d�6d:6id�d�6d�d�6d46id�d�6d�d�6d,6id�d�6d�d�6d66id�d�6d�d�6d86id�d�6d�d�6d�6id�d�6d�d�6d<6id�d�6d�d�6d�6niZ�d�Z�d�e�fd���YZ�d�e�fd���YZ�d�efd���YZ�d�e�fd���YZ�dS(�i����N(t
expanduser(t
AnsibleModuletmissing_required_lib(t__version__tunknown(tconfigparsertauth_sourcettypetstrtchoicestautotclitenvtcredential_filetmsitprofiletsubscription_idt	client_idtno_logtsecretttenanttad_usertpasswordtcloud_environmenttdefaultt
AzureCloudtcert_validation_modetvalidatetignoretapi_profiletlatesttadfs_authority_urlt
AZURE_PROFILEtAZURE_SUBSCRIPTION_IDtAZURE_CLIENT_IDtAZURE_SECRETtAZURE_TENANTt
AZURE_AD_USERtAZURE_PASSWORDtAZURE_CLOUD_ENVIRONMENTtAZURE_CERT_VALIDATION_MODEtAZURE_ADFS_AUTHORITY_URLs2018-02-01-previewt!ContainerInstanceManagementClienttdefault_api_versions
2018-10-01t
resource_skustdiskss
2018-06-01t	snapshotstvirtual_machine_run_commandstComputeManagementClients
2018-08-01tNetworkManagementClients
2017-05-10tResourceManagementClients
2017-10-01tStorageManagementClients
2018-02-01tWebSiteManagementClients
2017-12-01tPostgreSQLManagementClienttMySQLManagementClients
2019-03-01tMariaDBManagementClients
2016-09-01tManagementLockClients
2016-03-30s
2015-06-15s
2016-02-01s
2016-01-01s2017-03-09-profilettagstdicttappend_tagstbooltlog_modetfiletlog_pathsAnsible/{0}tAZURE_HTTP_USER_AGENTtVSCODEEXT_USER_AGENTs�(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/([0-9]|[1-2][0-9]|3[0-2]))t	SucceededtFailed(tVersion(t
Serializer(tEnum(tAADTokenCredentials(t
CloudError(tMSIAuthentication(tparse_resource_idtresource_idtis_valid_resource_id(tazure_cloud(tServicePrincipalCredentialstUserPassCredentials(tVERSION(R1(R2(tSubscriptionClient(R3(R0(tDnsManagementClient(tMonitorManagementClient(R4(tContainerServiceClient(tMarketplaceOrderingAgreements(tTrafficManagerManagementClient(tCloudStorageAccount(tPageBlobServicetBlockBlobService(tAuthenticationContext(tSqlManagementClient(tServiceBusManagementClient(R5(R6(R7(t!ContainerRegistryManagementClient(R*(tLogAnalyticsManagementClient(tAutomationClient(tIotHubClient(tmodels(t
ServiceClient(tAzureConfiguration(tAuthentication(R8(t	b64encodet	b64decode(tsha256(tHMAC(ttime(t	urlencodet
quote_plus(tCLIError(tget_azure_cli_credentialstget_cli_profile(tget_cli_active_cloudcCsktjdd|�jd�}i}d}x:|t|�dkrf||d|||<|d7}q-W|S(Ns^\/tt/ii(tretsubtsplittlen(tidtpiecestresulttindex((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytazure_id_to_dict�scCs5t|�s1td|d|d|d|d|�S|S(Ntnametresource_groupt	namespaceRtsubscription(RLRK(tvalRR}ttypesR|((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytformat_resource_id�scCs|jdd�j�S(Nt Rp(treplacetlower(R{((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytnormalize_location_name�ststoragetpackage_names3.1.0texpected_versiontcomputes4.4.0tcontainerinstances0.4.0tnetworks2.3.0tresources2.1.0tdnsRRtwebs0.41.0ttrafficmanagers0.50.0RVs2.0.0tAzureRMModuleBasec
BsheZeedBdBdBdBeedBeeed�Zd�Zd�Zd�ZdBd�Z	ed�Z
d�Zd�Zd�Z
d	�Zd
�ZdBd�Zdd
�Zdd�Zdd�ZddBd�Zd�Zed��Zd�ZdBdBd�Zd�Zd�Zd�Zed��Zed��Zed��Z ed��Z!ed��Z"ed ��Z#ed!��Z$ed"��Z%ed#��Z&ed$��Z'ed%��Z(ed&��Z)ed'��Z*ed(��Z+ed)��Z,ed*��Z-ed+��Z.ed,��Z/ed-��Z0ed.��Z1ed/��Z2ed0��Z/ed1��Z3ed2��Z4ed3��Z5ed4��Z6ed5��Z7ed6��Z8ed7��Z9ed8��Z:ed9��Z;ed:��Z<ed;��Z=ed<��Z>ed=��Z?ed>��Z<ed?��Z=ed@��Z@edA��ZARS(CcCs�t�}|jt�|r,|jt�n|rB|j|�ntt�}|
ra||
7}ntd|d|d|d|d|d|d|d|d	|	d
|�
|_ts�|j	dt
d�d
t�nts�|j	dt
d�d
t
�nts!|j	dt
djt��d
t�nd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%d|_&d|_'d|_(d|_)|jj*|_*|jj+j,d�|_-||_.t/d|j	|jj+�|_0|jj+j,d�rm|j1|jj+d�n|
s�|j2|jj+�}|jj3|�ndS(Nt
argument_spect
bypass_checksRtcheck_invalid_argumentstmutually_exclusivetrequired_togethertrequired_one_oftadd_file_common_argstsupports_check_modetrequired_iftmsgt	packagingt	exceptiontmsrestazuresansible[azure] (azure >= {0})Rt	fail_implR9(4R:tupdatetAZURE_COMMON_ARGStAZURE_TAG_ARGStlisttAZURE_COMMON_REQUIRED_IFRtmoduletHAS_PACKAGING_VERSIONtfailRtHAS_PACKAGING_VERSION_EXCtHAS_MSRESTAZUREtHAS_MSRESTAZURE_EXCt	HAS_AZUREtformattAZURE_MIN_RELEASEt
HAS_AZURE_EXCtNonet_network_clientt_storage_clientt_resource_clientt_compute_clientt_dns_clientt_web_clientt_marketplace_clientt_sql_clientt
_mysql_clientt_mariadb_clientt_postgresql_clientt_containerregistry_clientt_containerinstance_clientt_containerservice_clientt_managedcluster_clientt"_traffic_manager_management_clientt_monitor_clientt	_resourcet_log_analytics_clientt_servicebus_clientt_automation_clientt_IoThub_clientt_lock_clientt
check_modetparamstgetRtfacts_moduletAzureRMAutht
azure_autht
validate_tagstexec_modulet	exit_json(tselftderived_arg_specR�RR�R�R�R�R�R�R�t
supports_tagsR�t	skip_exectmerged_arg_spectmerged_required_iftres((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt__init__sx	




																								cCs�tj|jd�}|dk	r�|jd�}ytj|j�}|j}Wntk
rcdSX|jd�}t	|�t	|�kr�|j
dj|||��nt	|�t	|�kr�|jj
dj|||��q�ndS(NR�R�svInstalled azure-mgmt-{0} client version is {1}. The minimum supported version is {2}. Try `pip install ansible[azure]`smInstalled azure-mgmt-{0} client version is {1}. The expected version is {2}. Try `pip install ansible[azure]`(tAZURE_PKG_VERSIONSR�t__name__R�t	importlibt
import_modulet
__module__RPtRuntimeErrorRDR�R�R�twarn(R�tclient_typetpackage_versiontclient_namet
client_moduletclient_versionR�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytcheck_client_version_s

cKs |jdj|jj��dS(Ns2Error: {0} failed to implement exec_module method.(R�R�t	__class__R�(R�tkwargs((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�rscKs|jjd||�dS(s�
        Shortcut for calling module.fail()

        :param msg: Error message text.
        :param kwargs: Any key=value pairs
        :return: None
        R�N(R�t	fail_json(R�R�R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�uscCs|jj||�dS(N(R�t	deprecate(R�R�tversion((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�scCsB|r.|jjtj|dddt��n|jj|�dS(Ntindentit	sort_keys(R�tdebugtjsontdumpstTrue(R�R�tpretty_print((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytlog�s(cCs�|jst|t�s(|jd�nxT|j�D]C\}}t|t�s5|jdjt|�t|���q5q5WndS(s�
        Check if tags dictionary contains string:string pairs.

        :param tags: dictionary of string:string pairs
        :return: None
        s2Tags must be a dictionary of string:string values.s*Tags values must be strings. Found {0}:{1}N(R�t
isinstanceR:R�titemsRR�(R�R9tkeytvalue((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR��s	cCsS|pt�}t|t�r-tj|�nt�}t|jjjd�t�ri|jjjd�nt�}|jjjd�dk	r�|jjjd�nt}t}xM|j	�D]?\}}|j|�s�|||kr�t}|||<q�q�W|sIxB|j	�D]1\}}|j|�s|j
|�t}qqWn||fS(s
        Call from the module to update metadata tags. Returns tuple
        with bool indicating if there was a change and dict of new
        tags to assign to the object.

        :param tags: metadata tags from the object
        :return: bool, dict
        R9R;N(R:R�tcopyR�R�R�R�R�tFalseR�tpop(R�R9tnew_tagst
param_tagsR;tchangedR�R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytupdate_tags�s	'<6 
cCs�|r|rtS|stSd}t}x�|D]�}|}d}d|krd|jd�\}}n|r�|j|�|kr�|d7}q.|r.|j|�r.|d7}q.q.W|t|�kr�t}n|S(s7
        Used in fact modules to compare object tags to list of parameter tags. Return true if list of parameter tags
        exists in object tags.

        :param obj_tags: dictionary of tags from an Azure object.
        :param tag_list: list of tag keys or tag key:value pairs
        :return: bool
        it:iN(R�R�R�RtR�Ru(R�tobj_tagsttag_listtmatchesRxttagttag_keyt	tag_value((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pythas_tags�s$



	cCs~y|jjj|�SWn`tk
rH}|jdj||j��n2tk
ry}|jdj|t|���nXdS(s�
        Fetch a resource group.

        :param resource_group: name of a resource group
        :return: resource group object
        s)Error retrieving resource group {0} - {1}N(	t	rm_clienttresource_groupsR�RHR�R�tmessaget	ExceptionR(R�R|tcloud_errortexc((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytget_resource_group�scCsWt|t�st|�n|}|jd|j�|d<|jd|j�|d<|S(s�
        Return a dict of the give resource, which contains name and resource group.

        :param resource: It can be a resource name, id or a dict contains name and resource group.
        R|R(R�R:RJR�R|R(R�R�t
resource_dict((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytparse_resource_to_dict�s!c
Cs�|dkrgn|}t�}|r�xP|D]H}tj|�}x0tj|dtj�D]\}}|||<q\Wq.W|jd�|jt|��nt	d|�}	|	j
||dt�S(s
        Return a JSON representation of an Azure object.

        :param obj: Azure object
        :param class_name: Name of the object's class
        :param enum_modules: List of module names to build enum dependencies from.
        :return: serialized result
        t	predicatesdependencies: tclassest
keep_readonlyN(R�R:R�R�tinspectt
getmemberstisclassR�RREtbodyR�(
R�tobjt
class_nametenum_modulestdependenciestmodule_nametmodtmod_class_namet
mod_class_objt
serializer((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt
serialize_obj�s		
%
icCs}yM|}x6|j�sA|jdj|��|jd|�qW|j�SWn)tk
rx}|jt|���nXdS(s�
        Consistent method of waiting on and retrieving results from Azure's long poller

        :param poller Azure poller object
        :return object resulting from the original request
        sWaiting for {0} secttimeoutN(tdoneR�R�twaitRxRR(R�tpollerR tdelayR	((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytget_poller_result�stpresentcCs�t|d�r�t|jd�r�t|d�r�t|jjt�r�|jjjtkr�|dkr�|jdj|j	|jjt��ndS|jjtkr�|dkr�|jdj|j	|jjt��ndSt|d�s�t|d�r�t|jt�rT|jjtkrP|dkrP|jdj|j	|jt��ndS|jtkr�|dkr�|jdj|j	|jt��q�ndS(sL
        Check an Azure object's provisioning state. If something did not complete the provisioning
        process, then we cannot operate on it.

        :param azure_object An object such as a subnet, storageaccount, etc. Must have provisioning_state
                            and name attributes.
        :return None
        t
propertiestprovisioning_stateR{tabsentsEError {0} has a provisioning state of {1}. Expecting state to be {2}.N(
thasattrR%R�R&RFR�tAZURE_SUCCESS_STATER�R�R{(R�tazure_objecttrequested_state((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytcheck_provisioning_states,
!tblockcCs-t�}y)|jd�|jjj||�}Wn2tk
rf}|jdj|t|���nXy�|jd�|dkr�t	d|j
jjd|d|j
dj�S|d	kr�td|j
jjd|d|j
dj�Std
��Wn2tk
r(}|jdj|t|���nXdS(NsGetting keyss(Error getting keys for account {0} - {1}sCreate blob servicetpagetendpoint_suffixtaccount_nametaccount_keyiR-s"Invalid storage blob type defined.s@Error creating blob service client for storage account {0} - {1}(R:R�tstorage_clienttstorage_accountst	list_keysRR�R�RRXt_cloud_environmenttsuffixeststorage_endpointtkeysR�RY(R�tresource_group_nametstorage_account_nametstorage_blob_typeR8taccount_keysR	((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytget_blob_client3s(	
#
tDynamicc
Cs'd	}|jdj|��|jdj|��y|jjj||�}Wntk
ranX|r�|jdj|��|j|�|S|jj	d|d|d|�}|jdj|��y|jjj
|||�}Wn2tk
r}	|jdj|t
|	���nX|j|�S(
s�
        Create a default public IP address <public_ip_name> to associate with a network interface.
        If a PIP address matching <public_ip_name> exists, return it. Otherwise, create one.

        :param resource_group: name of an existing resource group
        :param location: a valid azure location
        :param public_ip_name: base name to assign the public IP address
        :param allocation_method: one of 'Static' or 'Dynamic'
        :param sku: sku
        :return: PIP object
        sStarting create_default_pip {0}s$Check to see if public IP {0} existssPublic ip {0} found.tlocationtpublic_ip_allocation_methodtskusCreating default public IP {0}sError creating {0} - {1}N(R�R�R�tnetwork_clienttpublic_ip_addressesR�RHR,tnetwork_modelstPublicIPAddresstcreate_or_updateRR�RR#(
R�R|R?tpublic_ip_nametallocation_methodRAtpipR�R!R	((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytcreate_default_pipLs*

	#c
Cs�d"}|jdj|��|jdj|��y|jjj||�}Wntk
ranX|r�|jdj|��|j|�|S|jj	�}||_
|s�|dkr|jjddddd	dd
ddd
dddddddddd�
g|_||_
q@|jjddddd	dd
ddd
dddddddddd�
|jjddddd	dd
ddd
dddddddddd�
g|_n�g|_d}x||D]t}	|d7}dj|�}
|jj
|jjddddd	dd
ddd
dddt|	�d|d|
�	�q�W|jd j|��y|jjj|||�}Wn2tk
r�}|jd!j|t|���nX|j|�S(#s�
        Create a default security group <security_group_name> to associate with a network interface. If a security group matching
        <security_group_name> exists, return it. Otherwise, create one.

        :param resource_group: Resource group name
        :param location: azure location name
        :param security_group_name: base name to use for the security group
        :param os_type: one of 'Windows' or 'Linux'. Determins any default rules added to the security group.
        :param ssh_port: for os_type 'Linux' port used in rule allowing SSH access.
        :param rdp_port: for os_type 'Windows' port used in rule allowing RDP access.
        :return: security_group object
        sCreate security group {0}s)Check to see if security group {0} existssSecurity group {0} found.tLinuxtprotocoltTcptsource_address_prefixt*tdestination_address_prefixtaccesstAllowt	directiontInboundtdescriptionsAllow SSH Accesstsource_port_rangetdestination_port_ranget22tpriorityidR{tSSHsAllow RDP port 3389t3389tRDP01sAllow WinRM HTTPS port 5986t5986ietWinRM01isRule_{0}s#Creating default security group {0}s.Error creating default security rule {0} - {1}N(R�R�R�RBtnetwork_security_groupsR�RHR,RDtNetworkSecurityGroupR?tSecurityRuletsecurity_rulestappendRRFRR�R#(
R�R|R?tsecurity_group_nametos_typet
open_portstgroupt
parametersRYtportt	rule_nameR!R	((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytcreate_default_securitygroupss�


		

	
#cKs
t|_dS(N(R�tverify(tsessiont
global_configtlocal_configR�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt_validation_ignore_callback�scCs�tj|�}|s-tdj|���n|j|d�}|sd|jjdj||��nt|t�r�|jd�s�tdj|���n|Std|�S(Nsunknown Azure API profile: {0}s6Azure API profile {0} does not define an entry for {1}R+s;Azure API profile {0} does not define 'default_api_version'(	tAZURE_API_PROFILESR�tKeyErrorR�R�R�R�R�R:(R�tclient_type_nametapi_profile_nametprofile_all_clientstprofile_raw((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytget_api_profile�sc
Cs�|jdj|j��|j|�tj|j�}|sS|jjj	j
}ntd|jjd|jj
d|�}i}|jr�|j|j|j�}n|r�d|jkr�||d<nd|jkr%|jdd�}|s�|r%|p�||d<d|kr"|jd�q"q%n||�}yt|d�WnNtk
r�d	�}	t|d
tj|j�j�tj|	|�|_nX|j|j�|_|jjdkr�|j |j_!n|S(Ns%Getting management service client {0}tcredentialsRtbase_urlRtapi_versionR+Rac_s|jS(N(t_ansible_models(R�targtkwarg((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt_ansible_get_modelssR{R("R�R�R�R�Rt
getargspecR�R�R5t	endpointstresource_managerR:tazure_credentialsRRRwtargsR�R�R�tgetattrtAttributeErrortsetattrR�R�R�RaR�t
MethodTypetadd_user_agenttconfigt_cert_validation_modeRptsession_configuration_callback(
R�R�RyRztclient_argspect
client_kwargstapi_profile_dicttprofile_default_versiontclientR~((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytget_mgmt_svc_client�s8
'	

	cCs]|jt�ttjkr3|jtjt�nttjkrY|jtjt�n|S(N(R�tANSIBLE_USER_AGENTtCLOUDSHELL_USER_AGENT_KEYtostenvirontVSCODEEXT_USER_AGENT_KEY(R�R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�!s
cKs�|jdd�}|jdt�d�}|jdd�}|jdd�}t|�}t|�}dj||�}ttt|�|j	d�t
�j��}	i|d6|	d	6t|�d
6}
|r�||
d<ndt
|
�S(
NRytexpiryiR�tpolicys{0}
{1}sutf-8tsrtsigtsetsknsSharedAccessSignature (R�R�RiRktintR�ReRhRftencodeRgtdigestRRj(R�tkwagsRyR�R�R�turltttltsign_keyt	signatureRx((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytgenerate_sas_token,s-
cKsj|jdd�}tddj|��}td|j|��|_|j|�}td|jd|�S(NRyshttps://{0}ttokentcredsR�(	R�R�RcR�tAzureSASAuthenticationR�RxR�Rb(R�R�R�R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytget_data_svc_client>s
cCs
|jjS(N(R�Rx(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyRxFscCs
|jjS(N(R�R5(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR5JscCs
|jjS(N(R�R(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyRNscCsG|jd�|js@|jtd|jjjdd�|_n|jS(NsGetting storage client...RyRzs
2018-07-01(R�R�R�R3R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR2Rs
	cCs
tjd�S(Ns
2018-07-01(R3Ra(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytstorage_models[scCsG|jd�|js@|jtd|jjjdd�|_n|jS(NsGetting network clientRyRzs
2018-08-01(R�R�R�R1R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyRB_s
	cCs|jd�tjd�S(NsGetting network models...s
2018-08-01(R�R1Ra(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyRDhs
cCsG|jd�|js@|jtd|jjjdd�|_n|jS(NsGetting resource manager clientRyRzs
2017-05-10(R�R�R�R2R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyRms
	cCs|jd�tjd�S(NsGetting resource manager modelss
2017-05-10(R�R2Ra(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt	rm_modelsvs
cCsG|jd�|js@|jtd|jjjdd�|_n|jS(NsGetting compute clientRyRzs
2018-06-01(R�R�R�R0R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytcompute_client{s
	cCs|jd�tjd�S(NsGetting compute modelss
2018-06-01(R�R0Ra(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytcompute_models�s
cCsG|jd�|js@|jtd|jjjdd�|_n|jS(NsGetting dns clientRyRzs
2018-05-01(R�R�R�RRR5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt
dns_client�s
	cCs|jd�tjd�S(NsGetting dns models...s
2018-05-01(R�RRRa(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt
dns_models�s
cCsG|jd�|js@|jtd|jjjdd�|_n|jS(NsGetting web clientRyRzs
2018-02-01(R�R�R�R4R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt
web_client�s
	cCsG|jd�|js@|jtd|jjjdd�|_n|jS(Ns Getting container service clientRyRzs
2017-07-01(R�R�R�RTR5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytcontainerservice_client�s
	cCs|jd�tjd�S(Ns Getting container service modelss
2018-03-31(R�RTRa(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytmanagedcluster_models�s
cCsG|jd�|js@|jtd|jjjdd�|_n|jS(Ns Getting container service clientRyRzs
2018-03-31(R�R�R�RTR5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytmanagedcluster_client�s
	cCsA|jd�|js:|jtd|jjj�|_n|jS(NsGetting SQL clientRy(R�R�R�R[R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt
sql_client�s

	cCsA|jd�|js:|jtd|jjj�|_n|jS(NsGetting PostgreSQL clientRy(R�R�R�R5R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytpostgresql_client�s

	cCsA|jd�|js:|jtd|jjj�|_n|jS(NsGetting MySQL clientRy(R�R�R�R6R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytmysql_client�s

	cCsA|jd�|js:|jtd|jjj�|_n|jS(NsGetting MariaDB clientRy(R�R�R�R7R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytmariadb_client�s

	cCsA|jd�|js:|jtd|jjj�|_n|jS(NsGetting SQL clientRy(R�R�R�R[R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR��s

	cCsG|jd�|js@|jtd|jjjdd�|_n|jS(Ns&Getting container registry mgmt clientRyRzs
2017-10-01(R�R�R�R]R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytcontainerregistry_client�s
	cCsG|jd�|js@|jtd|jjjdd�|_n|jS(Ns&Getting container instance mgmt clientRyRzs
2018-06-01(R�R�R�R*R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytcontainerinstance_client�s
	cCsA|jd�|js:|jtd|jjj�|_n|jS(Ns$Getting marketplace agreement clientRy(R�R�R�RUR5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytmarketplace_client�s

	cCsA|jd�|js:|jtd|jjj�|_n|jS(NsGetting traffic manager clientRy(R�R�R�RVR5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt!traffic_manager_management_client�s

	cCsA|jd�|js:|jtd|jjj�|_n|jS(NsGetting monitor clientRy(R�R�R�RSR5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytmonitor_clients

	cCsA|jd�|js:|jtd|jjj�|_n|jS(NsGetting log analytics clientRy(R�R�R�R^R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytlog_analytics_clients

	cCs|jd�tS(NsGetting log analytics models(R�tLogAnalyticsModels(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytlog_analytics_modelss
cCsA|jd�|js:|jtd|jjj�|_n|jS(NsGetting servicebus clientRy(R�R�R�R\R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytservicebus_clients

	cCstS(N(tServicebusModel(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytservicebus_models scCsA|jd�|js:|jtd|jjj�|_n|jS(NsGetting automation clientRy(R�R�R�R_R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytautomation_client$s

	cCstS(N(tAutomationModel(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytautomation_models,scCsA|jd�|js:|jtd|jjj�|_n|jS(NsGetting iothub clientRy(R�R�R�R`R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt
IoThub_client0s

	cCstS(N(tIoTHubModels(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt
IoThub_models8scCsA|jd�|js:|jtd|jjj�|_n|jS(NsGetting automation clientRy(R�R�R�R_R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�<s

	cCstS(N(R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�DscCsG|jd�|js@|jtd|jjjdd�|_n|jS(NsGetting lock clientRyRzs
2016-09-01(R�R�R�R8R5R�R�(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytlock_clientHs
	cCs|jd�tjd�S(NsGetting lock modelss
2016-09-01(R�R8Ra(R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pytlock_modelsQs
N(BR�R�R�R�R�R�R�R�R�R�R�R�R�RR
RRR#R,R=RJRktstaticmethodRpRwR�R�R�R�tpropertyRxR5RR2R�RBRDRR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�s�		M			
					#'	d	3											

	R�cBs eZdZd�Zd�ZRS(s�Simple SAS Authentication.
    An implementation of Authentication in
    https://github.com/Azure/msrest-for-python/blob/0732bc90bdb290e5f58c675ffdd7dbfa9acefc93/msrest/authentication.py

    :param str token: SAS token
    cCs
||_dS(N(R�(R�R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�^scCs)tt|�j�}|j|jd<|S(Nt
Authorization(tsuperR�tsigned_sessionR�theaders(R�Rm((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�as(R�R�t__doc__R�R�(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�Ws	tAzureRMAuthExceptioncBseZRS((R�R�(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�gsR�cBs�eZdddddddddddddd�
Zdd�Zdd�Zdd�Zdd	�Zd
�Zd�Z	d�Z
d
�Zed�Z
RS(R
RRRcKsu|
r|
|_n|j|_d|_d|_|jtd|d|d|d|d|d|d|d|d	|	d
|
d|d|��|_|js�tr�|j	d
�q�|j	d�n|
p�|jj
d
�p�tjj
d�p�d|_
|j
dkr|j	dj|j
��n|jj
d	�}|jj
d�dk	r\|dk	r\||_n[|sqtj|_nFgtjt�D]&}t|dtj�r�|d^q�}g|D]}|j|kr�|^q�}t|�dkr�|d|_n�t|�dkr"|j	dj|��n�tj|�jsc|j	djg|D]}|j^qG��nytj|�|_Wn;tk
r�}|j	dj||j�dtj��nX|jj
dd�dkr�|jj
d�dkr�|j	d�n|jd�|jd|_|jj
d�dkrD|jj j!|_n|jj
d�|_|jj j"|_#|jj
d�dk	r�|jd|_$n�|jj
d�dk	r,|jj
d�dk	r,|jj
d�dk	r,t%d|jdd|jdd|jdd	|jd|j
dk�|_$nE|jj
d�dk	r�|jj
d�dk	r�|jj
d�dk	r�|jj
d�dk	r�|j&|j|j#|jd|jd|jd|jd�|_$n�|jj
d�dk	rd|jj
d�dk	rd|jj
d�}|s#d}nt'|jd|jdd|d	|jd|j
dk�|_$n
|j	d�dS( NRRRRRRRRRRRRs�Failed to get credentials. Either pass as parameters, set environment variables, define a profile in ~/.azure/credentials, or log in with Azure CLI (`az login`).s�Failed to get credentials. Either pass as parameters, set environment variables, define a profile in ~/.azure/credentials, or install Azure CLI and log in (`az login`).R(RRs!invalid cert_validation_mode: {0}RxiisOAzure SDK failure: more than one cloud matched for cloud_environment name '{0}'sAcloud_environment must be an endpoint discovery URL or one of {0}s0cloud_environment {0} could not be resolved: {1}R�s4Credentials did not include a subscription_id value.ssetting subscription_idRltcommons Failed to authenticate with provided credentials. Some attributes were missing. Credentials must include client_id, secret and tenant or ad_user and password, or ad_user, password, client_id, tenant and adfs_authority_url(optional) for ADFS authentication, or be logged in using AzureCLI.(Rsignore((t
_fail_implt_default_fail_implR�R5t_adfs_authority_urlt_get_credentialsR:RxtHAS_AZURE_CLI_CORER�R�R�R�R�R�RMtAZURE_PUBLIC_CLOUDRRR�tCloudR{Ruturlparsetschemet get_cloud_from_metadata_endpointRRt	tracebackt
format_excR�RR�tactive_directorytactive_directory_resource_idR�R�RNt$acquire_token_with_username_passwordRO(R�RRRRRRRRRRRRR�R�t
raw_cloud_envtxt
all_cloudstmatched_cloudste((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�ls�		$	$<(/,3


	


0	

	cKs|j|�dS(N(R�(R�R�R�R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR��scKst|��dS(N(R�(R�R�R�R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR��sRcCs�td�}ytj�}|j|�Wn2tk
r]}|jdj|t|���nXt�}xBt	D]:}y |j
||dt�||<Wqntk
r�qnXqnW|j
d�r�|SdS(Ns~/.azure/credentialssNFailed to access {0}. Check that the file exists and you have read access. {1}trawR(
RRtConfigParsertreadRR�R�RR:tAZURE_CREDENTIAL_ENV_MAPPINGR�R�R�(R�RtpathR�R	RxR�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt_get_profile�s 	
 
c	Ks�|jdd�}td|�}|p=tjjtdd�}|s�y4t|�}t|jj	��}t
|j�}Wq�tk
r�}|j
djt
|���q�Xni|d6|d6S(NRRspFailed to get MSI token: {0}. Please check whether your machine enabled MSI or grant access to any subscription.Rx(R�R�RIR�R�R�RQtnextt
subscriptionsR�RRRR�R�(	R�tsubscription_id_paramR�RRxRtsubscription_clientR~R	((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt_get_msi_credentials�scCs7t�\}}t�}i|d6|d6|d6}|S(NRxRR(RmRo(R�RxRRtcli_credentials((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt_get_azure_cli_credentialss	
cCs}t�}x3tj�D]%\}}tjj|d�||<qW|dr`|j|d�}|S|jd�dk	ry|SdS(NRR(R:R�R�R�R�R�R�R�(R�tenv_credentialst	attributetenv_variableRx((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt_get_env_credentialss	
c
Cs�|jd�t�}x0tj�D]"\}}|j|d�||<q#W|jdd�}|sytjjdd�}n|dkr�|jd�|j|dd|jdd��S|d	kr<t	s�|j
d
tddd
�dt�ny!|jd�|j
�}|SWq<tk
r8}|j
dj|��q<Xn|dkre|jd�|j�}|S|dkr�|jd�|jd�p�d}	|j|	�}
|
S|ddk	r�|jd�|j|d�}|S|dr�|jd�|S|j�}|r|jd�|S|j�}
|
r;|jd�|
Sy*t	rT|jd�n|j
�}|SWn)tk
r�}|jdj|��nXdS(NsGetting credentialsRtANSIBLE_AZURE_AUTH_SOURCER
RsRetrieving credenitals from MSIRRRR�s	azure-clitreasonsfor `cli` auth_sourceR�s-Retrieving credentials from Azure CLI profiles(Azure CLI profile cannot be loaded - {0}Rs'Retrieving credentials from environmentR
s+Retrieving credentials from credential fileRRs.Retrieving credentials with profile parameter.s%Received credentials from parameters.sReceived credentials from env.s@Retrieved default profile credentials from ~/.azure/credentials.s,Retrieving credentials from AzureCLI profiles0Error getting AzureCLI profile credentials - {0}(R�R:R�R�R�R�R�R�R�R�R�RtHAS_AZURE_CLI_CORE_EXCR�RlR�R�R�(
R�R�targ_credentialsR�R�RR�terrR�Rtdefault_credentialsRxtce((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�"sh
	
#








c
CsQ|}|dk	r#|d|}nt|�}|j||||�}	t|	�S(NRq(R�RZR�RG(
R�t	authorityR�tusernameRRRt
authority_uritcontextttoken_response((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�iscCsdS(N((R�R�R�((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�tsN(R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyR�ksn			G	(�R�RrR�R�RR�R�tos.pathRtansible.module_utils.basicRRt$ansible.module_utils.ansible_releaseRtANSIBLE_VERSIONRtansible.module_utils.six.movesRt+ansible.module_utils.six.moves.urllib.parsetmodule_utilstsixtmovesturllibtparseR�R:R�R�R�R�RqR�R�R�R�R�R�tcompiletCIDR_PATTERNR)tAZURE_FAILED_STATER�R�R�R�R�R�R�tImportErrortpackaging.versionRDR�R�R�R�tmsrest.serializationREtenumRFt"msrestazure.azure_active_directoryRGtmsrestazure.azure_exceptionsRHRItmsrestazure.toolsRJRKRLR�RMtazure.common.credentialsRNROtazure.mgmt.monitor.versionRPtmonitor_client_versiontazure.mgmt.network.versiontnetwork_client_versiontazure.mgmt.storage.versiontstorage_client_versiontazure.mgmt.compute.versiontcompute_client_versiontazure.mgmt.resource.versiontresource_client_versiontazure.mgmt.dns.versiontdns_client_versiontazure.mgmt.web.versiontweb_client_versiontazure.mgmt.networkR1tazure.mgmt.resource.resourcesR2t!azure.mgmt.resource.subscriptionsRQtazure.mgmt.storageR3tazure.mgmt.computeR0tazure.mgmt.dnsRRtazure.mgmt.monitorRStazure.mgmt.webR4tazure.mgmt.containerserviceRTtazure.mgmt.marketplaceorderingRUtazure.mgmt.trafficmanagerRVt!azure.storage.cloudstorageaccountRWtazure.storage.blobRXRYtadal.authentication_contextRZtazure.mgmt.sqlR[tazure.mgmt.servicebusR\tazure.mgmt.servicebus.modelstmgmtt
servicebusRaR�tazure.mgmt.rdbms.postgresqlR5tazure.mgmt.rdbms.mysqlR6tazure.mgmt.rdbms.mariadbR7tazure.mgmt.containerregistryR]tazure.mgmt.containerinstanceR*tazure.mgmt.loganalyticsR^tazure.mgmt.loganalytics.modelstloganalyticsR�tazure.mgmt.automationR_tazure.mgmt.automation.modelst
automationR�tazure.mgmt.iothubR`R�tmsrest.service_clientRbRctmsrest.authenticationRdtazure.mgmt.resource.locksR8R	tobjecttbase64ReRfthashlibRgthmacRhRiRjRkturllib.parsetazure.cli.core.utilRlRmRntazure.common.cloudRoRzR�R�R�R�R�R�R�R�(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/azure_rm_common.pyt<module>s\

	










	
		'����L

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]