Statistics
| Branch: | Tag: | Revision:

root / image_creator / disk.py @ 12c97404

History | View | Annotate | Download (7 kB)

# Date Author Comment
d415dda2 07/03/2013 04:28 pm Nikos Skalkotos

Add support for sysprep-parameters

The user may define parameters needed by the os_type classes to perform
the system preparation tasks.

A new needed_sysprep_params method is added to os_type.OSBase that
returns a list with parameters that should be defined by the user.

b6765b7e 06/25/2013 06:25 pm Nikos Skalkotos

Always close fds returned by tempfile.mkstemp()

121f3bc0 06/11/2013 05:41 pm Nikos Skalkotos

Code Cleanup

  • Prefix all private methods with _
  • Write missing docstrings
  • Move all public methods above the private ones
  • Add module docstrings where missing
  • Define source code encodings on all modules
3afe6b44 05/27/2013 01:08 pm Nikos Skalkotos

Share the md5sum and meta file if image is public

If the image gets registered as public allow anyone to read the
metadata and the md5sum file.

c78ac789 04/25/2013 01:40 pm Nikos Skalkotos

Fix 2 obsolete comments

e9a2d318 03/28/2013 05:30 pm Nikos Skalkotos

Change a ValueError exception to FatalError

88f83027 03/28/2013 02:26 pm Nikos Skalkotos

Add missing docstrings

f5174d2c 03/26/2013 06:28 pm Nikos Skalkotos

Rename DiskDevice class to Image

Rename DiskDevice class to Image and move it to a seperate module.
Also, don't let the user access the os_type/* modules directly. In
Image class create the `os' member variable that will host an
appropriate instance of one of the OSBase classes.

61d14323 03/22/2013 02:57 pm Nikos Skalkotos

Clean-up the code using flake8

8ec4da46 03/06/2013 01:03 pm Nikos Skalkotos

Enforce raw img format in libguestfs

Don't let libguestfs guess the format of the provided image. Enforce
it to treat the image as raw.

f6ea8d02 01/18/2013 06:48 pm Nikos Skalkotos

Fix a bug in tmp dir removal

snf-image-creator removed /var/tmp if the directory was empty

717b0434 01/16/2013 05:13 pm Nikos Skalkotos

Support python-sendfile 2.x

Support both versions (1.2.x and 2.x) of python-sendfile. In
v1.2.x (py-sendfile) the returning value of the sendfile function is a
tuple, where in v2.x (pysendfile) it's a simple integer.

c16850ae 01/10/2013 07:11 pm Nikos Skalkotos

Allow users to specify tmp dir for large files

The cow file when creating images or the temporary image file when
bundling the host system may be large. Allow the user to overwrite
the directory under which those files get created.

033007ec 01/03/2013 07:53 pm Nikos Skalkotos

Merge branch 'stable-0.1'

7f9ecc51 01/03/2013 07:51 pm Nikos Skalkotos

Fix a bug in image shrinking code pt2

Handle correct extended partitions with id 0xf

663f5f80 01/03/2013 02:52 pm Nikos Skalkotos

Minor fixes in output messages

6228d45e 12/31/2012 02:57 pm Nikos Skalkotos

Fix pep8 errors

f3845095 12/31/2012 01:22 am Nikos Skalkotos

Retry cleanup commands if they fail

Add a new try_fail_repeat function that wraps cleanup system commands
and retries them if they fail. There are cases where commands like
dmsetup, umount and losetup -d may fail with device is busy. In most
of the cases, sleeping for halve a second and retrying does the job.

567891a6 12/30/2012 11:14 pm Nikos Skalkotos

Make sure the tmp bunble_volume img gets deleted

923d52df 12/30/2012 06:39 pm Nikos Skalkotos

Remove progress bar for guestfs.launch() progress

In Guestfs you get notifications about progress on some functions like
launch() by registring callback functions. When using guestfs from python,
this is fragile. If the callback functions raises an exception, you end up...

69a4f894 12/28/2012 03:16 am Nikos Skalkotos

Remove temporary bundeled image during cleanup

6d0788a9 12/21/2012 12:06 pm Nikos Skalkotos

Fix a bug in image shrinking code

Credits go to Giannis Spiliopoulos <>

25b4d858 12/20/2012 08:16 pm Nikos Skalkotos

Create fs in image partitions in bundle_volume

Also do a code cleanup

a939e3b8 12/19/2012 07:04 pm Nikos Skalkotos

Fix bugs in bundle_volume module

The partition table of the image is created correct. The partitions
are not yet filled.

8eea5572 12/19/2012 04:22 pm Nikos Skalkotos

Further development in bundle_volume

Nothing is working yet

9517bf29 12/13/2012 07:01 pm Nikos Skalkotos

Fix the image partitions in bundle_volume

Check the file system usage and accordingly reduce the size of the
last partition in the image.

27a4229d 12/11/2012 04:43 pm Nikos Skalkotos

Futher development for bundle_volume

Create a sparse file under /mnt in the size of the root hard disk
and copy the mbr into this file. Not yet workable.

9e4b4de2 11/21/2012 04:14 pm Nikos Skalkotos

Add new bundle_volume module

This is not yet workable but it will host the code for creating
images out of a running system.

a716819f 11/02/2012 01:08 pm Nikos Skalkotos

Use py-sendfile in favor of pysendfile

The former is older but there are packages for it in distros like
Ubuntu.

9c354f13 10/18/2012 05:24 pm Nikos Skalkotos

Handle keaboard interrupts and TERM signals.

a803b449 10/18/2012 11:37 am Nikos Skalkotos

Mount the media ro if --print-sysprep is specified

8fed77f7 08/24/2012 12:48 pm Nikos Skalkotos

Make the cow file size equal to the original media

The size of the cow file was hardcoded to 1G. This was buggy, because
for a big image, the resize operation could fill up the cow file and
fail.

dbf466eb 08/08/2012 03:11 pm Nikos Skalkotos

Remove the image size from the image metadata

835171dc 06/28/2012 01:50 pm Nikos Skalkotos

Fix minor typos

f99fe99d 06/28/2012 01:20 am Nikos Skalkotos

Fix pep8 errors

Fixed many `E127 continuation line over-indented for visual indent'
errors

