Fix dialog checklists in OpenSUSE
authorNikos Skalkotos <skalkoto@grnet.gr>
Wed, 17 Jul 2013 11:30:26 +0000 (14:30 +0300)
committerNikos Skalkotos <skalkoto@grnet.gr>
Wed, 17 Jul 2013 11:30:26 +0000 (14:30 +0300)
python-dialog package in OpenSUSE decorated the returned enabled
choices from a dialog checklist with `"'. Remove those characters

image_creator/dialog_menu.py

index fd7bc4b..11dc1a7 100644 (file)
@@ -326,6 +326,7 @@ def delete_clouds(session):
 
     (code, to_delete) = d.checklist("Choose which cloud accounts to delete:",
                                     choices=choices, width=WIDTH)
+    to_delete = map(lambda x: x.strip('"'), to_delete)  # Needed for OpenSUSE
 
     if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
         return False
@@ -537,6 +538,7 @@ def delete_properties(session):
 
     (code, to_delete) = d.checklist("Choose which properties to delete:",
                                     choices=choices, width=WIDTH)
+    to_delete = map(lambda x: x.strip('"'), to_delete)  # needed for OpenSUSE
 
     # If the user exits with ESC or CANCEL, the returned tag list is empty.
     for i in to_delete:
@@ -586,6 +588,7 @@ def exclude_tasks(session):
             choices=choices, height=19, list_height=8, width=WIDTH,
             help_button=1, extra_button=1, extra_label="No Config",
             title="Exclude Configuration Tasks")
+        tags = map(lambda x: x.strip('"'), tags)  # Needed for OpenSUSE
 
         if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
             return False
@@ -659,6 +662,7 @@ def sysprep(session):
             "run on the image. Press <Help> to see details about the system "
             "preparation tasks.", title="Run system preparation tasks",
             choices=choices, width=70, ok_label="Run", help_button=1)
+        tags = map(lambda x: x.strip('"'), tags)  # Needed for OpenSUSE
 
         if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
             return False