snf-image-creator
6 years agoAdd size param in the Output.Progress constructor
Nikos Skalkotos [Mon, 11 Jun 2012 09:02:04 +0000 (12:02 +0300)]
Add size param in the Output.Progress constructor

6 years agoDisable recovery proc if libguestfs ver < 1.17.14
Nikos Skalkotos [Mon, 11 Jun 2012 08:25:51 +0000 (11:25 +0300)]
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.

6 years agoMake progress class contain and Ouput instance
Nikos Skalkotos [Thu, 7 Jun 2012 10:58:40 +0000 (13:58 +0300)]
Make progress class contain and Ouput instance

This is handy because now progress class can print using the output
methods of it's output class

6 years agoFix copyright date in main.py
Nikos Skalkotos [Wed, 6 Jun 2012 12:14:38 +0000 (15:14 +0300)]
Fix copyright date in main.py

6 years agoCheck if stdout is a tty
Nikos Skalkotos [Wed, 6 Jun 2012 11:02:28 +0000 (14:02 +0300)]
Check if stdout is a tty

If not then don't output progressbars and colors

6 years agoFix a bug in Output.progress_generator
Nikos Skalkotos [Wed, 6 Jun 2012 09:05:56 +0000 (12:05 +0300)]
Fix a bug in Output.progress_generator

The progress bar of the progress generator had a wrong max attribute.

6 years agoUnify output by creating a seperated output module
Nikos Skalkotos [Tue, 5 Jun 2012 15:36:17 +0000 (18:36 +0300)]
Unify output by creating a seperated output module

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

7 years agoRemove get_metadata() from os_type classes
Nikos Skalkotos [Fri, 18 May 2012 16:14:12 +0000 (19:14 +0300)]
Remove get_metadata() from os_type classes

The metadata are collected in the constructor and are saved in the
meta variable. This way they can be accessed and altered by the
sysprep methods. There are cases where some metadata are not valid
and need to be updated after a sysprep action is performed. For
example, remove_user_accounts sysprep action may remove a user that
is present in the USERS metadata.

7 years agoAdd option for passing user-defined image metadata
Nikos Skalkotos [Fri, 18 May 2012 14:05:01 +0000 (17:05 +0300)]
Add option for passing user-defined image metadata

The metadata passed by the user will overwrite any automatically
collected metadata with the same key.

7 years agoAdd remove_swap_entry sysprep in linux
Nikos Skalkotos [Wed, 16 May 2012 12:23:34 +0000 (15:23 +0300)]
Add remove_swap_entry sysprep in linux

This action will remove the swap entry from the fstab.

7 years agoRemove the swap partition when shrinking
Nikos Skalkotos [Fri, 4 May 2012 15:44:43 +0000 (18:44 +0300)]
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.

7 years agoMove get_os_class from image_creator to os_type
Nikos Skalkotos [Sun, 29 Apr 2012 12:21:47 +0000 (15:21 +0300)]
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.

7 years agoFix a bug introduced in commit e108efd285b34d5a28e
Nikos Skalkotos [Sun, 29 Apr 2012 09:56:52 +0000 (12:56 +0300)]
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.

7 years agoCleanup code in disk module
Nikos Skalkotos [Fri, 27 Apr 2012 13:52:11 +0000 (16:52 +0300)]
Cleanup code in disk module

7 years agoCleanup code & add comments in gpt module
Nikos Skalkotos [Fri, 27 Apr 2012 11:57:20 +0000 (14:57 +0300)]
Cleanup code & add comments in gpt module

7 years agoAdd support for GUID Partition Tables
Nikos Skalkotos [Thu, 26 Apr 2012 16:55:53 +0000 (19:55 +0300)]
Add support for GUID Partition Tables

7 years agoAdd new line in metadata and md5sum string
Nikos Skalkotos [Wed, 25 Apr 2012 15:34:07 +0000 (18:34 +0300)]
Add new line in metadata and md5sum string

7 years agoUnify the output of progress bars
Nikos Skalkotos [Tue, 24 Apr 2012 14:40:46 +0000 (17:40 +0300)]
Unify the output of progress bars