9666a511 06/27/2012 05:42 pm Nikos Skalkotos

Leave 2048 sectors space at the end when shrinking

Most partition manipulation programs leave 2048 sector empty space
after the last partition.

279f2c7d 06/26/2012 04:35 pm Nikos Skalkotos

Fix error message for non supported media source

550d4a49 06/14/2012 05:46 pm Nikos Skalkotos

Allow readonly mount in DiskDevice class

Add an option to DiskDevice's mount method to allow readonly mount

96171db1 06/11/2012 12:02 pm Nikos Skalkotos

Add size param in the Output.Progress constructor

5f27b178 06/11/2012 11:25 am Nikos Skalkotos

Disable recovery proc if libguestfs ver < 1.17.14

In older versions of libguestfs, the recovery process did not close
the file descriptors it inherited. This could case problems if the
parent process had open pipes.

e77e66a9 06/05/2012 07:08 pm Nikos Skalkotos

Unify output by creating a seperated output module

All image-creator components now output messages using an instance
of one of the output classes.

e8b1b48b 05/04/2012 06:44 pm Nikos Skalkotos

Remove the swap partition when shrinking

If the swap partition is the last partition in the media, then it can
be safely removed. The image-creator will save enough info in the
SWAP metadata to recreate it.

5b801534 04/29/2012 03:21 pm Nikos Skalkotos

Move get_os_class from image_creator to os_type

This is needed because otherwise setup.py fails on some systems. Also
do some more cleanup.

2a9836b1 04/29/2012 12:56 pm Nikos Skalkotos

Fix a bug introduced in commit e108efd285b34d5a28e

Not all needed code parts where updated when the size() method in
DiskDevice class was abandoned in favor of the size attribute.

e108efd2 04/27/2012 04:52 pm Nikos Skalkotos

Cleanup code in disk module

331aa0ec 04/26/2012 07:55 pm Nikos Skalkotos

Add support for GUID Partition Tables

b1aea98e 04/24/2012 03:54 pm Nikos Skalkotos

Minor cleanup (typos, comments, etc)

42ace959 04/24/2012 12:45 pm Nikos Skalkotos

