1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +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,17 +525,18 @@
<div role="tabpanel"> <div role="tabpanel">
<!-- Nav tabs --> <!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist"> <ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"> {% if request.user.is_superuser %}
<a href="#boot_opt" aria-controls="boot" role="tab" data-toggle="tab"> <li role="presentation" class="active">
{% trans "Boot" %} <a href="#boot_opt" aria-controls="boot" role="tab" data-toggle="tab">
</a> {% trans "Boot" %}
</li> </a>
<li role="presentation"> </li>
<a href="#disks" aria-controls="disks" role="tab" data-toggle="tab"> <li role="presentation">
{% trans "Disk" %} <a href="#disks" aria-controls="disks" role="tab" data-toggle="tab">
</a> {% trans "Disk" %}
</li> </a>
</li>
{% endif %}
{% if request.user.is_superuser or userinstance.is_vnc %} {% if request.user.is_superuser or userinstance.is_vnc %}
<li role="presentation"> <li role="presentation">
<a href="#vncsettings" aria-controls="vncsettings" role="tab" data-toggle="tab"> <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) 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)
msg = _('Attach new disk: ' + target) msg = _('Attach new disk {} ({})'.format(name, format))
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')

View file

@ -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

View file

@ -871,18 +871,19 @@ class wvmInstance(wvmConnect):
<allocation>0</allocation> <allocation>0</allocation>
<target> <target>
<format type='%s'/> <format type='%s'/>
<permissions>
<owner>%s</owner>
<group>%s</group>
<mode>0644</mode>
<label>virt_image_t</label>
</permissions>
<compat>1.1</compat>
<features>
<lazy_refcounts/>
</features>
</target> </target>
<permissions>
<owner>%s</owner>
<group>%s</group>
<mode>0644</mode>
<label>virt_image_t</label>
</permissions>
<compat>1.1</compat>
<features>
<lazy_refcounts/>
</features>
</volume>""" % (target_file, vol_format, owner['uid'], owner['guid']) </volume>""" % (target_file, vol_format, owner['uid'], owner['guid'])
stg = vol.storagePoolLookupByVolume() stg = vol.storagePoolLookupByVolume()
stg.createXMLFrom(vol_clone_xml, vol, meta_prealloc) stg.createXMLFrom(vol_clone_xml, vol, meta_prealloc)

View file

@ -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>