7 years agoMinor cleanup (typos, comments, etc)
Nikos Skalkotos [Tue, 24 Apr 2012 12:54:25 +0000 (15:54 +0300)]
Minor cleanup (typos, comments, etc)

7 years agoSwitch to ansicolor for coloring & fix pep8 errors
Nikos Skalkotos [Tue, 24 Apr 2012 09:45:49 +0000 (12:45 +0300)]
Switch to ansicolor for coloring & fix pep8 errors

7 years agoUse progress for progress bar & implement register
Nikos Skalkotos [Mon, 23 Apr 2012 15:53:49 +0000 (18:53 +0300)]
Use progress for progress bar & implement register

7 years agoFix pep8 errors
Nikos Skalkotos [Fri, 20 Apr 2012 14:44:33 +0000 (17:44 +0300)]
Fix pep8 errors

7 years agoAdd progress bar in pithos upload & compute md5sum
Nikos Skalkotos [Fri, 20 Apr 2012 14:38:40 +0000 (17:38 +0300)]
Add progress bar in pithos upload & compute md5sum

7 years agoSeperate snapshoting from get_device in Disk class
Nikos Skalkotos [Fri, 20 Apr 2012 08:29:59 +0000 (11:29 +0300)]
Seperate snapshoting from get_device in Disk class

7 years agoFix image upload
Nikos Skalkotos [Thu, 19 Apr 2012 16:39:07 +0000 (19:39 +0300)]
Fix image upload

Also rearrange input options

7 years agoImprove help msg for remove-user-accounts sysprep
Nikos Skalkotos [Thu, 19 Apr 2012 13:05:04 +0000 (16:05 +0300)]
Improve help msg for remove-user-accounts sysprep

7 years agoMake -u and -r input options require an argument
Nikos Skalkotos [Thu, 19 Apr 2012 13:01:51 +0000 (16:01 +0300)]
Make -u and -r input options require an argument

7 years agoFix typos in var names
Nikos Skalkotos [Thu, 19 Apr 2012 12:58:57 +0000 (15:58 +0300)]
Fix typos in var names

7 years agoAdd a wrapper module for kamaki
Nikos Skalkotos [Wed, 11 Apr 2012 14:25:45 +0000 (17:25 +0300)]
Add a wrapper module for kamaki

This is just a template. Not fully workable

7 years agoAdd options for enabling/disabling sysprep tasks
Nikos Skalkotos [Tue, 10 Apr 2012 13:38:13 +0000 (16:38 +0300)]
Add options for enabling/disabling sysprep tasks

Also merge data_cleanup tasks with syspreps and did a major cleanup

7 years agoAdd options for printing sysprep and data cleanup
Nikos Skalkotos [Mon, 9 Apr 2012 12:09:20 +0000 (15:09 +0300)]
Add options for printing sysprep and data cleanup

Add --print-data-cleanup and --print sysprep input options. If enabled
the program will output what data cleanup and syspep operations will
and won't run a a selected input media

7 years agoFix pep8 error
Nikos Skalkotos [Mon, 9 Apr 2012 12:08:55 +0000 (15:08 +0300)]
Fix pep8 error

7 years agoAdd cleanup method that removes user accounts
Nikos Skalkotos [Fri, 6 Apr 2012 15:08:59 +0000 (18:08 +0300)]
Add cleanup method that removes user accounts

This method will remove all users that have id over 1000. In most
systems this will remove all normal user accounts besides the first
one. This method will not run by default.

7 years agoAdd cleanup method that locks all user accounts
Nikos Skalkotos [Thu, 5 Apr 2012 14:36:19 +0000 (17:36 +0300)]
Add cleanup method that locks all user accounts

7 years agoAdd exclude_task decorator in os_type
Nikos Skalkotos [Thu, 5 Apr 2012 13:26:02 +0000 (16:26 +0300)]
Add exclude_task decorator in os_type

This can be used to create a set of by default disabled data_cleanup
and sysprep tasks.

7 years agoAdd silent mode option
Nikos Skalkotos [Sat, 24 Mar 2012 12:54:01 +0000 (14:54 +0200)]
Add silent mode option

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

7 years agoAdd image_creator.os_type to packages in setup
Nikos Skalkotos [Sat, 24 Mar 2012 11:20:38 +0000 (13:20 +0200)]
Add image_creator.os_type to packages in setup

