From 497fadb39dc2bf6f81685f1ea06110514c201a35 Mon Sep 17 00:00:00 2001
From: Nikos Skalkotos <skalkoto@grnet.gr>
Date: Mon, 8 Jul 2013 13:32:52 +0300
Subject: [PATCH] Fix a bug in the sysprep help printing

The system preparation tasks could be printed multiple times in the
help dialog.
---
 image_creator/dialog_menu.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/image_creator/dialog_menu.py b/image_creator/dialog_menu.py
index ca9b323..11045c1 100644
--- a/image_creator/dialog_menu.py
+++ b/image_creator/dialog_menu.py
@@ -632,9 +632,6 @@ def sysprep(session):
 
     wrapper = textwrap.TextWrapper(width=WIDTH - 5)
 
-    help_title = "System Preperation Tasks"
-    sysprep_help = "%s\n%s\n\n" % (help_title, '=' * len(help_title))
-
     syspreps = image.os.list_syspreps()
 
     if len(syspreps) == 0:
@@ -645,6 +642,10 @@ def sysprep(session):
     while 1:
         choices = []
         index = 0
+
+        help_title = "System Preperation Tasks"
+        sysprep_help = "%s\n%s\n\n" % (help_title, '=' * len(help_title))
+
         for sysprep in syspreps:
             name, descr = image.os.sysprep_info(sysprep)
             display_name = name.replace('-', ' ').capitalize()
-- 
GitLab