Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
circle/firewall/models.py
+8
-6
No files found.
circle/firewall/models.py
View file @
0cea7892
...
@@ -308,14 +308,16 @@ class Vlan(AclBase, models.Model):
...
@@ -308,14 +308,16 @@ class Vlan(AclBase, models.Model):
ipv4
=
str
(
ipv4
)
ipv4
=
str
(
ipv4
)
if
ipv4
not
in
used_v4
:
if
ipv4
not
in
used_v4
:
logger
.
debug
(
"Found unused IPv4 address
%
s."
,
ipv4
)
logger
.
debug
(
"Found unused IPv4 address
%
s."
,
ipv4
)
if
self
.
network6
is
None
:
ipv6
=
None
return
{
'ipv4'
:
ipv4
,
'ipv6'
:
None
}
if
self
.
network6
is
not
None
:
else
:
ipv6
=
ipv4_2_ipv6
(
self
.
ipv6_template
,
ipv4
)
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
)
logger
.
debug
(
"Found unused IPv6 address
%
s."
,
ipv6
)
return
{
'ipv4'
:
ipv4
,
'ipv6'
:
ipv6
}
return
{
'ipv4'
:
ipv4
,
'ipv6'
:
ipv6
}
raise
ValidationError
(
_
(
"All IP addresses are already in use."
))
else
:
raise
ValidationError
(
_
(
"All IP addresses are already in use."
))
class
VlanGroup
(
models
.
Model
):
class
VlanGroup
(
models
.
Model
):
...
...
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