Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
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
395bd172
authored
Jul 03, 2018
by
Szabolcs Gelencsér
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 'allow all' security group to created interfaces
parent
019ee29f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
+16
-1
circle/vm/operations.py
+16
-1
No files found.
circle/vm/operations.py
View file @
395bd172
...
...
@@ -189,7 +189,21 @@ class AddInterfaceOperation(InstanceOperation):
os_policy_actions
=
((
"compute"
,
"compute:attach_interface"
),)
def
_operation
(
self
,
request
,
user
,
system
,
vlan
,
managed
=
None
):
openstack_api
.
nova
.
interface_attach
(
request
,
self
.
instance
,
net_id
=
vlan
)
interface
=
openstack_api
.
nova
.
interface_attach
(
request
,
self
.
instance
,
net_id
=
vlan
)
security_group
=
openstack_api
.
neutron
.
security_group_create
(
request
,
interface
.
port_id
,
interface
.
port_id
)
# TODO: add UI elements to adjust this
openstack_api
.
neutron
.
security_group_rule_create
(
request
,
security_group
.
id
,
"ingress"
,
"IPv4"
,
None
,
None
,
None
,
"0.0.0.0/0"
,
None
,
)
openstack_api
.
neutron
.
port_update
(
request
,
interface
.
port_id
,
security_groups
=
[
security_group
.
id
])
@register_operation
class
CreateDiskOperation
(
InstanceOperation
):
...
...
@@ -411,6 +425,7 @@ class RemoveInterfaceOperation(InstanceOperation):
def
_operation
(
self
,
request
,
port_id
):
openstack_api
.
nova
.
interface_detach
(
request
,
self
.
instance
.
id
,
port_id
)
#TODO: remove public IPs, associated security groups
@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