snf-image-creator
11 years agoMake the dialog wizard workable
Nikos Skalkotos [Wed, 8 Aug 2012 08:43:20 +0000 (11:43 +0300)]
Make the dialog wizard workable

A user can now create and upload an image using the wizard

11 years agoRemove an unused import in main.py
Nikos Skalkotos [Wed, 8 Aug 2012 08:22:37 +0000 (11:22 +0300)]
Remove an unused import in main.py

11 years agoAdd all wizard dialog boxes.
Nikos Skalkotos [Tue, 31 Jul 2012 15:01:58 +0000 (18:01 +0300)]
Add all wizard dialog boxes.

The system does not perform anything yet when in wizard mode.

11 years agoChange kamaki account & token retrieval interface
Nikos Skalkotos [Fri, 27 Jul 2012 17:17:02 +0000 (20:17 +0300)]
Change kamaki account & token retrieval interface

11 years agoMove wizard code out of dialog_main.py
Nikos Skalkotos [Thu, 26 Jul 2012 16:00:40 +0000 (19:00 +0300)]
Move wizard code out of dialog_main.py

Create the new python module to host the aforementioned code.

11 years agoRead ~okeanos account/token from kamaki
Nikos Skalkotos [Thu, 26 Jul 2012 15:52:01 +0000 (18:52 +0300)]
Read ~okeanos account/token from kamaki

If present in the kamaki configuration file, the user will read
the ~okeanos credentials using the kamaki config interface.
Whenever the user changes the ~okeanos credentians, the changes are
pushed back to kamaki.

11 years agoAdd new wizard mode in snf-image-creator-dialog
Nikos Skalkotos [Tue, 24 Jul 2012 14:12:36 +0000 (17:12 +0300)]
Add new wizard mode in snf-image-creator-dialog

Not fully implemented yet

11 years agoFix minor typos
Nikos Skalkotos [Thu, 28 Jun 2012 10:50:33 +0000 (13:50 +0300)]
Fix minor typos

11 years agoFix pep8 errors
Nikos Skalkotos [Wed, 27 Jun 2012 22:20:19 +0000 (01:20 +0300)]
Fix pep8 errors

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

11 years agoPopulate image properties with task_metadata
Nikos Skalkotos [Wed, 27 Jun 2012 15:03:06 +0000 (18:03 +0300)]
Populate image properties with task_metadata

Before extracting an image or registring it with cyclades, the image
properties are populated with metadata concerning excluded deployment
tasks.

11 years agoLeave 2048 sectors space at the end when shrinking
Nikos Skalkotos [Wed, 27 Jun 2012 14:42:17 +0000 (17:42 +0300)]
Leave 2048 sectors space at the end when shrinking

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

11 years agoFix a bug in _get_passworded_users method in Unix
Nikos Skalkotos [Wed, 27 Jun 2012 09:59:18 +0000 (12:59 +0300)]
Fix a bug in _get_passworded_users method in Unix

The method used a wrong warning output function

11 years agoAdd image properties help file
Nikos Skalkotos [Tue, 26 Jun 2012 13:42:04 +0000 (16:42 +0300)]
Add image properties help file

11 years agoFix error message for non supported media source
Nikos Skalkotos [Tue, 26 Jun 2012 13:35:37 +0000 (16:35 +0300)]
Fix error message for non supported media source

11 years agoFix pep8 errors
Nikos Skalkotos [Mon, 25 Jun 2012 21:29:11 +0000 (00:29 +0300)]
Fix pep8 errors

11 years agoFix minor typos in dialog_main.py
Nikos Skalkotos [Mon, 25 Jun 2012 13:21:39 +0000 (16:21 +0300)]
Fix minor typos in dialog_main.py

11 years agoFix a warning message in linux fix_acpid sysprep
Nikos Skalkotos [Mon, 25 Jun 2012 13:04:07 +0000 (16:04 +0300)]
Fix a warning message in linux fix_acpid sysprep

11 years agoUse vfs_uuid instead of blkid to compute uuid
Nikos Skalkotos [Mon, 25 Jun 2012 11:39:09 +0000 (14:39 +0300)]
Use vfs_uuid instead of blkid to compute uuid

vfs_uuid is more suitable for this and it whas added before blkid
in guestfs, hence it is supported in more guestfs versions.

11 years agoMonitor metadata changes during shrink and sysprep
Nikos Skalkotos [Mon, 25 Jun 2012 09:57:19 +0000 (12:57 +0300)]
Monitor metadata changes during shrink and sysprep

Inform the user about metadata changes performed during syspreps
execution or image shrinking.

11 years agoPopulate Shrink menu entry
Nikos Skalkotos [Fri, 22 Jun 2012 15:51:59 +0000 (18:51 +0300)]
Populate Shrink menu entry

