def hdd_info(uuid):
try:
info = {}
for line in VBoxManage('showhdinfo', uuid, _iter=True):
if not line.strip():
continue
key, val = line.strip().split(':')
val = val.strip()
info[key] = val
return info
except ErrorReturnCode_1 as e:
# if the VM was not found
if 'VBOX_E_OBJECT_NOT_FOUND' in e.stderr:
raise HDDNotFound(uuid)
# something else happened, just let it go
raise
评论列表
文章目录