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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
97b69b04
authored
Oct 04, 2013
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: change get_new_address to return dict instead of tuple
parent
8d7d535a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
circle/firewall/models.py
+1
-1
circle/vm/models.py
+5
-5
No files found.
circle/firewall/models.py
View file @
97b69b04
...
...
@@ -298,7 +298,7 @@ class Vlan(models.Model):
print
ipv4
ipv6
=
ipv4_2_ipv6
(
ipv4
)
if
ipv6
not
in
used_v6
:
return
(
ipv4
,
ipv6
)
return
{
'ipv4'
:
ipv4
,
'ipv6'
:
ipv6
}
raise
ValidationError
(
_
(
"All IP addresses are already in use."
))
...
...
circle/vm/models.py
View file @
97b69b04
...
...
@@ -754,20 +754,20 @@ class Interface(Model):
InterfaceTemplate.
"""
if
template
.
managed
:
host
=
Host
()
host
.
vlan
=
template
.
vlan
# TODO change Host's mac field's type to EUI in firewall
host
.
mac
=
str
(
cls
.
generate_mac
(
instance
,
template
.
vlan
))
# TODO Fix at firewall EUI mac
host
.
hostname
=
instance
.
vm_name
# Get adresses from firewall
#TODO fix tupple to dict.
# Get adresses from firewall
addresses
=
template
.
vlan
.
get_new_address
()
host
.
ipv4
=
addresses
[
0
]
host
.
ipv6
=
addresses
[
1
]
host
.
ipv4
=
addresses
[
'ipv4'
]
host
.
ipv6
=
addresses
[
'ipv6'
]
host
.
owner
=
owner
host
.
save
()
else
:
host
=
None
iface
=
cls
(
vlan
=
template
.
vlan
,
host
=
host
,
instance
=
instance
)
iface
.
save
()
return
iface
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