Fix a bug in the sysprep help printing
authorNikos Skalkotos <skalkoto@grnet.gr>
Mon, 8 Jul 2013 10:32:52 +0000 (13:32 +0300)
committerNikos Skalkotos <skalkoto@grnet.gr>
Mon, 8 Jul 2013 10:32:52 +0000 (13:32 +0300)
The system preparation tasks could be printed multiple times in the
help dialog.

image_creator/dialog_menu.py

index ca9b323..11045c1 100644 (file)
@@ -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()