From 249d2597a5b29aa0ef60296b024ba9e3629b97f1 Mon Sep 17 00:00:00 2001
From: Nikos Skalkotos <skalkoto@grnet.gr>
Date: Fri, 20 Feb 2015 16:57:28 +0200
Subject: [PATCH] Fix a bug in the "Exclude" menu entry

Check if the deployment task list is empty. If this is the case, a
message should be printed to the user. If we try to initialize the
dialog menu with an empty choices list, the program will crash.
---
 image_creator/dialog_menu.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/image_creator/dialog_menu.py b/image_creator/dialog_menu.py
index 4f079d6..dbf454b 100644
--- a/image_creator/dialog_menu.py
+++ b/image_creator/dialog_menu.py
@@ -647,6 +647,10 @@ def exclude_tasks(session):
             displayed_index += 1
         index += 1
 
+    if len(choices) == 0:
+        d.msgbox("No configuration tasks available", width=WIDTH)
+        return True
+
     while 1:
         text = "Please choose which configuration tasks you would like to " \
                "prevent from running during image deployment. " \
-- 
GitLab