Current File : //usr/lib/python2.7/site-packages/euca2ools/commands/s3/__init__.pyc |
�
��Xc @ s� d d l Z d d l Z d d l Z d d l Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d l
Z
d d l Z d d l m
Z
d d l m Z d e j j f d � � YZ d e j j f d � � YZ d � Z d
� Z d S( i����N( t Arg( t Euca2ools( t AWSErrort S3c B sY e Z d Z d Z d Z d Z e d d d d d d
�g Z d � Z d � Z d
� Z
RS( t s3s Object storage servicet EUCA_DEFAULT_REGIONt AWS_DEFAULT_REGIONt S3_URLs -Us --urlt metavart URLt helps# object storage service endpoint URLc C s t | � � d S( N( R ( t selft response( ( sB /usr/lib/python2.7/site-packages/euca2ools/commands/s3/__init__.pyt handle_http_error5 s c C s2 t j j j j | � } | j s@ t j j j j d | � } n t j j j j | j � } | j | | � \ } } | r� | j | | f S| j j
d � } x{ | j � D]m \ } } t j j j j | � } | j | | � \ } } | r� | j j d d | �}
|
p| | | f Sq� Wt
d j | � � � d S( s�
Given a URL, try to return its associated region, bucket, and
key names based on this object's endpoint info as well as all
S3 endpoints given in the configuration.
s http://s s3-urlt namet regionsg URL '{0}' matches no known object storage endpoints. Supply one via the command line or configuration.N( t sixt movest urllibt parset urlparset schemet endpointt _S3__match_patht region_namet configt get_all_region_optionst itemst get_region_optiont
ValueErrort format( R t urlt
parsed_urlt parsed_own_urlt buckett keyt s3_urlst sectiont conf_urlt parsed_conf_urlR ( ( sB /usr/lib/python2.7/site-packages/euca2ools/commands/s3/__init__.pyt resolve_url_to_location9 s"