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
0cea7892
authored
Feb 14, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: refactor method implementation
parent
ea943848
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
circle/firewall/models.py
+6
-4
No files found.
circle/firewall/models.py
View file @
0cea7892
...
...
@@ -308,13 +308,15 @@ class Vlan(AclBase, models.Model):
ipv4
=
str
(
ipv4
)
if
ipv4
not
in
used_v4
:
logger
.
debug
(
"Found unused IPv4 address
%
s."
,
ipv4
)
if
self
.
network6
is
None
:
return
{
'ipv4'
:
ipv4
,
'ipv6'
:
None
}
else
:
ipv6
=
None
if
self
.
network6
is
not
None
:
ipv6
=
ipv4_2_ipv6
(
self
.
ipv6_template
,
ipv4
)
if
ipv6
not
in
used_v6
:
if
ipv6
in
used_v6
:
continue
else
:
logger
.
debug
(
"Found unused IPv6 address
%
s."
,
ipv6
)
return
{
'ipv4'
:
ipv4
,
'ipv6'
:
ipv6
}
else
:
raise
ValidationError
(
_
(
"All IP addresses are already in use."
))
...
...
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