Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
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
Hide 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):
...
@@ -449,7 +449,6 @@ def save_host(request):
host
.
location
=
data
[
'location'
]
host
.
location
=
data
[
'location'
]
set_field
(
host
,
'vlan'
,
errors
,
name
=
data
[
'vlan'
][
'name'
])
set_field
(
host
,
'vlan'
,
errors
,
name
=
data
[
'vlan'
][
'name'
])
set_field
(
host
,
'owner'
,
errors
,
username
=
data
[
'owner'
][
'name'
])
set_field
(
host
,
'owner'
,
errors
,
username
=
data
[
'owner'
][
'name'
])
# todo: group save
try
:
try
:
host
.
full_clean
()
host
.
full_clean
()
except
Exception
as
e
:
except
Exception
as
e
:
...
@@ -481,6 +480,19 @@ def save_vlan(request):
...
@@ -481,6 +480,19 @@ def save_vlan(request):
vlan
.
interface
=
data
[
'interface'
]
vlan
.
interface
=
data
[
'interface'
]
set_field
(
vlan
,
'owner'
,
errors
,
username
=
data
[
'owner'
][
'name'
])
set_field
(
vlan
,
'owner'
,
errors
,
username
=
data
[
'owner'
][
'name'
])
set_field
(
vlan
,
'domain'
,
errors
,
name
=
data
[
'domain'
][
'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
:
try
:
vlan
.
full_clean
()
vlan
.
full_clean
()
except
Exception
as
e
:
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