Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
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
bf9231ac
authored
Mar 12, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
instance: added sub_activity to save_as
parent
5970aee7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
circle/vm/models/instance.py
+6
-6
No files found.
circle/vm/models/instance.py
View file @
bf9231ac
...
@@ -975,7 +975,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -975,7 +975,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
def
save_as_template
(
self
,
name
,
task_uuid
=
None
,
user
=
None
,
def
save_as_template
(
self
,
name
,
task_uuid
=
None
,
user
=
None
,
timeout
=
300
,
**
kwargs
):
timeout
=
300
,
**
kwargs
):
with
instance_activity
(
code_suffix
=
"save_as_template"
,
instance
=
self
,
with
instance_activity
(
code_suffix
=
"save_as_template"
,
instance
=
self
,
task_uuid
=
task_uuid
,
user
=
user
):
task_uuid
=
task_uuid
,
user
=
user
)
as
act
:
# prepare parameters
# prepare parameters
kwargs
.
setdefault
(
'name'
,
name
)
kwargs
.
setdefault
(
'name'
,
name
)
kwargs
.
setdefault
(
'description'
,
self
.
description
)
kwargs
.
setdefault
(
'description'
,
self
.
description
)
...
@@ -1000,12 +1000,12 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -1000,12 +1000,12 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
# create template and do additional setup
# create template and do additional setup
tmpl
=
InstanceTemplate
(
**
kwargs
)
tmpl
=
InstanceTemplate
(
**
kwargs
)
tmpl
.
full_clean
()
tmpl
.
full_clean
()
# Avoiding database errors.
logger
.
info
(
"Clean utani save"
)
tmpl
.
save
()
tmpl
.
save
()
tmpl
.
disks
.
add
(
*
[
__try_save_disk
(
disk
)
with
act
.
sub_activity
(
'saving_disks'
):
for
disk
in
self
.
disks
.
all
()])
tmpl
.
disks
.
add
(
*
[
__try_save_disk
(
disk
)
# save template
for
disk
in
self
.
disks
.
all
()])
# save template
tmpl
.
save
()
tmpl
.
save
()
try
:
try
:
# create interface templates
# create interface templates
...
...
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