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
f6861f2b
authored
Nov 03, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: raise SuspiciousOperation instead of PermissionDenied
parent
bef94b77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
circle/vm/operations.py
+3
-3
No files found.
circle/vm/operations.py
View file @
f6861f2b
...
...
@@ -27,7 +27,7 @@ from tarfile import TarFile, TarInfo
import
time
from
urlparse
import
urlsplit
from
django.core.exceptions
import
PermissionDenied
from
django.core.exceptions
import
PermissionDenied
,
SuspiciousOperation
from
django.utils
import
timezone
from
django.utils.translation
import
ugettext_lazy
as
_
,
ugettext_noop
from
django.conf
import
settings
...
...
@@ -617,7 +617,7 @@ class RemovePortOperation(InstanceOperation):
def
_operation
(
self
,
activity
,
rule
):
interface
=
rule
.
host
.
interface_set
.
get
()
if
interface
.
instance
!=
self
.
instance
:
raise
PermissionDenied
()
raise
SuspiciousOperation
()
activity
.
readable_name
=
create_readable
(
ugettext_noop
(
"close
%(proto)
s/
%(port)
d on
%(host)
s"
),
proto
=
rule
.
proto
,
port
=
rule
.
dport
,
host
=
rule
.
host
)
...
...
@@ -635,7 +635,7 @@ class AddPortOperation(InstanceOperation):
def
_operation
(
self
,
activity
,
host
,
proto
,
port
):
if
host
.
interface_set
.
get
()
.
instance
!=
self
.
instance
:
raise
PermissionDenied
()
raise
SuspiciousOperation
()
host
.
add_port
(
proto
,
private
=
port
)
activity
.
readable_name
=
create_readable
(
ugettext_noop
(
"open
%(proto)
s/
%(port)
d on
%(host)
s"
),
...
...
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