mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +00:00
Fix: for clone instance multiple disk name generating fixed
This commit is contained in:
parent
5d1df70d41
commit
fffbc92151
2 changed files with 16 additions and 14 deletions
|
@ -1404,7 +1404,9 @@
|
||||||
if (disk_name.startsWith(vname)) {
|
if (disk_name.startsWith(vname)) {
|
||||||
image = disk_name.replace(vname, new_vname);
|
image = disk_name.replace(vname, new_vname);
|
||||||
} else if (disk_name.lastIndexOf('.') > -1 && disk_dot_suffix.length <= 7) {
|
} else if (disk_name.lastIndexOf('.') > -1 && disk_dot_suffix.length <= 7) {
|
||||||
image = new_vname + "." + disk_dot_suffix
|
disk_dot.pop();
|
||||||
|
disk_name_only = disk_dot.join('-')
|
||||||
|
image = new_vname + "-" + disk_name_only + "." + disk_dot_suffix
|
||||||
} else if (new_vname != disk_name) {
|
} else if (new_vname != disk_name) {
|
||||||
image = new_vname
|
image = new_vname
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -774,7 +774,7 @@ def instance(request, compute_id, vname):
|
||||||
|
|
||||||
if request.user.is_superuser or request.user.userattributes.can_clone_instances:
|
if request.user.is_superuser or request.user.userattributes.can_clone_instances:
|
||||||
if 'clone' in request.POST:
|
if 'clone' in request.POST:
|
||||||
clone_data = dict
|
clone_data = dict()
|
||||||
clone_data['name'] = request.POST.get('name', '')
|
clone_data['name'] = request.POST.get('name', '')
|
||||||
|
|
||||||
disk_sum = sum([disk['size'] >> 30 for disk in disks])
|
disk_sum = sum([disk['size'] >> 30 for disk in disks])
|
||||||
|
|
Loading…
Reference in a new issue