X-Git-Url: https://code.grnet.gr/git/snf-image-creator/blobdiff_plain/e482b7f92115aab233908712e4a98204ae9de1c0..37d1ea11cc79b7e45db9049df745abd3f147e031:/image_creator/dialog_menu.py diff --git a/image_creator/dialog_menu.py b/image_creator/dialog_menu.py index ba29ea1..4f24b1e 100644 --- a/image_creator/dialog_menu.py +++ b/image_creator/dialog_menu.py @@ -217,13 +217,26 @@ def register_image(session): "register it", width=SMALL_WIDTH) return False + name = "" + description = session['metadata']['DESCRIPTION'] if 'DESCRIPTION' in \ + session['metadata'] else "" + while 1: - (code, answer) = d.inputbox("Please provide a registration name:", - width=WIDTH) + fields = [ + ("Registration name:", name, 60), + ("Description (optional):", description, 80)] + + (code, output) = d.form( + "Please provide the following registration info:", height=11, + width=WIDTH, form_height=2, fields=fields) + if code in (d.DIALOG_CANCEL, d.DIALOG_ESC): return False - name = answer.strip() + name, description = output + name = name.strip() + description = description.strip() + if len(name) == 0: d.msgbox("Registration name cannot be empty", width=SMALL_WIDTH) continue @@ -238,6 +251,7 @@ def register_image(session): break + session['metadata']['DESCRIPTION'] = description metadata = {} metadata.update(session['metadata']) if 'task_metadata' in session: @@ -585,9 +599,9 @@ def exclude_tasks(session): d = session['dialog'] image = session['image'] - if hasattr(image, "unsupported"): - d.msgbox("You cannot configure the deployment tasks for an unsupported" - " image.", width=SMALL_WIDTH) + if image.is_unsupported(): + d.msgbox("Image deployment configuration is disabled for unsupported " + "images.", width=SMALL_WIDTH) return False index = 0