From 4f7cdf415c147480f5fac3870f398001dd02b2af Mon Sep 17 00:00:00 2001 From: Ying Liu Date: Wed, 17 Aug 2011 17:15:21 -0700 Subject: [PATCH] fix some pylint issues --- extensions/_credential_view.py | 20 ++++++++++++++++++++ extensions/_exceptions.py | 2 ++ extensions/_faults.py | 2 ++ extensions/_novatenant_view.py | 25 ++++++++++++++++++++----- extensions/_pprofiles.py | 20 ++++++++++++++++++++ extensions/_qos_view.py | 20 ++++++++++++++++++++ extensions/credential.py | 3 ++- extensions/novatenant.py | 11 +++++++---- extensions/portprofile.py | 23 ++++++++++++++++++----- extensions/qos.py | 3 ++- quantum/plugins.ini | 4 ++-- 11 files changed, 115 insertions(+), 18 deletions(-) diff --git a/extensions/_credential_view.py b/extensions/_credential_view.py index e324d3fc3..062e8fa93 100644 --- a/extensions/_credential_view.py +++ b/extensions/_credential_view.py @@ -1,3 +1,23 @@ +""" +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# Copyright 2011 Cisco Systems, Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# @author: Ying Liu, Cisco Systems, Inc. +# +""" def get_view_builder(req): base_url = req.application_url return ViewBuilder(base_url) diff --git a/extensions/_exceptions.py b/extensions/_exceptions.py index 5ae8850f5..99bc55da1 100644 --- a/extensions/_exceptions.py +++ b/extensions/_exceptions.py @@ -1,3 +1,4 @@ +""" # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2011 Cisco Systems, Inc. All rights reserved. @@ -16,6 +17,7 @@ # # @author: Ying Liu, Cisco Systems, Inc. # +""" import logging diff --git a/extensions/_faults.py b/extensions/_faults.py index 95ee9aed6..51866d5bc 100644 --- a/extensions/_faults.py +++ b/extensions/_faults.py @@ -1,3 +1,4 @@ +""" # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2011 Cisco Systems, Inc. All rights reserved. @@ -16,6 +17,7 @@ # # @author: Ying Liu, Cisco Systems, Inc. # +""" import webob.dec import webob.exc diff --git a/extensions/_novatenant_view.py b/extensions/_novatenant_view.py index 3a1b3f8ca..bcfe1f476 100644 --- a/extensions/_novatenant_view.py +++ b/extensions/_novatenant_view.py @@ -1,8 +1,23 @@ - - -import os - - +""" +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# Copyright 2011 Cisco Systems, Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# @author: Ying Liu, Cisco Systems, Inc. +# +""" def get_view_builder(req): base_url = req.application_url return ViewBuilder(base_url) diff --git a/extensions/_pprofiles.py b/extensions/_pprofiles.py index 997cb26e2..da541274f 100644 --- a/extensions/_pprofiles.py +++ b/extensions/_pprofiles.py @@ -1,3 +1,23 @@ +""" +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# Copyright 2011 Cisco Systems, Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# @author: Ying Liu, Cisco Systems, Inc. +# +""" def get_view_builder(req): base_url = req.application_url return ViewBuilder(base_url) diff --git a/extensions/_qos_view.py b/extensions/_qos_view.py index 877d82d0f..63fc9f3a0 100644 --- a/extensions/_qos_view.py +++ b/extensions/_qos_view.py @@ -1,3 +1,23 @@ +""" +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# Copyright 2011 Cisco Systems, Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# @author: Ying Liu, Cisco Systems, Inc. +# +""" def get_view_builder(req): base_url = req.application_url return ViewBuilder(base_url) diff --git a/extensions/credential.py b/extensions/credential.py index 46f25b6f1..782fddaad 100644 --- a/extensions/credential.py +++ b/extensions/credential.py @@ -1,3 +1,4 @@ +""" # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2011 Cisco Systems, Inc. All rights reserved. @@ -16,7 +17,7 @@ # # @author: Ying Liu, Cisco Systems, Inc. # - +""" import logging from webob import exc diff --git a/extensions/novatenant.py b/extensions/novatenant.py index 91a48e8fd..9d37fe2ca 100644 --- a/extensions/novatenant.py +++ b/extensions/novatenant.py @@ -1,7 +1,7 @@ +""" # vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2011 OpenStack LLC. -# All Rights Reserved. +# +# Copyright 2011 Cisco Systems, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -14,7 +14,10 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. - +# +# @author: Ying Liu, Cisco Systems, Inc. +# +""" from webob import exc from extensions import _novatenant_view as novatenant_view diff --git a/extensions/portprofile.py b/extensions/portprofile.py index 7cd2b3633..fce20facd 100644 --- a/extensions/portprofile.py +++ b/extensions/portprofile.py @@ -1,7 +1,7 @@ +""" # vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2011 OpenStack LLC. -# All Rights Reserved. +# +# Copyright 2011 Cisco Systems, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -14,6 +14,10 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +# +# @author: Ying Liu, Cisco Systems, Inc. +# +""" from webob import exc @@ -33,21 +37,27 @@ class Portprofile(object): pass def get_name(self): + """ Returns Ext Resource Name """ return "Cisco Port Profile" def get_alias(self): + """ Returns Ext Resource alias """ return "Cisco Port Profile" def get_description(self): + """ Returns Ext Resource Description """ return "Portprofile include QoS information" def get_namespace(self): + """ Returns Ext Resource Namespace """ return "" def get_updated(self): + """ Returns Ext Resource Updateed time """ return "2011-07-23T13:25:27-06:00" def get_resources(self): + """ Returns all defined resources """ parent_resource = dict(member_name="tenant", collection_name="extensions/csco/tenants") member_actions = {'associate_portprofile': "PUT", @@ -61,7 +71,7 @@ class Portprofile(object): class PortprofilesController(common.QuantumController): """ portprofile API controller based on QuantumController """ - + _portprofile_ops_param_list = [{ 'param-name': 'portprofile_name', 'required': True}, { @@ -83,9 +93,10 @@ class PortprofilesController(common.QuantumController): }, }, } - + def __init__(self, plugin): self._resource_name = 'portprofile' + self._plugin = plugin super(PortprofilesController, self).__init__(plugin) def index(self, request, tenant_id): @@ -160,6 +171,7 @@ class PortprofilesController(common.QuantumController): #added for cisco's extension def associate_portprofile(self, request, tenant_id, id): + """ associate a portprofile to the port """ content_type = request.best_match_content_type() print "Content type:%s" % content_type @@ -184,6 +196,7 @@ class PortprofilesController(common.QuantumController): #added for Cisco extension def disassociate_portprofile(self, request, tenant_id, id): + """ Disassociate a portprofile from a port """ content_type = request.best_match_content_type() print "Content type:%s" % content_type diff --git a/extensions/qos.py b/extensions/qos.py index 5351cc00b..777883d8c 100644 --- a/extensions/qos.py +++ b/extensions/qos.py @@ -1,3 +1,4 @@ +""" # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2011 Cisco Systems, Inc. All rights reserved. @@ -16,7 +17,7 @@ # # @author: Ying Liu, Cisco Systems, Inc. # - +""" import logging from webob import exc diff --git a/quantum/plugins.ini b/quantum/plugins.ini index 58db5dbc1..27c13c73f 100644 --- a/quantum/plugins.ini +++ b/quantum/plugins.ini @@ -1,4 +1,4 @@ [PLUGIN] -provider = quantum.plugins.cisco.l2network_plugin.L2Network -#provider = quantum.plugins.cisco.CiscoPlugin.CiscoPaloPlugin2 +#provider = quantum.plugins.cisco.l2network_plugin.L2Network +provider = quantum.plugins.cisco.CiscoPlugin.CiscoPaloPlugin2 #provider = quantum.plugins.SamplePlugin.FakePlugin -- 2.45.2