self.client_exc = pyrax.exceptions.ClientException self.nso_exc = pyrax.exceptions.NoSuchObject
- self.container = pyrax.cloudfiles.create_container(container)
+
+ #query rackspace for the specified container name
+ try:
+ self.container = pyrax.cloudfiles.get_container(container)
+ except pyrax.exceptions.Forbidden as e:
+ log.FatalError("%s : %s \n" % (e.__class__.__name__, util.uexc(e))+
+ "Container may exist, but access was denied.\n"+
+ "If this container exists, please check its X-Container-Read/Write headers.\n"+
+ "Otherwise, please check your credentials and permissions.",
+ log.ErrorCode.backend_permission_denied)
+ except pyrax.exceptions.NoSuchContainer as e:
+ try:
+ self.container = pyrax.cloudfiles.create_container(container)
+ except pyrax.exceptions.Forbidden as e:
+ log.FatalError("%s : %s \n" % (e.__class__.__name__, util.uexc(e))+
+ "Container does not exist, but creation was denied.\n"+
+ "You may be using a read-only user that can view but not create containers.\n"+
+ "Please check your credentials and permissions.",
+ log.ErrorCode.backend_permission_denied)
def _error_code(self, operation, e):
if isinstance(e, self.nso_exc):
The following patch has been tested in our work environment, and the code is provided “as is” without any guarantee or warranty of any kind, either expressed or implied. It is licensed GPLv2, to comply with the license of this project (http:// bazaar. launchpad. net/~duplicity- team/duplicity/ 0.7-series/ view/head: /COPYING).
/usr/lib/ python2. 7/dist- packages/ duplicity/ backends/ _cf_pyrax. py
--- _cf_pyrax.py.orig 2017-09-06 16:35:26.528312165 +0100
+++ _cf_pyrax.py 2017-09-07 11:28:22.729342589 +0100
@@ -70,7 +70,25 @@
- self.container = pyrax.cloudfile
+
+ #query rackspace for the specified container name
+ try:
+ self.container = pyrax.cloudfile
+ except pyrax.exception
+ log.FatalError("%s : %s \n" % (e.__class_
+ "Container may exist, but access was denied.\n"+
+ "If this container exists, please check its X-Container-
+ "Otherwise, please check your credentials and permissions.",
+ log.ErrorCode.
+ except pyrax.exception
+ try:
+ self.container = pyrax.cloudfile
+ except pyrax.exception
+ log.FatalError("%s : %s \n" % (e.__class_
+ "Container does not exist, but creation was denied.\n"+
+ "You may be using a read-only user that can view but not create containers.\n"+
+ "Please check your credentials and permissions.",
+ log.ErrorCode.
def _error_code(self, operation, e):
if isinstance(e, self.nso_exc):