mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 15:15:22 +00:00
wvmStorage.create_volume, wvmCreate.create_volume image naming respects image/volume format (qcow,qcow2)
This commit is contained in:
parent
1bd2c558f2
commit
a457c262e1
3 changed files with 12 additions and 2 deletions
|
@ -476,7 +476,11 @@ def instance(request, compute_id, vname):
|
||||||
|
|
||||||
path = connCreate.create_volume(storage, name, size, format, meta_prealloc, default_owner)
|
path = connCreate.create_volume(storage, name, size, format, meta_prealloc, default_owner)
|
||||||
conn.attach_disk(path, target, subdriver=format, cache=cache, targetbus=bus)
|
conn.attach_disk(path, target, subdriver=format, cache=cache, targetbus=bus)
|
||||||
|
<<<<<<< HEAD
|
||||||
msg = _('Attach new disk: ' + target)
|
msg = _('Attach new disk: ' + target)
|
||||||
|
=======
|
||||||
|
msg = _('Attach new disk {} ({})'.format(name, format))
|
||||||
|
>>>>>>> 13ce824... wvmStorage.create_volume, wvmCreate.create_volume image naming respects image/volume format (qcow,qcow2)
|
||||||
addlogmsg(request.user.username, instance.name, msg)
|
addlogmsg(request.user.username, instance.name, msg)
|
||||||
return HttpResponseRedirect(request.get_full_path() + '#disks')
|
return HttpResponseRedirect(request.get_full_path() + '#disks')
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,10 @@ class wvmCreate(wvmConnect):
|
||||||
stg = self.get_storage(storage)
|
stg = self.get_storage(storage)
|
||||||
storage_type = util.get_xml_path(stg.XMLDesc(0), "/pool/@type")
|
storage_type = util.get_xml_path(stg.XMLDesc(0), "/pool/@type")
|
||||||
if storage_type == 'dir':
|
if storage_type == 'dir':
|
||||||
name += '.img'
|
if image_format in ('qcow', 'qcow2'):
|
||||||
|
name += '.' + image_format
|
||||||
|
else:
|
||||||
|
name += '.img'
|
||||||
alloc = 0
|
alloc = 0
|
||||||
else:
|
else:
|
||||||
alloc = size
|
alloc = size
|
||||||
|
|
|
@ -213,7 +213,10 @@ class wvmStorage(wvmConnect):
|
||||||
if vol_fmt == 'unknown':
|
if vol_fmt == 'unknown':
|
||||||
vol_fmt = 'raw'
|
vol_fmt = 'raw'
|
||||||
if storage_type == 'dir':
|
if storage_type == 'dir':
|
||||||
name += '.img'
|
if vol_fmt in ('qcow', 'qcow2'):
|
||||||
|
name += '.' + vol_fmt
|
||||||
|
else:
|
||||||
|
name += '.img'
|
||||||
alloc = 0
|
alloc = 0
|
||||||
xml = """
|
xml = """
|
||||||
<volume>
|
<volume>
|
||||||
|
|
Loading…
Reference in a new issue