combox

split and encrypted files between online file storage providers
git clone git://git.ricketyspace.net/combox.git
Log | Files | Refs

commit ba9d681cde57eb053042153ff6a3855ffb57d698
parent 646696e364b70e9c2b388d17522463c103130e38
Author: Siddharth Ravikumar <sravik@bgsu.edu>
Date:   Tue, 27 Jan 2015 21:54:21 -0500

[bug fix] combox/file.py: rm_shards function checks if a shard exists before os.remove()ing it.

Diffstat:
combox/file.py | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/combox/file.py b/combox/file.py @@ -116,9 +116,15 @@ def rm_shards(fpath, config): for node in nodes: shard_glob = "%s.shard*" % path.join(node, rel_path) + + shard_glob = glob(shard_glob) + if not len(shard_glob): + # shard was already deleted. + continue + # there's always only one shard in each node directory. So, # the glob() will alawys return a list of size 1. - shard = glob(shard_glob)[0] + shard = shard_glob[0] try: os.remove(shard) except OSError, e: