From 7fd5d54e2bf033f0f6a5347e38adcd725cc9d9b5 Mon Sep 17 00:00:00 2001 From: jiaopengju Date: Mon, 16 Sep 2019 11:05:40 +0800 Subject: [PATCH] Remove the code which is unreachable Currently, in neutron_protection_plugin, some code is unreachable and will never be executed. This patch will remove them. Change-Id: I3ce4517368fc82aac4eb81c801d6f81a8536e169 --- .../network/neutron_protection_plugin.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/karbor/services/protection/protection_plugins/network/neutron_protection_plugin.py b/karbor/services/protection/protection_plugins/network/neutron_protection_plugin.py index 67d072a2..8649852a 100644 --- a/karbor/services/protection/protection_plugins/network/neutron_protection_plugin.py +++ b/karbor/services/protection/protection_plugins/network/neutron_protection_plugin.py @@ -78,8 +78,6 @@ class ProtectOperation(protection_plugin.Operation): raise exception.GetProtectionNetworkSubResourceFailed( type=self._SUPPORT_RESOURCE_TYPES, reason=six.text_type(e)) - else: - return [] def _get_resources_by_subnet(self, cntxt, neutron_client): try: @@ -116,8 +114,6 @@ class ProtectOperation(protection_plugin.Operation): raise exception.GetProtectionNetworkSubResourceFailed( type=self._SUPPORT_RESOURCE_TYPES, reason=six.text_type(e)) - else: - return [] def _get_resources_by_port(self, cntxt, neutron_client): try: @@ -153,8 +149,6 @@ class ProtectOperation(protection_plugin.Operation): raise exception.GetProtectionNetworkSubResourceFailed( type=self._SUPPORT_RESOURCE_TYPES, reason=six.text_type(e)) - else: - return [] def _get_resources_by_router(self, cntxt, neutron_client): try: @@ -184,8 +178,6 @@ class ProtectOperation(protection_plugin.Operation): raise exception.GetProtectionNetworkSubResourceFailed( type=self._SUPPORT_RESOURCE_TYPES, reason=six.text_type(e)) - else: - return [] def _get_resources_by_security_group(self, cntxt, neutron_client): try: @@ -211,8 +203,6 @@ class ProtectOperation(protection_plugin.Operation): raise exception.GetProtectionNetworkSubResourceFailed( type=self._SUPPORT_RESOURCE_TYPES, reason=six.text_type(e)) - else: - return [] def on_main(self, checkpoint, resource, context, parameters, **kwargs): network_id = get_network_id(context)