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
baebe8ef
authored
Feb 21, 2013
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: random fix
parent
e1b47e06
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
firewall/views.py
+2
-2
one/views.py
+0
-2
No files found.
firewall/views.py
View file @
baebe8ef
...
@@ -45,7 +45,7 @@ def firewall_api(request):
...
@@ -45,7 +45,7 @@ def firewall_api(request):
obj
.
reason
=
data
[
"reason"
]
obj
.
reason
=
data
[
"reason"
]
obj
.
snort_message
=
data
[
"snort_message"
]
obj
.
snort_message
=
data
[
"snort_message"
]
obj
.
save
()
obj
.
save
()
return
HttpResponse
(
_
(
"OK"
));
return
HttpResponse
(
unicode
(
_
(
"OK"
)
));
if
not
(
data
[
"vlan"
]
==
"vm-net"
or
data
[
"vlan"
]
==
"war"
):
if
not
(
data
[
"vlan"
]
==
"vm-net"
or
data
[
"vlan"
]
==
"war"
):
raise
Exception
(
_
(
"Only vm-net and war can be used."
))
raise
Exception
(
_
(
"Only vm-net and war can be used."
))
...
@@ -88,4 +88,4 @@ def firewall_api(request):
...
@@ -88,4 +88,4 @@ def firewall_api(request):
except
:
except
:
return
HttpResponse
(
_
(
"Something went wrong!
\n
"
));
return
HttpResponse
(
_
(
"Something went wrong!
\n
"
));
return
HttpResponse
(
_
(
"OK"
));
return
HttpResponse
(
unicode
(
_
(
"OK"
)
));
one/views.py
View file @
baebe8ef
...
@@ -332,7 +332,6 @@ class VmPortAddView(View):
...
@@ -332,7 +332,6 @@ class VmPortAddView(View):
raise
ValidationError
(
_
(
"Port number is in a restricted domain (22000 to 24000)."
))
raise
ValidationError
(
_
(
"Port number is in a restricted domain (22000 to 24000)."
))
inst
=
get_object_or_404
(
Instance
,
id
=
iid
,
owner
=
request
.
user
)
inst
=
get_object_or_404
(
Instance
,
id
=
iid
,
owner
=
request
.
user
)
inst
.
firewall_host
.
add_port
(
proto
=
request
.
POST
[
'proto'
],
public
=
public
,
private
=
int
(
request
.
POST
[
'private'
]))
inst
.
firewall_host
.
add_port
(
proto
=
request
.
POST
[
'proto'
],
public
=
public
,
private
=
int
(
request
.
POST
[
'private'
]))
reload_firewall_lock
()
messages
.
success
(
request
,
_
(
u"Port
%
d successfully added."
)
%
public
)
messages
.
success
(
request
,
_
(
u"Port
%
d successfully added."
)
%
public
)
except
:
except
:
messages
.
error
(
request
,
_
(
u"Adding port failed."
))
messages
.
error
(
request
,
_
(
u"Adding port failed."
))
...
@@ -351,7 +350,6 @@ def vm_port_del(request, iid, proto, public):
...
@@ -351,7 +350,6 @@ def vm_port_del(request, iid, proto, public):
inst
=
get_object_or_404
(
Instance
,
id
=
iid
,
owner
=
request
.
user
)
inst
=
get_object_or_404
(
Instance
,
id
=
iid
,
owner
=
request
.
user
)
try
:
try
:
inst
.
firewall_host
.
del_port
(
proto
=
proto
,
public
=
public
)
inst
.
firewall_host
.
del_port
(
proto
=
proto
,
public
=
public
)
reload_firewall_lock
()
messages
.
success
(
request
,
_
(
u"Port
%
d successfully removed."
)
%
public
)
messages
.
success
(
request
,
_
(
u"Port
%
d successfully removed."
)
%
public
)
except
:
except
:
messages
.
error
(
request
,
_
(
u"Removing port failed."
))
messages
.
error
(
request
,
_
(
u"Removing port failed."
))
...
...
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