38
39
self.testdir = os.path.join(mkdtemp(), 'tmp_test_container_updater')
39
40
rmtree(self.testdir, ignore_errors=1)
40
41
os.mkdir(self.testdir)
41
pickle.dump(RingData([[0, 1, 0, 1], [1, 0, 1, 0]],
42
[{'id': 0, 'ip': '127.0.0.1', 'port': 12345, 'device': 'sda1',
44
{'id': 1, 'ip': '127.0.0.1', 'port': 12345, 'device': 'sda1',
46
GzipFile(os.path.join(self.testdir, 'account.ring.gz'), 'wb'))
42
ring_file = os.path.join(self.testdir, 'account.ring.gz')
43
with closing(GzipFile(ring_file, 'wb')) as f:
44
pickle.dump(RingData([[0, 1, 0, 1], [1, 0, 1, 0]],
45
[{'id': 0, 'ip': '127.0.0.1', 'port': 12345, 'device': 'sda1',
47
{'id': 1, 'ip': '127.0.0.1', 'port': 12345, 'device': 'sda1',
47
50
self.devices_dir = os.path.join(self.testdir, 'devices')
48
51
os.mkdir(self.devices_dir)
49
52
self.sda1 = os.path.join(self.devices_dir, 'sda1')