diff --git a/ChangeLog b/ChangeLog index 67b0dc2961cc0242afedf339af69d3352427e35d..8739be1d73434e0e61a6b80f5696727cd68b4892 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +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 + 2013-08-23, v0.5.1 * Allow more characters in the cloud name * Fix various bugs diff --git a/ci/autopkg_debian.sh b/ci/autopkg_debian.sh index 8a46c1401e0c289ef036a5efb15f20884dd566a7..70eecdd5a4efab52848bf1de664f3d2b9fcf4305 100755 --- a/ci/autopkg_debian.sh +++ b/ci/autopkg_debian.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh set -e PACKAGES_DIR=$1 diff --git a/ci/pylint.sh b/ci/pylint.sh index a200be125452fb975ae4ad9576a31d295d43e896..fa4dae5c371e85e640d3294073e00690daca160b 100755 --- a/ci/pylint.sh +++ b/ci/pylint.sh @@ -1,3 +1,3 @@ -!/bin/sh +#!/bin/sh pylint image_creator diff --git a/docs/conf.py b/docs/conf.py index 8392d22492670dd9d22b8030830ef5af5618abd6..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.1' +version = '0.5.3' # The full version, including alpha/beta/rc tags. -release = '0.5.1' +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 59db0cb90748764ad97a7b99440c947213b47288..351ff305c1fc972910ab67cd16d58d05d142be0f 100644 --- a/image_creator/version.py +++ b/image_creator/version.py @@ -1,7 +1,8 @@ -__version__ = "0.5.1" -__version_info__ = ['0', '5', '1'] + +__version__ = "0.5.3" __version_vcs_info__ = { - 'branch': 'hotfix-0.5.1', - 'revid': 'b25b422', - 'revno': 393} -__version_user_info__ = "skalkoto@darkstar.admin.grnet.gr" + '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 4b9fcbec101a6ff8ec68e0f95131ccda4861407f..be14282b7fffb9ba95d51c6546ed9816dc8f3ff8 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.5.1 +0.5.3