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
Commit
16213292
authored
Dec 06, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: don't fail if default_vlangroup is missing
parent
9fee2104
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
circle/firewall/models.py
+9
-3
No files found.
circle/firewall/models.py
View file @
16213292
...
@@ -536,10 +536,17 @@ class Host(models.Model):
...
@@ -536,10 +536,17 @@ class Host(models.Model):
else
:
else
:
public
=
self
.
_get_random_port
(
proto
)
public
=
self
.
_get_random_port
(
proto
)
vg
=
VlanGroup
.
objects
.
get
(
name
=
settings
[
"default_vlangroup"
])
try
:
vgname
=
settings
[
"default_vlangroup"
]
vg
=
VlanGroup
.
objects
.
get
(
name
=
vgname
)
except
VlanGroup
.
DoesNotExist
as
e
:
logger
.
error
(
'Host.add_port: default_vlangroup
%
s missing.
%
s'
,
vgname
,
unicode
(
e
))
else
:
if
self
.
shared_ip
:
if
self
.
shared_ip
:
if
public
<
1024
:
if
public
<
1024
:
raise
ValidationError
(
_
(
"Only ports above 1024 can be used."
))
raise
ValidationError
(
_
(
"Only ports above 1024 can be used."
))
rule
=
Rule
(
direction
=
'1'
,
owner
=
self
.
owner
,
dport
=
public
,
rule
=
Rule
(
direction
=
'1'
,
owner
=
self
.
owner
,
dport
=
public
,
proto
=
proto
,
nat
=
True
,
accept
=
True
,
proto
=
proto
,
nat
=
True
,
accept
=
True
,
nat_dport
=
private
,
host
=
self
,
foreign_network
=
vg
)
nat_dport
=
private
,
host
=
self
,
foreign_network
=
vg
)
...
@@ -547,7 +554,6 @@ class Host(models.Model):
...
@@ -547,7 +554,6 @@ class Host(models.Model):
rule
=
Rule
(
direction
=
'1'
,
owner
=
self
.
owner
,
dport
=
private
,
rule
=
Rule
(
direction
=
'1'
,
owner
=
self
.
owner
,
dport
=
private
,
proto
=
proto
,
nat
=
False
,
accept
=
True
,
proto
=
proto
,
nat
=
False
,
accept
=
True
,
host
=
self
,
foreign_network
=
vg
)
host
=
self
,
foreign_network
=
vg
)
rule
.
full_clean
()
rule
.
full_clean
()
rule
.
save
()
rule
.
save
()
...
...
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