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
62228069
authored
Mar 16, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: 'shutdown' method for network interfaces
Instead of 'delete_host' parameter for 'destroy'.
parent
1d35cf35
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
circle/vm/models/instance.py
+2
-2
circle/vm/models/network.py
+5
-2
No files found.
circle/vm/models/instance.py
View file @
62228069
...
@@ -945,7 +945,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -945,7 +945,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
# Destroy networks
# Destroy networks
with
act
.
sub_activity
(
'destroying_net'
):
with
act
.
sub_activity
(
'destroying_net'
):
for
net
in
self
.
interface_set
.
all
():
for
net
in
self
.
interface_set
.
all
():
net
.
destroy
(
delete_host
=
False
)
net
.
shutdown
(
)
# Suspend vm
# Suspend vm
with
act
.
sub_activity
(
'suspending'
):
with
act
.
sub_activity
(
'suspending'
):
...
@@ -1075,7 +1075,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -1075,7 +1075,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
# Destroy networks
# Destroy networks
with
act
.
sub_activity
(
'destroying_net'
):
with
act
.
sub_activity
(
'destroying_net'
):
for
net
in
self
.
interface_set
.
all
():
for
net
in
self
.
interface_set
.
all
():
net
.
destroy
(
delete_host
=
False
)
net
.
shutdown
(
)
with
act
.
sub_activity
(
'migrate_vm'
):
with
act
.
sub_activity
(
'migrate_vm'
):
queue_name
=
self
.
get_remote_queue_name
(
'vm'
)
queue_name
=
self
.
get_remote_queue_name
(
'vm'
)
...
...
circle/vm/models/network.py
View file @
62228069
...
@@ -142,11 +142,14 @@ class Interface(Model):
...
@@ -142,11 +142,14 @@ class Interface(Model):
args
=
[
self
.
get_vmnetwork_desc
()],
args
=
[
self
.
get_vmnetwork_desc
()],
queue
=
self
.
instance
.
get_remote_queue_name
(
'net'
))
queue
=
self
.
instance
.
get_remote_queue_name
(
'net'
))
def
destroy
(
self
,
delete_host
=
True
,
user
=
None
,
task_uuid
=
None
):
def
shutdown
(
self
,
user
=
None
,
task_uuid
=
None
):
net_tasks
.
destroy
.
apply_async
(
net_tasks
.
destroy
.
apply_async
(
args
=
[
self
.
get_vmnetwork_desc
()],
args
=
[
self
.
get_vmnetwork_desc
()],
queue
=
self
.
instance
.
get_remote_queue_name
(
'net'
))
queue
=
self
.
instance
.
get_remote_queue_name
(
'net'
))
if
delete_host
and
self
.
host
is
not
None
:
def
destroy
(
self
,
user
=
None
,
task_uuid
=
None
):
self
.
shutdown
(
user
,
task_uuid
)
if
self
.
host
is
not
None
:
self
.
host
.
delete
()
self
.
host
.
delete
()
def
save_as_template
(
self
,
instance_template
):
def
save_as_template
(
self
,
instance_template
):
...
...
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