Adding pruner and prefetcher to setup.py

This commit is contained in:
Rick Harris 2011-07-14 12:05:00 -05:00
parent 626b7a4f04
commit 413b32ef8a
3 changed files with 5 additions and 8 deletions

View File

@ -204,8 +204,6 @@ class ImageCache(object):
with open(tmp_path, mode) as cache_file:
yield cache_file
except Exception as e:
# NOTE(sirp): can't use 'except Exception as e' here since some
# exceptions (unfortunately) don't subclass Exception.
rollback(e)
raise
else:

View File

@ -219,12 +219,9 @@ def inc_xattr(path, key, n=1):
BEWARE, this code *does* have a RACE CONDITION, since the
read/update/write sequence is not atomic.
This function is therefore suitable for collecting stats (where
perfection isn't required), but NOT for code that makes critical
decisions.
For this use case, the trade-off of simple, lock-free code was worth an
occasional, harmless race.
Since the use-case for this function is collecting stats--not critical--
the benefits of simple, lock-free code out-weighs the possibility of an
occasional hit not being counted.
"""
try:
count = int(get_xattr(path, key))

View File

@ -89,5 +89,7 @@ setup(
'bin/glance-api',
'bin/glance-control',
'bin/glance-manage',
'bin/glance-prefetcher',
'bin/glance-pruner',
'bin/glance-registry',
'bin/glance-upload'])