[tahoe-dev] [tahoe-lafs] #1277: write a tool to copy all mutable shares onto a single or fewer disks

tahoe-lafs trac at tahoe-lafs.org
Sat Dec 11 21:18:24 UTC 2010


#1277: write a tool to copy all mutable shares onto a single or fewer disks
----------------------------+-----------------------------------------------
     Reporter:  davidsarah  |       Owner:  kevan                          
         Type:  defect      |      Status:  new                            
     Priority:  major       |   Milestone:  soon (release n/a)             
    Component:  code        |     Version:  1.8.0                          
   Resolution:              |    Keywords:  mutable allmydata review-needed
Launchpad Bug:              |  
----------------------------+-----------------------------------------------

Comment (by kevan):

 When I write a utility script in Python (especially when its functionality
 is abstracted in a way that allows reuse), I prefer to stick the bits that
 rely on the script running as a standalone program in an

 {{{
 if __name__=="__main__":
 }}}

 block. This won't, AFAIK, change the way the script runs if you run it as
 a standalone program, but it will also allow you to import bits and pieces
 of the script from within other programs or the REPL; the latter, at
 least, can be very useful for debugging. Without something like that, this
 doesn't work:

 {{{
 viking-2:tahoe-1277 kacarstensen$ python
 Python 2.6.1 (r261:67515, Dec  6 2008, 16:42:21)
 [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
 Type "help", "copyright", "credits" or "license" for more information.
 >>> from copy_mutable_shares import make_dirs
 Usage: python copy_mutable_shares.py SRC_BASEDIR DEST_BASEDIR
 viking-2:tahoe-1277 kacarstensen$
 }}}

 In your script, it's only the last four statements that need that. Just a
 thought.

 The script executes without issue on my machine.

 {{{shortsi}}} should be {{{short_si}}} to be consistent with your other
 variable names. I also think it is easier to read as {{{short_si}}}.

 I don't have a strong opinion on how the script should handle exceptions,
 since I think there are good arguments for both what it does now and for
 other behaviors. Maybe we should get secorp to look at this ticket, and
 tell us what he (or his helpers) would want the script to do.

 I've satisfied myself that your mutable file check is exhaustive, since
 the state of [http://tahoe-lafs.org/trac/tahoe-
 lafs/browser/trunk/docs/mutable.txt?rev=1600 mutable.txt before the time
 that SDMF was finished] suggests that there was only ever one mutable
 container version, which is the one you're checking for.

 (The mutable.txt document says that the magic string should start with a
 lowercase t, which does not agree with the implementation. I guess the
 specification should be fixed at some point)

-- 
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1277#comment:3>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage


More information about the tahoe-dev mailing list