Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
956c4a08
authored
Apr 16, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
instance: removed InstanceTemplate clone method
parent
92fa13aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
33 deletions
+0
-33
circle/vm/models/instance.py
+0
-33
No files found.
circle/vm/models/instance.py
View file @
956c4a08
...
...
@@ -161,39 +161,6 @@ class InstanceTemplate(AclBase, VirtualMachineDescModel, TimeStampedModel):
if
is_new
:
self
.
set_level
(
self
.
owner
,
'owner'
)
def
clone
(
self
,
user
=
None
,
**
kwargs
):
"""Cloning a Template to a new Template.
It returns the new Template object.
Disk cloning handled paralell and asynchronusly.
"""
import
copy
tmpl
=
copy
.
deepcopy
(
self
)
tmpl
.
name
=
"Cloned from "
+
self
.
name
tmpl
.
pk
=
None
tmpl
.
full_clean
()
# Avoiding database errors.
tmpl
.
save
()
def
__clone_disk
(
disk
):
base
=
None
if
disk
.
type
==
"iso"
:
base
=
disk
cloned_disk
=
Disk
.
create
(
datastore
=
disk
.
datastore
,
name
=
disk
.
name
,
size
=
disk
.
size
,
type
=
disk
.
type
,
base
=
base
)
#Paralell cloning disks
disk
.
clone_async
(
cloned_disk
,
user
=
user
)
return
cloned_disk
try
:
tmpl
.
disks
.
add
(
*
[
__clone_disk
(
disk
)
for
disk
in
self
.
disks
.
all
()])
tmpl
.
interface_set
.
add
(
*
self
.
interface_set
.
all
())
except
:
tmpl
.
delete
()
raise
else
:
return
tmpl
@permalink
def
get_absolute_url
(
self
):
return
(
'dashboard.views.template-detail'
,
None
,
{
'pk'
:
self
.
pk
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment