1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 15:15:22 +00:00

Merge pull request #234 from catborise/master

fix
This commit is contained in:
Anatoliy Guskov 2019-04-09 09:48:44 +03:00 committed by GitHub
commit b3928d5026
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 24 deletions

View file

@ -525,6 +525,7 @@
<div role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
{% if request.user.is_superuser %}
<li role="presentation" class="active">
<a href="#boot_opt" aria-controls="boot" role="tab" data-toggle="tab">
{% trans "Boot" %}
@ -535,7 +536,7 @@
{% trans "Disk" %}
</a>
</li>
{% endif %}
{% if request.user.is_superuser or userinstance.is_vnc %}
<li role="presentation">
<a href="#vncsettings" aria-controls="vncsettings" role="tab" data-toggle="tab">

View file

@ -476,7 +476,7 @@ def instance(request, compute_id, vname):
path = connCreate.create_volume(storage, name, size, format, meta_prealloc, default_owner)
conn.attach_disk(path, target, subdriver=format, cache=cache, targetbus=bus)
msg = _('Attach new disk: ' + target)
msg = _('Attach new disk {} ({})'.format(name, format))
addlogmsg(request.user.username, instance.name, msg)
return HttpResponseRedirect(request.get_full_path() + '#disks')

View file

@ -58,6 +58,9 @@ class wvmCreate(wvmConnect):
stg = self.get_storage(storage)
storage_type = util.get_xml_path(stg.XMLDesc(0), "/pool/@type")
if storage_type == 'dir':
if image_format in ('qcow', 'qcow2'):
name += '.' + image_format
else:
name += '.img'
alloc = 0
else:

View file

@ -871,7 +871,6 @@ class wvmInstance(wvmConnect):
<allocation>0</allocation>
<target>
<format type='%s'/>
</target>
<permissions>
<owner>%s</owner>
<group>%s</group>
@ -882,7 +881,9 @@ class wvmInstance(wvmConnect):
<features>
<lazy_refcounts/>
</features>
</target>
</volume>""" % (target_file, vol_format, owner['uid'], owner['guid'])
stg = vol.storagePoolLookupByVolume()
stg.createXMLFrom(vol_clone_xml, vol, meta_prealloc)

View file

@ -213,6 +213,9 @@ class wvmStorage(wvmConnect):
if vol_fmt == 'unknown':
vol_fmt = 'raw'
if storage_type == 'dir':
if vol_fmt in ('qcow', 'qcow2'):
name += '.' + vol_fmt
else:
name += '.img'
alloc = 0
xml = """