File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,15 +234,17 @@ def showvminfo():
234234 response = im .get_vm_info (infid , vmid , auth_data )
235235 except Exception as ex :
236236 flash ("Error: %s." % ex , 'error' )
237+ return redirect (url_for ('showinfrastructures' ))
237238
238- vminfo = {}
239- state = ""
240- nets = ""
241- disks = ""
242- deployment = ""
243239 if not response .ok :
244240 flash ("Error retrieving VM info: \n " + response .text , 'error' )
241+ return redirect (url_for ('showinfrastructures' ))
245242 else :
243+ vminfo = {}
244+ state = ""
245+ nets = ""
246+ disks = ""
247+ deployment = ""
246248 app .logger .debug ("VM Info: %s" % response .text )
247249 radl_json = response .json ()["radl" ]
248250 outports = utils .get_out_ports (radl_json )
@@ -308,6 +310,14 @@ def showvminfo():
308310
309311 cont += 1
310312
313+ # delete disk info of disks without size
314+ for prop_name in ["device" , "fstype" , "mount_path" ]:
315+ new_cont = cont
316+ prop = "disk.%s.%s" % (new_cont , prop_name )
317+ while prop in vminfo :
318+ del vminfo [prop ]
319+ new_cont += 1
320+
311321 str_outports = ""
312322 if outports :
313323 for port in outports :
You can’t perform that action at this time.
0 commit comments