Switch to ansicolor for coloring & fix pep8 errors

b1395967 04/23/2012 06:53 pm Nikos Skalkotos

Use progress for progress bar & implement register

8e3065a0 04/20/2012 05:38 pm Nikos Skalkotos

Add progress bar in pithos upload & compute md5sum

e22aa3a9 04/20/2012 11:29 am Nikos Skalkotos

Seperate snapshoting from get_device in Disk class

6f319b6a 04/19/2012 03:58 pm Nikos Skalkotos

Fix typos in var names

f165adc0 04/10/2012 04:38 pm Nikos Skalkotos

Add options for enabling/disabling sysprep tasks

Also merge data_cleanup tasks with syspreps and did a major cleanup

979096dd 03/24/2012 02:54 pm Nikos Skalkotos

Add silent mode option

All printing had to be reordered and now it is done from a central point.

d603d80d 03/23/2012 07:16 pm Nikos Skalkotos

Move image_extract method into DiskDevice

13675429 03/21/2012 08:35 pm Nikos Skalkotos

Correct image size computation

This commit fixes a bug where size method in DiskDevice returned the
payload size of the device one byte shorter than it actually was.

3f70f242 03/21/2012 08:14 pm Nikos Skalkotos

Fix linux sysprep_acpid & remove output indents

22a6d232 03/20/2012 06:04 pm Nikos Skalkotos

Beautify program's output.

ae48a082 03/19/2012 12:26 pm Nikos Skalkotos

Fix license, copyright and pep8 infractions

c54fc0e8 03/16/2012 07:21 pm Nikos Skalkotos

Fix wrong variable name in progress_callback

0ae01e26 03/16/2012 06:14 pm Nikos Skalkotos

Create an exception based error reporting system

All modules should use image_creator.FatalError exception to report
fatal errors.

0db22eac 03/16/2012 05:26 pm Nikos Skalkotos

Split DiskDevice constructor in 2 parts

In the constructor only variable initialization is performed. This is
needed because the constructor is executed before the DiskDevice
instance is appended to the device list, and if something fails there,
then the resources may be cleaned up in an incorrect order.

3ccb2618 03/09/2012 05:26 pm Nikos Skalkotos

Remove python-losetup dependency

The package is buggy and we can use pbs to do the same thing.

e7c01d1e 03/08/2012 06:51 pm Nikos Skalkotos

Add an extra yield in progress_generator

This is needed to suppress the StopIteration exception

586da0a0 03/08/2012 05:32 pm Nikos Skalkotos

Add progress bar for the guestfs launch method

01a7cff3 03/07/2012 05:45 pm Nikos Skalkotos

Handle imported commands that aren't in the PATH

This fixes cases where a normal user tries to execute the program and
the program raises pbs.CommandNotFound exceptions because it tries to
import a command from sbin, which is not in the path.

c408053f 02/29/2012 07:47 pm Nikos Skalkotos

Add input options and populate image metadata

Hooray! This is the first release that actually works!

a1a5ca4b 02/29/2012 02:27 pm Nikos Skalkotos

Fix minor typos

3b2f6619 02/28/2012 10:12 pm Nikos Skalkotos

Document basic classes and methods

e3aac3f9 02/28/2012 06:26 pm Nikos Skalkotos

Make DiskDevice.shrink() return the new disk size

8c574358 02/24/2012 03:29 pm Nikos Skalkotos

Major code revision

  • Add foreach_file function in OSBase. This is used by all cleanup
    methods
  • Add slackware class. This class derives from linux and overwrites the
    log cleanup behaviour. This is needed since slackware stores all
    package management info in /var/log/packages...
0d5a999d 02/22/2012 06:22 pm Nikos Skalkotos

Fix code for cleanup of image data

aa2062ba 02/20/2012 07:59 pm Nikos Skalkotos

Add OS specific classes

1377b8a7 02/17/2012 08:30 pm Nikos Skalkotos

Use libguestfs to access the image

333ff548 02/17/2012 11:49 am Nikos Skalkotos

Further development

Make the cow file sparse
Add method in Device to list the partitions
Add a "is bootable" flag in Device constructor

d57775d4 02/15/2012 07:19 pm Nikos Skalkotos

Initial commit