�
�Udac @ s� d d l m Z yR d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z e Z Wn e
k
r{ e Z n Xd e f d � � YZ
d � Z d � Z d � Z d � Z d � Z d
� Z d � Z d � Z d
� Z d S( i����( t env_fallbackNt AnsibleACSErrorc B s e Z RS( ( t __name__t
__module__( ( ( sE /usr/lib/python2.7/site-packages/ansible/module_utils/alicloud_ecs.pyR + s c C s� t d t d t d d d g d t d t d d g f � d
t d t d d d g d t d t d
d g f � d t d d g d t d t d g f � � S( Nt alicloud_access_keyt requiredt aliasest
access_key_idt
access_keyt no_logt fallbackt ALICLOUD_ACCESS_KEYt ALICLOUD_ACCESS_KEY_IDt alicloud_secret_keyt secret_access_keyt
secret_keyt ALICLOUD_SECRET_KEYt ALICLOUD_SECRET_ACCESS_KEYt alicloud_security_tokent security_tokent ALICLOUD_SECURITY_TOKEN( t dictt TrueR ( ( ( sE /usr/lib/python2.7/site-packages/ansible/module_utils/alicloud_ecs.pyt acs_common_argument_spec/ s c C sJ t � } | j t d t d t d d d g d t d d g f � � � | S( Nt alicloud_regionR R t regiont region_idR
t ALICLOUD_REGIONt ALICLOUD_REGION_ID( R t updateR R R ( t spec( ( sE /usr/lib/python2.7/site-packages/ansible/module_utils/alicloud_ecs.pyt ecs_argument_spec: s c C s[ t d | j j d � d | j j d � d | j j d � d d � } | j j d � | f S(
Nt acs_access_key_idR t acs_secret_access_keyR
R R t
user_agents Ansible-Provider-AlicloudR ( R t paramst get( t modulet
ecs_params( ( sE /usr/lib/python2.7/site-packages/ansible/module_utils/alicloud_ecs.pyt get_acs_connection_infoE s
c K s| | j | | � } | sx | g | j � D] } | j ^ q( k r\ t d | | j f � � qx t d | | j f � � n | S( Ns: Region %s does not seem to be available for acs module %s.s: Unknown problem connecting to region %s for acs module %s.( t connect_to_regiont regionst idR R ( t
acs_moduleR R# t connt acs_module_region( ( sE /usr/lib/python2.7/site-packages/ansible/module_utils/alicloud_ecs.pyt connect_to_acsO s (c C sd t | � \ } } | r` y t t j | | � } Wq` t k
r\ } | j d t | � � q` Xn | S( s Return an ecs connectiont msg( R'