Merge "Fix SG interface to reflect the reality"
This commit is contained in:
commit
1c456df89e
@ -398,11 +398,11 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase):
|
|||||||
raise ext_sg.SecurityGroupRuleNotFound(id=id)
|
raise ext_sg.SecurityGroupRuleNotFound(id=id)
|
||||||
return sgr
|
return sgr
|
||||||
|
|
||||||
def delete_security_group_rule(self, context, sgrid):
|
def delete_security_group_rule(self, context, id):
|
||||||
if (cfg.CONF.SECURITYGROUP.proxy_mode and not context.is_admin):
|
if (cfg.CONF.SECURITYGROUP.proxy_mode and not context.is_admin):
|
||||||
raise ext_sg.SecurityGroupProxyModeNotAdmin()
|
raise ext_sg.SecurityGroupProxyModeNotAdmin()
|
||||||
with context.session.begin(subtransactions=True):
|
with context.session.begin(subtransactions=True):
|
||||||
rule = self._get_security_group_rule(context, sgrid)
|
rule = self._get_security_group_rule(context, id)
|
||||||
context.session.delete(rule)
|
context.session.delete(rule)
|
||||||
|
|
||||||
def _extend_port_dict_security_group(self, context, port):
|
def _extend_port_dict_security_group(self, context, port):
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from abc import ABCMeta
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
|
|
||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
@ -317,16 +318,14 @@ class Securitygroup(extensions.ExtensionDescriptor):
|
|||||||
|
|
||||||
|
|
||||||
class SecurityGroupPluginBase(object):
|
class SecurityGroupPluginBase(object):
|
||||||
|
__metaclass__ = ABCMeta
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def create_security_group(self, context, security_group):
|
def create_security_group(self, context, security_group):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def delete_security_group(self, context, security_group):
|
def delete_security_group(self, context, id):
|
||||||
pass
|
|
||||||
|
|
||||||
@abstractmethod
|
|
||||||
def update_security_group(self, context, security_group):
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
@ -342,7 +341,7 @@ class SecurityGroupPluginBase(object):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def delete_security_group_rule(self, context, sgrid):
|
def delete_security_group_rule(self, context, id):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user