Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fb838841
authored
Oct 20, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: recreate interfaces from template in recovery operation
Closes
#314
parent
d3b23cb1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
circle/vm/operations.py
+21
-7
No files found.
circle/vm/operations.py
View file @
fb838841
...
@@ -1179,13 +1179,27 @@ class RecoverOperation(InstanceOperation):
...
@@ -1179,13 +1179,27 @@ class RecoverOperation(InstanceOperation):
except
Instance
.
InstanceDestroyedError
:
except
Instance
.
InstanceDestroyedError
:
pass
pass
def
_operation
(
self
):
def
_operation
(
self
,
user
,
activity
):
for
disk
in
self
.
instance
.
disks
.
all
():
with
activity
.
sub_activity
(
disk
.
destroyed
=
None
'recover_instance'
,
disk
.
restore
()
readable_name
=
ugettext_noop
(
"recover instance"
)):
disk
.
save
()
self
.
instance
.
destroyed_at
=
None
self
.
instance
.
destroyed_at
=
None
for
disk
in
self
.
instance
.
disks
.
all
():
self
.
instance
.
save
()
disk
.
destroyed
=
None
disk
.
restore
()
disk
.
save
()
self
.
instance
.
status
=
'PENDING'
self
.
instance
.
save
()
try
:
self
.
instance
.
renew
(
parent_activity
=
activity
)
except
:
pass
if
self
.
instance
.
template
:
for
net
in
self
.
instance
.
template
.
interface_set
.
all
():
self
.
instance
.
add_interface
(
parent_activity
=
activity
,
user
=
user
,
vlan
=
net
.
vlan
)
@register_operation
@register_operation
...
...
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