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
e19eaa8e
authored
Apr 17, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: operation for removing a network interface from a VM
parent
c7920a85
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
+18
-1
circle/vm/models/network.py
+0
-1
circle/vm/operations.py
+18
-0
No files found.
circle/vm/models/network.py
View file @
e19eaa8e
...
...
@@ -144,7 +144,6 @@ class Interface(Model):
queue
=
queue_name
)
.
get
()
def
destroy
(
self
):
self
.
shutdown
()
if
self
.
host
is
not
None
:
self
.
host
.
delete
()
...
...
circle/vm/operations.py
View file @
e19eaa8e
...
...
@@ -131,6 +131,7 @@ class DestroyOperation(InstanceOperation):
if
self
.
instance
.
node
:
# Destroy networks
with
activity
.
sub_activity
(
'destroying_net'
):
self
.
instance
.
shutdown_net
()
self
.
instance
.
destroy_net
()
# Delete virtual machine
...
...
@@ -201,6 +202,23 @@ class RebootOperation(InstanceOperation):
register_instance_operation
(
RebootOperation
)
class
RemoveInterfaceOperation
(
InstanceOperation
):
activity_code_suffix
=
'remove_interface'
id
=
'remove_interface'
name
=
_
(
"remove interface"
)
description
=
_
(
"Remove the specified network interface from the VM."
)
def
_operation
(
self
,
activity
,
user
,
system
,
interface
):
if
self
.
instance
.
is_running
:
interface
.
shutdown
()
interface
.
destroy
()
interface
.
delete
()
register_instance_operation
(
RemoveInterfaceOperation
)
class
ResetOperation
(
InstanceOperation
):
activity_code_suffix
=
'reset'
id
=
'reset'
...
...
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