Commit f6861f2b by Bach Dániel

vm: raise SuspiciousOperation instead of PermissionDenied

parent bef94b77
......@@ -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 =
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,
......@@ -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"),
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment