Remove unused method iter_devices_partition

Change-Id: I69a14bcb92490abd3ad1070799bf1580a2dcaa92
Signed-off-by: Peter Portante <peter.portante@redhat.com>
This commit is contained in:
Peter Portante 2013-09-12 16:00:49 -04:00
parent 0a1d6101d5
commit 0b949ebe90
1 changed files with 0 additions and 26 deletions

View File

@ -1295,32 +1295,6 @@ def compute_eta(start_time, current_value, final_value):
return get_time_units(1.0 / completion * elapsed - elapsed)
def iter_devices_partitions(devices_dir, item_type):
"""
Iterate over partitions across all devices.
:param devices_dir: Path to devices
:param item_type: One of 'accounts', 'containers', or 'objects'
:returns: Each iteration returns a tuple of (device, partition)
"""
devices = listdir(devices_dir)
shuffle(devices)
devices_partitions = []
for device in devices:
partitions = listdir(os.path.join(devices_dir, device, item_type))
shuffle(partitions)
devices_partitions.append((device, iter(partitions)))
yielded = True
while yielded:
yielded = False
for device, partitions in devices_partitions:
try:
yield device, partitions.next()
yielded = True
except StopIteration:
pass
def unlink_older_than(path, mtime):
"""
Remove any file in a given path that that was last modified before mtime.