Hi Stackers, I would like to create a readable tar.gz stream, inside that stream I want to see only one file, and that file's content should be read from a device.
The virtual disk is attached to domU as a block device (/dev/xvdb) I would like to produce a tar.gz, that contains the contents of /dev/xvdb, file name inside the tar.gz does not matter. Here is my current solution: https://review.openstack.org/41651 The main problem is, that tarfile does not support adding content incrementaly, it only has a addfile method: http://docs.python.org/2/library/tarfile.html tfile = tarfile.open(fileobj=output, mode='w|gz') ... tfile.addfile(tinfo, fileobj=input_file) And for the glance client, I need to provide a readable file-like: image_service.update(self.context, image_id, metadata, image_stream, purge_props=False) The change is solving the issue by creating a separate process to create the targz stream, and give that process' output stream to glance. Any other ideas? Many thanks, -- Mate Lakat _______________________________________________ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev