def write_fake_ring(path, *devs):
 dev1 = {'id': 0, 'zone': 0, 'device': 'sda1', 'ip': '127.0.0.1', 'port': 6200}
 dev2 = {'id': 0, 'zone': 0, 'device': 'sdb1', 'ip': '127.0.0.1', 'port': 6200}
 (dev1_updates, dev2_updates) = (devs or ({}, {}))
 dev1.update(dev1_updates)
 dev2.update(dev2_updates)
 replica2part2dev_id = [[0, 1, 0, 1], [1, 0, 1, 0]]
 devs = [dev1, dev2]
 part_shift = 30
 with closing(GzipFile(path, 'wb')) as f:
  pickle.dump(RingData(replica2part2dev_id, devs, part_shift), f)

def write_fake_ring ( path , * devs ) : dev1 = { 'id' : 0 , 'zone' : 0 , 'device' : 'sda1' , 'ip' : '127.0.0.1' , 'port' : 6200 } dev2 = { 'id' : 0 , 'zone' : 0 , 'device' : 'sdb1' , 'ip' : '127.0.0.1' , 'port' : 6200 } ( dev1_updates , dev2_updates ) = ( devs or ( { } , { } ) ) dev1 . update ( dev1_updates ) dev2 . update ( dev2_updates ) replica2part2dev_id = [ [ 0 , 1 , 0 , 1 ] , [ 1 , 0 , 1 , 0 ] ] devs = [ dev1 , dev2 ] part_shift = 30 with closing ( GzipFile ( path , 'wb' ) ) as f : pickle . dump ( RingData ( replica2part2dev_id , devs , part_shift ) , f )
pretty much just a two node .