Revision 47505e53 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"""
......
397 398
                if len(Kamaki.get_clouds()):
398 399
                    default_item = "Cloud"
399 400
                else:
400
                    default_time = "Add/Edit"
401
                    default_item = "Add/Edit"
401 402
            else:
402
                default_time = "Delete"
403
                default_item = "Delete"
403 404
        elif choice == "Cloud":
404 405
            default_item = "Cloud"
405 406
            clouds = Kamaki.get_clouds()
......
620 621

  
621 622

  
622 623
def sysprep_params(session):
623

  
624
    """Collect the needed sysprep parameters"""
624 625
    d = session['dialog']
625 626
    image = session['image']
626 627

  
......
635 636
    for name in names:
636 637
        param = needed[name]
637 638
        default = available[name] if name in available else ""
638
        fields.append(("%s: " % param.description, default, param.maxlen))
639
        fields.append(("%s: " % param.description, default,
640
                       SYSPREP_PARAM_MAXLEN))
639 641

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

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

  
657 658
    return True

Also available in: Unified diff