Remove the image size from the image metadata
[snf-image-creator] / image_creator / dialog_main.py
index 1bc0ec5..3082a1c 100644 (file)
@@ -146,7 +146,7 @@ def update_background_title(session):
 
     MB = 2 ** 20
 
-    size = (dev.meta['SIZE'] + MB - 1) // MB
+    size = (dev.size + MB - 1) // MB
     shrinked = 'shrinked' in session and session['shrinked']
     postfix = " (shrinked)" if shrinked else ''
 
@@ -205,7 +205,7 @@ def extract_image(session):
         try:
             dev = session['device']
             if "checksum" not in session:
-                size = dev.meta['SIZE']
+                size = dev.size
                 md5 = MD5(out)
                 session['checksum'] = md5.compute(session['snapshot'], size)
 
@@ -237,7 +237,7 @@ def extract_image(session):
 
 def upload_image(session):
     d = session["dialog"]
-    size = session['device'].meta['SIZE']
+    size = session['device'].size
 
     if "account" not in session:
         d.msgbox("You need to provide your ~okeanos login username before you "
@@ -868,8 +868,10 @@ def image_creator(d):
               "image creation process?\n\nChoose <Yes> to run the wizard, " \
               "<No> to run the snf-image-creator in expert mode or press " \
               "ESC to quit the program." \
-              % (dev.ostype if dev.ostype == dev.distro else "%s/%s" %
-                 (dev.distro, dev.ostype))
+              % (dev.ostype if dev.ostype == dev.distro else "%s (%s)" %
+                 (dev.ostype, dev.distro))
+
+        update_background_title(session)
 
         while True:
             code = d.yesno(msg, width=YESNO_WIDTH, height=12)