From: Michael Vrable Date: Sat, 15 Sep 2007 05:04:20 +0000 (-0700) Subject: Enhance object-checksums command. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=4b10d4bed6cbd4b32dd65652af601bbf38de146d;p=cumulus.git Enhance object-checksums command. If no segments are specified, dump object checksums for all segments. Additionally, prompt for a password (to decrypt segments) when needed. --- diff --git a/lbs-util b/lbs-util index 33c9c75..1eac1a0 100755 --- a/lbs-util +++ b/lbs-util @@ -68,10 +68,14 @@ def cmd_list_snapshot_sizes(): previous = set(segments) print "%s: %.3f +%.3f -%.3f" % (s, size / 1024.0**2, added / 1024.0**2, removed / 1024.0**2) -# Build checksum list for objects in the given segments +# Build checksum list for objects in the given segments, or all segments if +# none are specified. def cmd_object_checksums(segments): + get_passphrase() lowlevel = lbs.LowlevelDataStore(options.store) store = lbs.ObjectStore(lowlevel) + if len(segments) == 0: + segments = sorted(lowlevel.list_segments()) for s in segments: for (o, data) in store.load_segment(s): csum = lbs.ChecksumCreator().update(data).compute()