From aad81528d4a0b443eb7bfccbcd3c1e523ed8efa9 Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Tue, 4 Feb 2014 16:31:47 +0530 Subject: [PATCH] Make .expiring_objects account name configurable The account which tracks objects scheduled for deletion had its name hard-coded to 'expiring_objects'. This is made configurable via expiring_objects_account_name option. Backend file-systems integration efforts may want to treat these "special" accounts in a different way. This would still go undocumented, hence 'pseudo-hidden'. UpgradeImpact: None as the default value would continue to be the same which is '.expiring_objects'. Change-Id: I1a093b0d0e2bdd0c3d723090af03fc0adf2ad7e3 Signed-off-by: Prashanth Pai --- etc/object-expirer.conf-sample | 1 + etc/object-server.conf-sample | 1 + etc/proxy-server.conf-sample | 1 + swift/obj/expirer.py | 2 +- swift/obj/server.py | 2 +- swift/proxy/server.py | 2 +- 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/etc/object-expirer.conf-sample b/etc/object-expirer.conf-sample index cef62be6c3..552f57b50a 100644 --- a/etc/object-expirer.conf-sample +++ b/etc/object-expirer.conf-sample @@ -26,6 +26,7 @@ [object-expirer] # interval = 300 # auto_create_account_prefix = . +# expiring_objects_account_name = expiring_objects # report_interval = 300 # concurrency is the level of concurrency o use to do the work, this value # must be set to at least 1 diff --git a/etc/object-server.conf-sample b/etc/object-server.conf-sample index f85b76424e..f283a5366e 100644 --- a/etc/object-server.conf-sample +++ b/etc/object-server.conf-sample @@ -9,6 +9,7 @@ # mount_check = true # disable_fallocate = false # expiring_objects_container_divisor = 86400 +# expiring_objects_account_name = expiring_objects # # Use an integer to override the number of pre-forked processes that will # accept connections. diff --git a/etc/proxy-server.conf-sample b/etc/proxy-server.conf-sample index 775675e411..c35475a797 100644 --- a/etc/proxy-server.conf-sample +++ b/etc/proxy-server.conf-sample @@ -33,6 +33,7 @@ # key_file = /etc/swift/proxy.key # # expiring_objects_container_divisor = 86400 +# expiring_objects_account_name = expiring_objects # # You can specify default log routing here if you want: # log_name = swift diff --git a/swift/obj/expirer.py b/swift/obj/expirer.py index cd355a28ce..ed188cb10a 100644 --- a/swift/obj/expirer.py +++ b/swift/obj/expirer.py @@ -44,7 +44,7 @@ class ObjectExpirer(Daemon): self.interval = int(conf.get('interval') or 300) self.expiring_objects_account = \ (conf.get('auto_create_account_prefix') or '.') + \ - 'expiring_objects' + (conf.get('expiring_objects_account_name') or 'expiring_objects') conf_path = conf.get('__file__') or '/etc/swift/object-expirer.conf' request_tries = int(conf.get('request_tries') or 3) self.swift = InternalClient(conf_path, diff --git a/swift/obj/server.py b/swift/obj/server.py index 116bd77e05..9a0e2e06aa 100644 --- a/swift/obj/server.py +++ b/swift/obj/server.py @@ -92,7 +92,7 @@ class ObjectController(object): self.allowed_headers.add(header) self.expiring_objects_account = \ (conf.get('auto_create_account_prefix') or '.') + \ - 'expiring_objects' + (conf.get('expiring_objects_account_name') or 'expiring_objects') self.expiring_objects_container_divisor = \ int(conf.get('expiring_objects_container_divisor') or 86400) # Initialization was successful, so now apply the network chunk size diff --git a/swift/proxy/server.py b/swift/proxy/server.py index 92a688a7b3..d42688b423 100644 --- a/swift/proxy/server.py +++ b/swift/proxy/server.py @@ -109,7 +109,7 @@ class Application(object): config_true_value(conf.get('account_autocreate', 'no')) self.expiring_objects_account = \ (conf.get('auto_create_account_prefix') or '.') + \ - 'expiring_objects' + (conf.get('expiring_objects_account_name') or 'expiring_objects') self.expiring_objects_container_divisor = \ int(conf.get('expiring_objects_container_divisor') or 86400) self.max_containers_per_account = \