Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
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
2c2f2091
authored
Feb 03, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: fix InterfaceTemplate.create
parent
ac015c66
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
circle/vm/models/instance.py
+1
-6
circle/vm/models/network.py
+4
-0
No files found.
circle/vm/models/instance.py
View file @
2c2f2091
...
...
@@ -307,13 +307,8 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
inst
.
disks
.
add
(
*
[
disk
.
get_exclusive
()
for
disk
in
disks
])
for
net
in
networks
:
i
=
Interface
.
create
(
instance
=
inst
,
vlan
=
net
.
vlan
,
Interface
.
create
(
instance
=
inst
,
vlan
=
net
.
vlan
,
owner
=
inst
.
owner
,
managed
=
net
.
managed
)
if
i
.
host
:
i
.
host
.
enable_net
()
port
,
proto
=
ACCESS_PROTOCOLS
[
i
.
instance
.
access_method
][
1
:
3
]
# TODO fix this port fw
i
.
host
.
add_port
(
proto
,
private
=
port
)
inst
.
req_traits
.
add
(
*
req_traits
)
inst
.
tags
.
add
(
*
tags
)
...
...
circle/vm/models/network.py
View file @
2c2f2091
...
...
@@ -121,6 +121,10 @@ class Interface(Model):
host
.
pub_ipv4
=
vlan
.
snat_ip
host
.
full_clean
()
host
.
save
()
host
.
enable_net
()
from
.instance
import
ACCESS_PROTOCOLS
port
,
proto
=
ACCESS_PROTOCOLS
[
instance
.
access_method
][
1
:
3
]
host
.
add_port
(
proto
,
private
=
port
)
else
:
host
=
None
...
...
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