Also fix various issues. snf-image-creator-dialog is almost ready.
Some `Help' entries are missing.

11 years agoPopulate Sysprep menu entry
Nikos Skalkotos [Thu, 21 Jun 2012 16:20:05 +0000 (19:20 +0300)]
Populate Sysprep menu entry

Also create a new output class (InfoBoxOutput) to be used when
performing syspreps

11 years agoAdd get_sysprep_by_name method in os_type classes
Nikos Skalkotos [Thu, 21 Jun 2012 15:10:22 +0000 (18:10 +0300)]
Add get_sysprep_by_name method in os_type classes

This method returns a sysprep object with a given name. Now,
(enable,disable)_sysprep work with sysprep objects instead of sysprep
names

11 years agoFix a bug introduced in 2e50092b2437913561a37c646e
Nikos Skalkotos [Wed, 20 Jun 2012 23:13:59 +0000 (02:13 +0300)]
Fix a bug introduced in 2e50092b2437913561a37c646e

The do_sysprep method was not updated to comply with the changes
made in list_syspreps method

11 years agoMerge Deploy and Customize menu entries
Nikos Skalkotos [Wed, 20 Jun 2012 16:10:26 +0000 (19:10 +0300)]
Merge Deploy and Customize menu entries

Populate Sysprep entry in "Image Customization Menu". Not fully
working.

11 years agoIn linux.py make sysprep names for descriptive
Nikos Skalkotos [Wed, 20 Jun 2012 15:30:55 +0000 (18:30 +0300)]
In linux.py make sysprep names for descriptive

11 years agoAdd sysprep_info method in os_type classes
Nikos Skalkotos [Wed, 20 Jun 2012 13:28:52 +0000 (16:28 +0300)]
Add sysprep_info method in os_type classes

This method takes a sysprep object as argument and returns the name
and a description for this object.

11 years agoMake os_type list_sysprep method return 1 list
Nikos Skalkotos [Wed, 20 Jun 2012 12:17:01 +0000 (15:17 +0300)]
Make os_type list_sysprep method return 1 list

The method used to return 2 lists of enabled and disabled sysprep
object. Since sysprep objs contail an `enabled' attribute, it is easy
to determine which of those are enabled and which are not. There is
no need to return 2 seperate lists.

11 years agoAdd help subpackage
Nikos Skalkotos [Tue, 19 Jun 2012 14:54:51 +0000 (17:54 +0300)]
Add help subpackage

This dir will host help files used by snf-image-create-dialog

11 years agoPopulate `Deploy' dialog menu entry
Nikos Skalkotos [Mon, 18 Jun 2012 14:30:58 +0000 (17:30 +0300)]
Populate `Deploy' dialog menu entry

Image properties manipulation works fine.

11 years agoFurther development on snf-image-creator-dialog
Nikos Skalkotos [Fri, 15 Jun 2012 16:26:32 +0000 (19:26 +0300)]
Further development on snf-image-creator-dialog

Extract and Register menu entries work fine.

11 years agoIn kamaki.register convert all metadata to strings
Nikos Skalkotos [Fri, 15 Jun 2012 13:46:59 +0000 (16:46 +0300)]
In kamaki.register convert all metadata to strings

Otherwise the registration may fail.

11 years agoOpen snapshot in binary mode before uploading
Nikos Skalkotos [Fri, 15 Jun 2012 09:03:50 +0000 (12:03 +0300)]
Open snapshot in binary mode before uploading

11 years agoIn some circumstances mount the image readonly
Nikos Skalkotos [Fri, 15 Jun 2012 08:55:35 +0000 (11:55 +0300)]
In some circumstances mount the image readonly

If no customization is to be applied the image should be mounted
readonly.

11 years agoDon't handle kamaki exceptions in kamaki_wrapper
Nikos Skalkotos [Fri, 15 Jun 2012 08:32:20 +0000 (11:32 +0300)]
Don't handle kamaki exceptions in kamaki_wrapper

Let the application decide what to do with them. If image-creator
receives an error from kamaki it will terminate. But this may not be
the proper thing to do for an interactive application like
image-creator-dialog

11 years agoInitial commit for snf-image-creator-dialog
Nikos Skalkotos [Thu, 14 Jun 2012 15:19:39 +0000 (18:19 +0300)]
Initial commit for snf-image-creator-dialog

snf-image-creator-dialog is a dialog based version of snf-image-creator
Nothing works yet

11 years agoAllow readonly mount in DiskDevice class
Nikos Skalkotos [Thu, 14 Jun 2012 14:46:00 +0000 (17:46 +0300)]
Allow readonly mount in DiskDevice class

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

11 years agoAdd Output module for dialog-based output
Nikos Skalkotos [Thu, 14 Jun 2012 10:33:33 +0000 (13:33 +0300)]
Add Output module for dialog-based output

11 years agoFix a bug introduced in 4e58b51b
Nikos Skalkotos [Thu, 14 Jun 2012 08:37:20 +0000 (11:37 +0300)]
Fix a bug introduced in 4e58b51b

The error function main.py used for outputing errors has been removed
and the code was not updated to use the error method of SimpleOutput
output class.
Also did a minor cleanup: git_os_class function was renamed to os_cls

11 years agoSave bar_type parameter in Output base class
Nikos Skalkotos [Thu, 14 Jun 2012 08:32:21 +0000 (11:32 +0300)]
Save bar_type parameter in Output base class

11 years agoAdd cleanup method in output class
Nikos Skalkotos [Tue, 12 Jun 2012 14:53:30 +0000 (17:53 +0300)]
Add cleanup method in output class

11 years agoCreate a new output subpackage
Nikos Skalkotos [Mon, 11 Jun 2012 15:28:18 +0000 (18:28 +0300)]
Create a new output subpackage

11 years agoPrint an extra space when new_line=False
Nikos Skalkotos [Mon, 11 Jun 2012 09:12:11 +0000 (12:12 +0300)]
Print an extra space when new_line=False

11 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

11 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.

11 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

11 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

11 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

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

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

11 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

11 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

11 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

11 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

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

11 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

11 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

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

11 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

11 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

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

Also rearrange input options

12 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

12 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

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

12 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

12 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

12 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

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

12 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.

12 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

12 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.

12 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.

12 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

12 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

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

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

12 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

12 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.

12 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.

12 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

12 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

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

12 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

12 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

12 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.

12 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.

12 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.

12 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

12 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

12 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

12 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.

12 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.

12 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

12 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.