From cae3216a2bff57c41003a7ad9532decc51412dbe Mon Sep 17 00:00:00 2001 From: Peter Portante Date: Wed, 24 Oct 2012 10:30:56 -0400 Subject: object-storage: use constants for directory names Change-Id: I6109ee55061eae53c4c6762ca31fb5c4b13f0071 Signed-off-by: Peter Portante Reviewed-on: http://review.gluster.org/4140 Reviewed-by: Kaleb KEITHLEY Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- swift/1.4.8/plugins/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/swift/1.4.8/plugins/utils.py b/swift/1.4.8/plugins/utils.py index c011b681f0b..a1ac64db5c9 100644 --- a/swift/1.4.8/plugins/utils.py +++ b/swift/1.4.8/plugins/utils.py @@ -19,6 +19,7 @@ import errno import xattr from hashlib import md5 from swift.common.utils import normalize_timestamp, TRUE_VALUES +from swift.obj.server import ASYNCDIR import cPickle as pickle from ConfigParser import ConfigParser, NoSectionError, NoOptionError @@ -40,6 +41,7 @@ MAX_XATTR_SIZE = 65536 CONTAINER = 'container' DIR = 'dir' MARKER_DIR = 'marker_dir' +TEMP_DIR = 'tmp' FILE = 'file' DIR_TYPE = 'application/directory' FILE_TYPE = 'application/octet-stream' @@ -499,8 +501,8 @@ def _get_account_details_from_fs(acc_path, acc_stats): is_dir = (acc_stats.st_mode & 0040000) != 0 if is_dir: for name in do_listdir(acc_path): - if name.lower() == 'tmp' \ - or name.lower() == 'async_pending' \ + if name.lower() == TEMP_DIR \ + or name.lower() == ASYNCDIR \ or not os.path.isdir(os.path.join(acc_path, name)): continue container_count += 1 -- cgit