diff --git a/neutron/extensions/agent.py b/neutron/extensions/agent.py index 35c843ad612..0dc0acd0565 100644 --- a/neutron/extensions/agent.py +++ b/neutron/extensions/agent.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from abc import abstractmethod +import abc from neutron.api import extensions from neutron.api.v2 import attributes as attr @@ -132,7 +132,7 @@ class AgentPluginBase(object): """ raise exceptions.BadRequest - @abstractmethod + @abc.abstractmethod def delete_agent(self, context, id): """Delete agent. @@ -144,7 +144,7 @@ class AgentPluginBase(object): """ pass - @abstractmethod + @abc.abstractmethod def update_agent(self, context, agent): """Disable or Enable the agent. @@ -154,10 +154,10 @@ class AgentPluginBase(object): """ pass - @abstractmethod + @abc.abstractmethod def get_agents(self, context, filters=None, fields=None): pass - @abstractmethod + @abc.abstractmethod def get_agent(self, context, id, fields=None): pass diff --git a/neutron/extensions/dhcpagentscheduler.py b/neutron/extensions/dhcpagentscheduler.py index 90e26b06dbf..d86ba614f90 100644 --- a/neutron/extensions/dhcpagentscheduler.py +++ b/neutron/extensions/dhcpagentscheduler.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from abc import abstractmethod +import abc from neutron.api import extensions from neutron.api.v2 import base @@ -135,18 +135,18 @@ class DhcpAgentSchedulerPluginBase(object): All of method must be in an admin context. """ - @abstractmethod + @abc.abstractmethod def add_network_to_dhcp_agent(self, context, id, network_id): pass - @abstractmethod + @abc.abstractmethod def remove_network_from_dhcp_agent(self, context, id, network_id): pass - @abstractmethod + @abc.abstractmethod def list_networks_on_dhcp_agent(self, context, id): pass - @abstractmethod + @abc.abstractmethod def list_dhcp_agents_hosting_network(self, context, network_id): pass diff --git a/neutron/extensions/firewall.py b/neutron/extensions/firewall.py index 922bec36058..8ac534ce431 100644 --- a/neutron/extensions/firewall.py +++ b/neutron/extensions/firewall.py @@ -26,7 +26,7 @@ from neutron.api.v2 import resource_helper from neutron.common import exceptions as qexception from neutron.openstack.common import log as logging from neutron.plugins.common import constants -from neutron.services.service_base import ServicePluginBase +from neutron.services import service_base LOG = logging.getLogger(__name__) @@ -346,7 +346,7 @@ class Firewall(extensions.ExtensionDescriptor): @six.add_metaclass(abc.ABCMeta) -class FirewallPluginBase(ServicePluginBase): +class FirewallPluginBase(service_base.ServicePluginBase): def get_plugin_name(self): return constants.FIREWALL diff --git a/neutron/extensions/l3.py b/neutron/extensions/l3.py index 6c4de41cfd1..b02c9337b6d 100644 --- a/neutron/extensions/l3.py +++ b/neutron/extensions/l3.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from abc import abstractmethod +import abc from oslo.config import cfg @@ -196,52 +196,52 @@ class L3(extensions.ExtensionDescriptor): class RouterPluginBase(object): - @abstractmethod + @abc.abstractmethod def create_router(self, context, router): pass - @abstractmethod + @abc.abstractmethod def update_router(self, context, id, router): pass - @abstractmethod + @abc.abstractmethod def get_router(self, context, id, fields=None): pass - @abstractmethod + @abc.abstractmethod def delete_router(self, context, id): pass - @abstractmethod + @abc.abstractmethod def get_routers(self, context, filters=None, fields=None, sorts=None, limit=None, marker=None, page_reverse=False): pass - @abstractmethod + @abc.abstractmethod def add_router_interface(self, context, router_id, interface_info): pass - @abstractmethod + @abc.abstractmethod def remove_router_interface(self, context, router_id, interface_info): pass - @abstractmethod + @abc.abstractmethod def create_floatingip(self, context, floatingip): pass - @abstractmethod + @abc.abstractmethod def update_floatingip(self, context, id, floatingip): pass - @abstractmethod + @abc.abstractmethod def get_floatingip(self, context, id, fields=None): pass - @abstractmethod + @abc.abstractmethod def delete_floatingip(self, context, id): pass - @abstractmethod + @abc.abstractmethod def get_floatingips(self, context, filters=None, fields=None, sorts=None, limit=None, marker=None, page_reverse=False): diff --git a/neutron/extensions/l3agentscheduler.py b/neutron/extensions/l3agentscheduler.py index 36f731d2cbe..689cc9ba910 100644 --- a/neutron/extensions/l3agentscheduler.py +++ b/neutron/extensions/l3agentscheduler.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from abc import abstractmethod +import abc import webob.exc @@ -177,18 +177,18 @@ class L3AgentSchedulerPluginBase(object): All of method must be in an admin context. """ - @abstractmethod + @abc.abstractmethod def add_router_to_l3_agent(self, context, id, router_id): pass - @abstractmethod + @abc.abstractmethod def remove_router_from_l3_agent(self, context, id, router_id): pass - @abstractmethod + @abc.abstractmethod def list_routers_on_l3_agent(self, context, id): pass - @abstractmethod + @abc.abstractmethod def list_l3_agents_hosting_router(self, context, router_id): pass diff --git a/neutron/extensions/lbaas_agentscheduler.py b/neutron/extensions/lbaas_agentscheduler.py index 2a776fc90d8..a821cb6e8ea 100644 --- a/neutron/extensions/lbaas_agentscheduler.py +++ b/neutron/extensions/lbaas_agentscheduler.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from abc import abstractmethod +import abc from neutron.api import extensions from neutron.api.v2 import base @@ -128,10 +128,10 @@ class LbaasAgentSchedulerPluginBase(object): All of method must be in an admin context. """ - @abstractmethod + @abc.abstractmethod def list_pools_on_lbaas_agent(self, context, id): pass - @abstractmethod + @abc.abstractmethod def get_lbaas_agent_hosting_pool(self, context, pool_id): pass diff --git a/neutron/extensions/loadbalancer.py b/neutron/extensions/loadbalancer.py index 536bff5abdf..841e3f094eb 100644 --- a/neutron/extensions/loadbalancer.py +++ b/neutron/extensions/loadbalancer.py @@ -25,7 +25,7 @@ from neutron.api.v2 import resource_helper from neutron.common import exceptions as qexception from neutron import manager from neutron.plugins.common import constants -from neutron.services.service_base import ServicePluginBase +from neutron.services import service_base # Loadbalancer Exceptions @@ -393,7 +393,7 @@ class Loadbalancer(extensions.ExtensionDescriptor): @six.add_metaclass(abc.ABCMeta) -class LoadBalancerPluginBase(ServicePluginBase): +class LoadBalancerPluginBase(service_base.ServicePluginBase): def get_plugin_name(self): return constants.LOADBALANCER diff --git a/neutron/extensions/quotasv2.py b/neutron/extensions/quotasv2.py index ea29884bcf0..4fa9bf28056 100644 --- a/neutron/extensions/quotasv2.py +++ b/neutron/extensions/quotasv2.py @@ -19,11 +19,11 @@ from oslo.config import cfg import webob from neutron.api import extensions -from neutron.api.v2.attributes import convert_to_int +from neutron.api.v2 import attributes from neutron.api.v2 import base from neutron.api.v2 import resource from neutron.common import exceptions as n_exc -from neutron.manager import NeutronManager +from neutron import manager from neutron.openstack.common import importutils from neutron import quota from neutron import wsgi @@ -51,12 +51,12 @@ class QuotaSetsController(wsgi.Controller): def _update_attributes(self): for quota_resource in QUOTAS.resources.iterkeys(): attr_dict = EXTENDED_ATTRIBUTES_2_0[RESOURCE_COLLECTION] - attr_dict[quota_resource] = {'allow_post': False, - 'allow_put': True, - 'convert_to': convert_to_int, - 'validate': {'type:range': - [-1, sys.maxsize]}, - 'is_visible': True} + attr_dict[quota_resource] = { + 'allow_post': False, + 'allow_put': True, + 'convert_to': attributes.convert_to_int, + 'validate': {'type:range': [-1, sys.maxsize]}, + 'is_visible': True} self._update_extended_attributes = False def _get_quotas(self, request, tenant_id): @@ -138,7 +138,7 @@ class Quotasv2(extensions.ExtensionDescriptor): def get_resources(cls): """Returns Ext Resources.""" controller = resource.Resource( - QuotaSetsController(NeutronManager.get_plugin()), + QuotaSetsController(manager.NeutronManager.get_plugin()), faults=base.FAULT_MAP) return [extensions.ResourceExtension( Quotasv2.get_alias(), diff --git a/neutron/extensions/securitygroup.py b/neutron/extensions/securitygroup.py index 1450b694489..5f004af48c3 100644 --- a/neutron/extensions/securitygroup.py +++ b/neutron/extensions/securitygroup.py @@ -13,8 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from abc import ABCMeta -from abc import abstractmethod +import abc import netaddr from oslo.config import cfg @@ -311,45 +310,45 @@ class Securitygroup(extensions.ExtensionDescriptor): return {} -@six.add_metaclass(ABCMeta) +@six.add_metaclass(abc.ABCMeta) class SecurityGroupPluginBase(object): - @abstractmethod + @abc.abstractmethod def create_security_group(self, context, security_group): pass - @abstractmethod + @abc.abstractmethod def update_security_group(self, context, id, security_group): pass - @abstractmethod + @abc.abstractmethod def delete_security_group(self, context, id): pass - @abstractmethod + @abc.abstractmethod def get_security_groups(self, context, filters=None, fields=None, sorts=None, limit=None, marker=None, page_reverse=False): pass - @abstractmethod + @abc.abstractmethod def get_security_group(self, context, id, fields=None): pass - @abstractmethod + @abc.abstractmethod def create_security_group_rule(self, context, security_group_rule): pass - @abstractmethod + @abc.abstractmethod def delete_security_group_rule(self, context, id): pass - @abstractmethod + @abc.abstractmethod def get_security_group_rules(self, context, filters=None, fields=None, sorts=None, limit=None, marker=None, page_reverse=False): pass - @abstractmethod + @abc.abstractmethod def get_security_group_rule(self, context, id, fields=None): pass diff --git a/neutron/extensions/vpnaas.py b/neutron/extensions/vpnaas.py index 7c44725cea2..5c7cd46bfaa 100644 --- a/neutron/extensions/vpnaas.py +++ b/neutron/extensions/vpnaas.py @@ -24,7 +24,7 @@ from neutron.api.v2 import attributes as attr from neutron.api.v2 import resource_helper from neutron.common import exceptions as qexception from neutron.plugins.common import constants -from neutron.services.service_base import ServicePluginBase +from neutron.services import service_base class VPNServiceNotFound(qexception.NotFound): @@ -386,7 +386,7 @@ class Vpnaas(extensions.ExtensionDescriptor): @six.add_metaclass(abc.ABCMeta) -class VPNPluginBase(ServicePluginBase): +class VPNPluginBase(service_base.ServicePluginBase): def get_plugin_name(self): return constants.VPN