7 years agoAdd a new line the end of the acpid action script
Nikos Skalkotos [Sat, 24 Mar 2012 08:50:03 +0000 (10:50 +0200)]
Add a new line the end of the acpid action script

7 years agoCapitalize all image metadata keys
Nikos Skalkotos [Sat, 24 Mar 2012 08:40:21 +0000 (10:40 +0200)]
Capitalize all image metadata keys

7 years agoFix cli options help messages
Nikos Skalkotos [Sat, 24 Mar 2012 08:31:43 +0000 (10:31 +0200)]
Fix cli options help messages

7 years agoMove image_extract method into DiskDevice
Nikos Skalkotos [Fri, 23 Mar 2012 17:16:23 +0000 (19:16 +0200)]
Move image_extract method into DiskDevice

7 years agoFix sysprep_acpid method in linux.
Nikos Skalkotos [Wed, 21 Mar 2012 18:45:38 +0000 (20:45 +0200)]
Fix sysprep_acpid method in linux.

Commit 3f70f24 introduced a bug where the event file was overwritten
instead of the action file.

7 years agoCorrect image size computation
Nikos Skalkotos [Wed, 21 Mar 2012 18:32:50 +0000 (20:32 +0200)]
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.

7 years agoFix linux sysprep_acpid & remove output indents
Nikos Skalkotos [Wed, 21 Mar 2012 18:14:26 +0000 (20:14 +0200)]
Fix linux sysprep_acpid & remove output indents

7 years agoAdd new-line printing option in printing functions
Nikos Skalkotos [Tue, 20 Mar 2012 17:08:08 +0000 (19:08 +0200)]
Add new-line printing option in printing functions

7 years agoBeautify program's output.
Nikos Skalkotos [Tue, 20 Mar 2012 16:04:38 +0000 (18:04 +0200)]
Beautify program's output.

7 years agoFix license, copyright and pep8 infractions
Nikos Skalkotos [Mon, 19 Mar 2012 10:26:31 +0000 (12:26 +0200)]
Fix license, copyright and pep8 infractions

7 years agoFix wrong variable name in progress_callback
Nikos Skalkotos [Fri, 16 Mar 2012 17:21:12 +0000 (19:21 +0200)]
Fix wrong variable name in progress_callback

7 years agoCreate an exception based error reporting system
Nikos Skalkotos [Fri, 16 Mar 2012 16:14:48 +0000 (18:14 +0200)]
Create an exception based error reporting system

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

7 years agoFix a bug in linux sysprep_* methods
Nikos Skalkotos [Fri, 16 Mar 2012 15:36:23 +0000 (17:36 +0200)]
Fix a bug in linux sysprep_* methods

The parameter order when calling guestfs.write was incorrect.

7 years agoSplit DiskDevice constructor in 2 parts
Nikos Skalkotos [Fri, 16 Mar 2012 15:26:44 +0000 (17:26 +0200)]
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.

7 years agoExtend data_cleanup method in unix
Nikos Skalkotos [Tue, 13 Mar 2012 16:09:22 +0000 (18:09 +0200)]
Extend data_cleanup method in unix

* Add more userdata to be cleaned
* Prefix all data_cleanup methods with data_cleanup

7 years agoAdd sysprep method in os_type classes.
Nikos Skalkotos [Tue, 13 Mar 2012 15:48:54 +0000 (17:48 +0200)]
Add sysprep method in os_type classes.

This is used to prepare the media for image extraction. The main
difference from data_cleanup is that the tasks performed with this
method are mandatory in order to make the image workable.

Added the following sysprep methods for linux:
 * sysprep_acpid
 * sysprep_persistent_net_rules
 * sysprep_persistend_devs

7 years agoAdd cleanup_cache function in unix
Nikos Skalkotos [Tue, 13 Mar 2012 10:23:48 +0000 (12:23 +0200)]
Add cleanup_cache function in unix

This function will remove regular files under /var/cache

7 years agoAdd remove_persistent_net method in linux.
Nikos Skalkotos [Tue, 13 Mar 2012 10:17:46 +0000 (12:17 +0200)]
Add remove_persistent_net method in linux.

This will remove the persitent net udev rule.

