Fixing pep8 errors

This commit is contained in:
Salvatore Orlando 2011-05-13 12:54:18 +01:00
parent 5626c2fedd
commit ec5b5dd523
5 changed files with 30 additions and 26 deletions

View File

@ -13,4 +13,4 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
# @author: Somik Behera, Nicira Networks, Inc. # @author: Somik Behera, Nicira Networks, Inc.

View File

@ -13,4 +13,4 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
# @author: Somik Behera, Nicira Networks, Inc. # @author: Somik Behera, Nicira Networks, Inc.

View File

@ -18,4 +18,4 @@
""" """
Manager is responsible for parsing a config file and instantiating the correct Manager is responsible for parsing a config file and instantiating the correct
set of plugins that concretely implement quantum_plugin_base class set of plugins that concretely implement quantum_plugin_base class
""" """

View File

@ -24,6 +24,7 @@ methods that needs to be implemented by a Quantum Plug-in.
from abc import ABCMeta, abstractmethod from abc import ABCMeta, abstractmethod
class QuantumPluginBase(object): class QuantumPluginBase(object):
__metaclass__ = ABCMeta __metaclass__ = ABCMeta
@ -33,10 +34,10 @@ class QuantumPluginBase(object):
""" """
Returns a dictionary containing all Returns a dictionary containing all
<network_uuid, network_name> for <network_uuid, network_name> for
the specified tenant. the specified tenant.
""" """
pass pass
@abstractmethod @abstractmethod
def create_network(self, tenant_id, net_name): def create_network(self, tenant_id, net_name):
""" """
@ -44,7 +45,7 @@ class QuantumPluginBase(object):
a symbolic name. a symbolic name.
""" """
pass pass
@abstractmethod @abstractmethod
def delete_network(self, tenant_id, net_id): def delete_network(self, tenant_id, net_id):
""" """
@ -60,7 +61,7 @@ class QuantumPluginBase(object):
spec spec
""" """
pass pass
@abstractmethod @abstractmethod
def rename_network(self, tenant_id, net_id, new_name): def rename_network(self, tenant_id, net_id, new_name):
""" """
@ -68,7 +69,7 @@ class QuantumPluginBase(object):
Virtual Network. Virtual Network.
""" """
pass pass
@abstractmethod @abstractmethod
def get_all_ports(self, tenant_id, net_id): def get_all_ports(self, tenant_id, net_id):
""" """
@ -76,14 +77,14 @@ class QuantumPluginBase(object):
specified Virtual Network. specified Virtual Network.
""" """
pass pass
@abstractmethod @abstractmethod
def create_port(self, tenant_id, net_id): def create_port(self, tenant_id, net_id):
""" """
Creates a port on the specified Virtual Network. Creates a port on the specified Virtual Network.
""" """
pass pass
@abstractmethod @abstractmethod
def delete_port(self, tenant_id, net_id, port_id): def delete_port(self, tenant_id, net_id, port_id):
""" """
@ -93,7 +94,7 @@ class QuantumPluginBase(object):
is deleted. is deleted.
""" """
pass pass
@abstractmethod @abstractmethod
def get_port_details(self, tenant_id, net_id, port_id): def get_port_details(self, tenant_id, net_id, port_id):
""" """
@ -101,7 +102,7 @@ class QuantumPluginBase(object):
that is attached to this particular port. that is attached to this particular port.
""" """
pass pass
@abstractmethod @abstractmethod
def plug_interface(self, tenant_id, net_id, port_id, remote_interface_id): def plug_interface(self, tenant_id, net_id, port_id, remote_interface_id):
""" """
@ -109,7 +110,7 @@ class QuantumPluginBase(object):
specified Virtual Network. specified Virtual Network.
""" """
pass pass
@abstractmethod @abstractmethod
def unplug_interface(self, tenant_id, net_id, port_id): def unplug_interface(self, tenant_id, net_id, port_id):
""" """
@ -117,7 +118,7 @@ class QuantumPluginBase(object):
specified Virtual Network. specified Virtual Network.
""" """
pass pass
@abstractmethod @abstractmethod
def get_interface_details(self, tenant_id, net_id, port_id): def get_interface_details(self, tenant_id, net_id, port_id):
""" """
@ -125,11 +126,11 @@ class QuantumPluginBase(object):
particular port. particular port.
""" """
pass pass
@abstractmethod @abstractmethod
def get_all_attached_interfaces(self, tenant_id, net_id): def get_all_attached_interfaces(self, tenant_id, net_id):
""" """
Retrieves all remote interfaces that are attached to Retrieves all remote interfaces that are attached to
a particular Virtual Network. a particular Virtual Network.
""" """
pass pass

View File

@ -17,25 +17,28 @@
import json import json
import routes import routes
from common import wsgi
from webob import Response from webob import Response
from common import wsgi
class NetworkController(wsgi.Controller): class NetworkController(wsgi.Controller):
def version(self,request): def version(self, request):
return "Quantum version 0.1" return "Quantum version 0.1"
class API(wsgi.Router):
def __init__(self, options): class API(wsgi.Router):
def __init__(self, options):
self.options = options self.options = options
mapper = routes.Mapper() mapper = routes.Mapper()
network_controller = NetworkController() network_controller = NetworkController()
mapper.resource("net_controller", "/network", controller=network_controller) mapper.resource("net_controller", "/network",
controller=network_controller)
mapper.connect("/", controller=network_controller, action="version") mapper.connect("/", controller=network_controller, action="version")
super(API, self).__init__(mapper) super(API, self).__init__(mapper)
def app_factory(global_conf, **local_conf):
conf = global_conf.copy() def app_factory(global_conf, **local_conf):
conf = global_conf.copy()
conf.update(local_conf) conf.update(local_conf)
return API(conf) return API(conf)