Revision 0969420b image_creator/dialog_menu.py

b/image_creator/dialog_menu.py
68 68
    ("File injection", ["EnforcePersonality"], ["windows", "linux"])
69 69
]
70 70

  
71
SYSPREP_PARAM_MAXLEN = 20
71 72

  
72 73
class MetadataMonitor(object):
73 74
    """Monitors image metadata chages"""
......
395 396
                if len(Kamaki.get_clouds()):
396 397
                    default_item = "Cloud"
397 398
                else:
398
                    default_time = "Add/Edit"
399
                    default_item = "Add/Edit"
399 400
            else:
400
                default_time = "Delete"
401
                default_item = "Delete"
401 402
        elif choice == "Cloud":
402 403
            default_item = "Cloud"
403 404
            clouds = Kamaki.get_clouds()
......
616 617

  
617 618

  
618 619
def sysprep_params(session):
619

  
620
    """Collect the needed sysprep parameters"""
620 621
    d = session['dialog']
621 622
    image = session['image']
622 623

  
......
631 632
    for name in names:
632 633
        param = needed[name]
633 634
        default = available[name] if name in available else ""
634
        fields.append(("%s: " % param.description, default, param.maxlen))
635
        fields.append(("%s: " % param.description, default,
636
                       SYSPREP_PARAM_MAXLEN))
635 637

  
636 638
    txt = "Please provide the following system preparation parameters:"
637 639
    code, output = d.form(txt, height=13, width=WIDTH, form_height=len(fields),
......
640 642
    if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
641 643
        return False
642 644

  
643
    sysprep_params = {}
644 645
    for i in range(len(fields)):
645 646
        param = needed[names[i]]
646 647
        if param.validator(output[i]):
647 648
            image.os.sysprep_params[names[i]] = output[i]
648 649
        else:
649 650
            d.msgbox("The value you provided for parameter: %s is not valid" %
650
                     name, width=SMALL_WIDTH)
651
                     names[i], width=SMALL_WIDTH)
651 652
            return False
652 653

  
653 654
    return True

Also available in: Unified diff