]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Don't hard code AUTH_ into the swift backup url
authorMichael Kerrin <michael.kerrin@hp.com>
Fri, 5 Apr 2013 15:33:06 +0000 (15:33 +0000)
committerMichael Kerrin <michael.kerrin@hp.com>
Fri, 5 Apr 2013 15:33:06 +0000 (15:33 +0000)
Instead make it configurable as part of the backup_swift_url option

Change-Id: I32019d8d4af2f8876da3807a5af3f0b921456935

cinder/backup/services/swift.py

index f88202ab9e2d150d29ecbc1c31e321b48d7448a5..43cbd1ff2d21c92b53a5563819ed09225c7996a1 100644 (file)
@@ -51,7 +51,7 @@ LOG = logging.getLogger(__name__)
 
 swiftbackup_service_opts = [
     cfg.StrOpt('backup_swift_url',
-               default='http://localhost:8080/v1/',
+               default='http://localhost:8080/v1/AUTH_',
                help='The URL of the Swift endpoint'),
     cfg.StrOpt('backup_swift_container',
                default='volumebackups',
@@ -98,8 +98,8 @@ class SwiftBackupService(base.Base):
 
     def __init__(self, context, db_driver=None):
         self.context = context
-        self.swift_url = '%sAUTH_%s' % (FLAGS.backup_swift_url,
-                                        self.context.project_id)
+        self.swift_url = '%s%s' % (FLAGS.backup_swift_url,
+                                   self.context.project_id)
         self.az = FLAGS.storage_availability_zone
         self.data_block_size_bytes = FLAGS.backup_swift_object_size
         self.swift_attempts = FLAGS.backup_swift_retry_attempts