7 years agoAdd convert_to_persistent_dev method in Linux
Nikos Skalkotos [Mon, 12 Mar 2012 17:01:34 +0000 (19:01 +0200)]
Add convert_to_persistent_dev method in Linux

This method replaces all non-persistent device appearances in fstab and
grub1 with UUIDs.

7 years agoAdd mail and /var/tmp cleanup for unix systems
Nikos Skalkotos [Sun, 11 Mar 2012 20:51:04 +0000 (22:51 +0200)]
Add mail and /var/tmp cleanup for unix systems

7 years agoRemove python-losetup dependency
Nikos Skalkotos [Fri, 9 Mar 2012 15:26:29 +0000 (17:26 +0200)]
Remove python-losetup dependency

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

7 years agoAdd an extra yield in progress_generator
Nikos Skalkotos [Thu, 8 Mar 2012 16:51:55 +0000 (18:51 +0200)]
Add an extra yield in progress_generator

This is needed to suppress the StopIteration exception

7 years agoAdd progress bar for the guestfs launch method
Nikos Skalkotos [Thu, 8 Mar 2012 15:32:04 +0000 (17:32 +0200)]
Add progress bar for the guestfs launch method

7 years agoAdd options for image upload/register with kamaki
Nikos Skalkotos [Thu, 8 Mar 2012 15:30:04 +0000 (17:30 +0200)]
Add options for image upload/register with kamaki

Not workable. Kamaki is not imported yet.

7 years agoHandle imported commands that aren't in the PATH
Nikos Skalkotos [Wed, 7 Mar 2012 13:40:05 +0000 (15:40 +0200)]
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.

7 years agoFix a bug in get_passworded_users
Nikos Skalkotos [Mon, 5 Mar 2012 14:13:05 +0000 (16:13 +0200)]
Fix a bug in get_passworded_users

7 years agoAdd external dependencies in setuptools
Nikos Skalkotos [Mon, 5 Mar 2012 13:45:00 +0000 (15:45 +0200)]
Add external dependencies in setuptools

7 years agoAdd input options and populate image metadata
Nikos Skalkotos [Wed, 29 Feb 2012 17:47:36 +0000 (19:47 +0200)]
Add input options and populate image metadata

Hooray! This is the first release that actually works!

7 years agoFix minor typos
Nikos Skalkotos [Wed, 29 Feb 2012 12:27:04 +0000 (14:27 +0200)]
Fix minor typos

7 years agoDocument basic classes and methods
Nikos Skalkotos [Tue, 28 Feb 2012 20:12:52 +0000 (22:12 +0200)]
Document basic classes and methods

7 years agoDetect Kubuntu images
Nikos Skalkotos [Tue, 28 Feb 2012 16:32:52 +0000 (18:32 +0200)]
Detect Kubuntu images

This is done checking an Ubuntu image for the presence of
kubuntu-desktop package.

7 years agoMake DiskDevice.shrink() return the new disk size
Nikos Skalkotos [Tue, 28 Feb 2012 16:26:26 +0000 (18:26 +0200)]
Make DiskDevice.shrink() return the new disk size

7 years agoMajor code revision
Nikos Skalkotos [Fri, 24 Feb 2012 13:29:55 +0000 (15:29 +0200)]
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
* Add a shrink method in DiskDevice. This method shrinks the last
  filesystem to the minimum size
* Make the code style comply with pep8

7 years agoFix code for cleanup of image data
Nikos Skalkotos [Wed, 22 Feb 2012 16:22:17 +0000 (18:22 +0200)]
Fix code for cleanup of image data

7 years agoAdd OS specific classes
Nikos Skalkotos [Mon, 20 Feb 2012 17:59:43 +0000 (19:59 +0200)]
Add OS specific classes

7 years agoUse libguestfs to access the image
Nikos Skalkotos [Fri, 17 Feb 2012 18:30:36 +0000 (20:30 +0200)]
Use libguestfs to access the image

7 years agoFurther development
Nikos Skalkotos [Fri, 17 Feb 2012 09:41:32 +0000 (11:41 +0200)]
Further development

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

7 years agoInitial commit
Nikos Skalkotos [Wed, 15 Feb 2012 17:19:46 +0000 (19:19 +0200)]
Initial commit