diff --git a/ChangeLog b/ChangeLog index caadac5529d9bde887b7a7208519b51c80c2726a..8739be1d73434e0e61a6b80f5696727cd68b4892 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-10-09, v0.5.3 + * Fix a bug in snf-mkimage expert mode were the program could crash if + the image did not have any image properties + 2013-09-09, v0.5.2 * Fix some errors in the ci scripts diff --git a/docs/conf.py b/docs/conf.py index 626a201cbad3e836deaa5ff1d83bb9ea6de6f937..5521dad44030936861b161410e2781ca4d2bd84a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -50,9 +50,9 @@ copyright = u'2012, 2013 GRNET S.A. All rights reserved' # built documents. # # The short X.Y version. -version = '0.5.2' +version = '0.5.3' # The full version, including alpha/beta/rc tags. -release = '0.5.2' +release = '0.5.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/usage.rst b/docs/usage.rst index 5dd73d46c7aa912226a5ddb8ad9ae45c860bc7e2..fc991728c2e3a49acb65c4ece6032898fcba4017 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -239,8 +239,8 @@ for more information). Creating a new image ==================== -Suppose you want to create a new Ubuntu server image. Download the installation -disk from the Internet: +Suppose your host system is a Debian Wheezy and you want to create a new Ubuntu +server image. Download the installation disk from the Internet: .. code-block:: console @@ -272,7 +272,9 @@ And install the Ubuntu system on this file: use LVM partitions. They are not supported by snf-image-creator. You will be able to boot your installed OS and make any changes you want -(e.g. install openssh-server) using the following command:: +(e.g. install openssh-server) using the following command: + +.. code-block:: console $ sudo kvm -m 1G -boot c -drive file=ubuntu.raw,format=raw,cache=none,if=virtio diff --git a/image_creator/dialog_menu.py b/image_creator/dialog_menu.py index 351f0b9687c17960064fc13b8f66a14225ead735..25fcb6c3089e99048bd4071f6d99d65bf235743e 100644 --- a/image_creator/dialog_menu.py +++ b/image_creator/dialog_menu.py @@ -488,6 +488,15 @@ def add_property(session): return True +def show_properties_help(session): + """Show help for image properties""" + d = session['dialog'] + + help_file = get_help_file("image_properties") + assert os.path.exists(help_file) + d.textbox(help_file, title="Image Properties", width=70, height=40) + + def modify_properties(session): """Modify an existing image property""" d = session['dialog'] @@ -497,6 +506,19 @@ def modify_properties(session): for (key, val) in session['metadata'].items(): choices.append((str(key), str(val))) + if len(choices) == 0: + code = d.yesno( + "No image properties are available. " + "Would you like to add a new one?", width=WIDTH, help_button=1) + if code == d.DIALOG_OK: + if not add_property(session): + return True + elif code == d.DIALOG_CANCEL: + return True + elif code == d.DIALOG_HELP: + show_properties_help(session) + continue + (code, choice) = d.menu( "In this menu you can edit existing image properties or add new " "ones. Be careful! Most properties have special meaning and " @@ -526,9 +548,7 @@ def modify_properties(session): elif code == d.DIALOG_EXTRA: add_property(session) elif code == 'help': - help_file = get_help_file("image_properties") - assert os.path.exists(help_file) - d.textbox(help_file, title="Image Properties", width=70, height=40) + show_properties_help(session) def delete_properties(session): @@ -539,6 +559,11 @@ def delete_properties(session): for (key, val) in session['metadata'].items(): choices.append((key, "%s" % val, 0)) + if len(choices) == 0: + d.msgbox("No available images properties to delete!", + width=SMALL_WIDTH) + return True + (code, to_delete) = d.checklist("Choose which properties to delete:", choices=choices, width=WIDTH) to_delete = map(lambda x: x.strip('"'), to_delete) # needed for OpenSUSE diff --git a/image_creator/version.py b/image_creator/version.py index f9e59b84d3fa7b93945c3c4a1dc30af73c445057..351ff305c1fc972910ab67cd16d58d05d142be0f 100644 --- a/image_creator/version.py +++ b/image_creator/version.py @@ -1,8 +1,8 @@ -__version__ = "0.5.2" +__version__ = "0.5.3" __version_vcs_info__ = { - 'branch': 'hotfix-0.5.2', - 'revid': '97a59b7', - 'revno': 397} + 'branch': 'hotfix-0.5.3', + 'revid': 'dc0ecb2', + 'revno': 402} __version_user_email__ = "skalkoto@grnet.gr" __version_user_name__ = "Nikos Skalkotos" diff --git a/version b/version index cb0c939a936f142669d38cf1ece330266d730965..be14282b7fffb9ba95d51c6546ed9816dc8f3ff8 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.5.2 +0.5.3