Revision b6765b7e image_creator/bundle_volume.py

b/image_creator/bundle_volume.py
267 267
        name = os.path.basename(dev) + "_" + uuid.uuid4().hex
268 268
        tablefd, table = tempfile.mkstemp()
269 269
        try:
270
            size = end - start + 1
271
            os.write(tablefd, "0 %d linear %s %d" % (size, dev, start))
270
            try:
271
                size = end - start + 1
272
                os.write(tablefd, "0 %d linear %s %d" % (size, dev, start))
273
            finally:
274
                os.close(tablefd)
272 275
            dmsetup('create', "%sp%d" % (name, num), table)
273 276
        finally:
274 277
            os.unlink(table)

Also available in: Unified diff