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
12048406
authored
May 16, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: save vlan.snat_to
parent
f99474fe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
firewall_gui/views.py
+13
-1
No files found.
firewall_gui/views.py
View file @
12048406
...
...
@@ -449,7 +449,6 @@ def save_host(request):
host
.
location
=
data
[
'location'
]
set_field
(
host
,
'vlan'
,
errors
,
name
=
data
[
'vlan'
][
'name'
])
set_field
(
host
,
'owner'
,
errors
,
username
=
data
[
'owner'
][
'name'
])
# todo: group save
try
:
host
.
full_clean
()
except
Exception
as
e
:
...
...
@@ -481,6 +480,19 @@ def save_vlan(request):
vlan
.
interface
=
data
[
'interface'
]
set_field
(
vlan
,
'owner'
,
errors
,
username
=
data
[
'owner'
][
'name'
])
set_field
(
vlan
,
'domain'
,
errors
,
name
=
data
[
'domain'
][
'name'
])
for
group
in
data
[
'vlans'
]:
try
:
if
'__destroyed'
in
group
and
group
[
'__destroyed'
]:
nat_to
=
Vlan
.
objects
.
get
(
name
=
group
[
'name'
])
vlan
.
snat_to
.
remove
(
nat_to
)
elif
'__created'
in
group
and
group
[
'__created'
]:
nat_to
=
Vlan
.
objects
.
get
(
name
=
group
[
'name'
])
vlan
.
snat_to
.
add
(
nat_to
)
except
Exception
as
e
:
print
(
e
,
group
)
errors
[
'vlans'
]
=
(
'Vlan with the name "
%(name)
s" does not exists!'
)
%
{
'name'
:
e
.
message
#group['name']
}
try
:
vlan
.
full_clean
()
except
Exception
as
e
:
...
...
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