File: //usr/lib/python3/dist-packages/duplicity/backends/__pycache__/hubicbackend.cpython-310.pyc
o
�~�_� � @ sn d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlZddl m
Z
G dd � d e
�Zej�
d
e� dS )� )�strN)�log)�util)�BackendException� )�PyraxBackendc @ s e Zd ZdZdd� ZdS )�HubicBackendz'
Backend for Hubic using Pyrax
c
C s� t jj�| |� zdd l}W n ty" } ztdt|� ��d }~ww |�dd� t j
�d�}t j
�|�r`z|�
|� W n' ty_ } zt�d|jjt�|�f tjj� W Y d }~n d }~ww td��|j
�d�}|jj| _|jj| _|j�|�| _d S ) Nr zPHubic backend requires the pyrax library available from Rackspace.
Exception: %s�
identity_typez5duplicity.backends.pyrax_identity.hubic.HubicIdentityz~/.hubic_credentialsz7Connection failed, please check your credentials: %s %sz#No ~/.hubic_credentials file found.�/) � duplicity�backend�Backend�__init__�pyrax�ImportErrorr r �set_setting�os�path�
expanduser�exists�set_credential_file� Exceptionr �
FatalError� __class__�__name__r �uexc� ErrorCode�connection_failed�lstrip�
exceptions�ClientException�
client_exc�NoSuchObject�nso_exc�
cloudfiles�create_container� container)�self�
parsed_urlr �e�CREDENTIALS_FILEr&