diff options
author | Mohammed Junaid <junaid@redhat.com> | 2013-07-09 09:36:37 +0530 |
---|---|---|
committer | Peter Portante <pportant@redhat.com> | 2013-07-09 18:46:46 -0700 |
commit | 13959e281704d30f6e7762bdd490cdf3bf31bdff (patch) | |
tree | e9f56bceee8d0827aaf626deb33c70333762cc89 /gluster/swift/common/utils.py | |
parent | 3f72ae45a38b40dc0ff718e9cea91f18bb9bb7f0 (diff) |
Remove extraneous system calls
Remove a number of stat() system calls that were redundant.
BUG 903396 (https://bugzilla.redhat.com/show_bug.cgi?id=903396)
Change-Id: I2e89ce8a023650cd745f136f5c697902cf2462ea
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Reviewed-on: http://review.gluster.org/5293
Reviewed-by: Peter Portante <pportant@redhat.com>
Tested-by: Peter Portante <pportant@redhat.com>
Diffstat (limited to 'gluster/swift/common/utils.py')
-rw-r--r-- | gluster/swift/common/utils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gluster/swift/common/utils.py b/gluster/swift/common/utils.py index 40ede7e..5547ea4 100644 --- a/gluster/swift/common/utils.py +++ b/gluster/swift/common/utils.py @@ -13,11 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging import os +import stat import errno import xattr import random +import logging from hashlib import md5 from eventlet import sleep import cPickle as pickle @@ -325,7 +326,7 @@ def _get_account_details_from_fs(acc_path): container_count = 0 acc_stats = do_stat(acc_path) - is_dir = (acc_stats.st_mode & 0040000) != 0 + is_dir = stat.S_ISDIR(acc_stats.st_mode) if is_dir: for name in do_listdir(acc_path): if name.lower() == TEMP_DIR \ |