From: Salvatore Orlando Date: Tue, 28 Jun 2011 09:29:08 +0000 (+0100) Subject: Addressing comments from Somik X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=81f9170ad5e93b331d90b1273fdc801e4bb3dff5;p=openstack-build%2Fneutron-build.git Addressing comments from Somik --- diff --git a/.pydevproject b/.pydevproject deleted file mode 100644 index 024d0515e..000000000 --- a/.pydevproject +++ /dev/null @@ -1,10 +0,0 @@ - - - - -python -python 2.7 - -/quantum-api - - diff --git a/.pydevproject.moved b/.pydevproject.moved deleted file mode 100644 index 024d0515e..000000000 --- a/.pydevproject.moved +++ /dev/null @@ -1,10 +0,0 @@ - - - - -python -python 2.7 - -/quantum-api - - diff --git a/pep8.errors b/pep8.errors deleted file mode 100644 index 5744ad98e..000000000 --- a/pep8.errors +++ /dev/null @@ -1,49 +0,0 @@ -quantum/cli.py:39:43: W291 trailing whitespace -quantum/cli.py:92:68: W291 trailing whitespace -quantum/cli.py:95:62: W291 trailing whitespace -quantum/cli.py:98:53: W291 trailing whitespace -quantum/cli.py:110:1: W391 blank line at end of file -quantum/manager.py:21:80: E501 line too long (94 characters) -quantum/manager.py:37:22: E231 missing whitespace after ',' -quantum/service.py:91:39: E251 no spaces around keyword / parameter equals -quantum/service.py:102:1: W293 blank line contains whitespace -quantum/api/__init__.py:54:41: W291 trailing whitespace -quantum/api/__init__.py:57:60: E251 no spaces around keyword / parameter equals -quantum/api/faults.py:55:57: W291 trailing whitespace -quantum/api/networks.py:81:48: E231 missing whitespace after ',' -quantum/common/exceptions.py:98:1: E302 expected 2 blank lines, found 1 -quantum/common/exceptions.py:103:1: E302 expected 2 blank lines, found 1 -quantum/plugins/SamplePlugin.py:137:30: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:139:47: E203 whitespace before ',' -quantum/plugins/SamplePlugin.py:184:1: W293 blank line contains whitespace -quantum/plugins/SamplePlugin.py:255:38: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:258:38: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:255:21: E203 whitespace before ':' -quantum/plugins/SamplePlugin.py:259:37: E231 missing whitespace after ':' -quantum/plugins/SamplePlugin.py:263:38: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:266:38: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:269:21: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:263:21: E203 whitespace before ':' -quantum/plugins/SamplePlugin.py:267:37: E231 missing whitespace after ':' -quantum/plugins/SamplePlugin.py:280:46: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:272:29: E231 missing whitespace after ':' -quantum/plugins/SamplePlugin.py:270:14: E225 missing whitespace around operator -quantum/plugins/SamplePlugin.py:284:32: E225 missing whitespace around operator -quantum/plugins/SamplePlugin.py:300:43: E231 missing whitespace after ',' -quantum/plugins/SamplePlugin.py:309:49: E251 no spaces around keyword / parameter equals -quantum/plugins/SamplePlugin.py:318:30: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:338:19: E225 missing whitespace around operator -quantum/plugins/SamplePlugin.py:341:31: E231 missing whitespace after ':' -quantum/plugins/SamplePlugin.py:341:21: E225 missing whitespace around operator -quantum/plugins/SamplePlugin.py:344:41: E225 missing whitespace around operator -quantum/plugins/SamplePlugin.py:373:33: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:373:24: E225 missing whitespace around operator -quantum/plugins/SamplePlugin.py:401:63: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:404:40: E225 missing whitespace around operator -quantum/plugins/SamplePlugin.py:405:35: E231 missing whitespace after ':' -quantum/plugins/SamplePlugin.py:409:29: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:419:20: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:432:46: E231 missing whitespace after ',' -quantum/plugins/SamplePlugin.py:436:25: W291 trailing whitespace -quantum/plugins/SamplePlugin.py:459:46: E231 missing whitespace after ',' -quantum/plugins/SamplePlugin.py:482:80: E501 line too long (99 characters) diff --git a/quantum/api/ports.py b/quantum/api/ports.py index 729a7182d..b92f33e9e 100644 --- a/quantum/api/ports.py +++ b/quantum/api/ports.py @@ -133,8 +133,8 @@ class Controller(common.QuantumController): def get_resource(self, request, tenant_id, network_id, id): try: - result = self.network_manager.get_interface_details( - tenant_id, network_id, id) + result = self.network_manager.get_port_details( + tenant_id, network_id, id).get('attachment', None) return dict(attachment=result) except exception.NetworkNotFound as e: return faults.Fault(faults.NetworkNotFound(e)) diff --git a/quantum/common/wsgi.py b/quantum/common/wsgi.py index dc4ee1c8f..6edaf731e 100644 --- a/quantum/common/wsgi.py +++ b/quantum/common/wsgi.py @@ -294,7 +294,6 @@ class Router(object): Route the incoming request to a controller based on self.map. If no match, return a 404. """ - LOG.debug("HERE - wsgi.Router.__call__") return self._router @staticmethod @@ -328,7 +327,6 @@ class Controller(object): """ Call the method specified in req.environ by RoutesMiddleware. """ - LOG.debug("HERE - wsgi.Controller.__call__") arg_dict = req.environ['wsgiorg.routing_args'][1] action = arg_dict['action'] method = getattr(self, action) @@ -419,7 +417,6 @@ class Serializer(object): The string must be in the format of a supported MIME type. """ - LOG.debug("Deserialize invoked:%s", datastring) return self.get_deserialize_handler(content_type)(datastring) def get_deserialize_handler(self, content_type): diff --git a/quantum/plugins/SamplePlugin.py b/quantum/plugins/SamplePlugin.py index 5964beffb..1f7c9f8dd 100644 --- a/quantum/plugins/SamplePlugin.py +++ b/quantum/plugins/SamplePlugin.py @@ -113,20 +113,6 @@ class QuantumEchoPlugin(object): """ print("unplug_interface() called\n") - def get_interface_details(self, tenant_id, net_id, port_id): - """ - Retrieves the remote interface that is attached at this - particular port. - """ - print("get_interface_details() called\n") - - def get_all_attached_interfaces(self, tenant_id, net_id): - """ - Retrieves all remote interfaces that are attached to - a particular Virtual Network. - """ - print("get_all_attached_interfaces() called\n") - class DummyDataPlugin(object): @@ -240,11 +226,11 @@ class FakePlugin(object): 'port-state': 'DOWN', 'attachment': None}, 2: {'port-id': 2, - 'port-state': 'UP', + 'port-state': 'ACTIVE', 'attachment': None}} _port_dict_2 = { 1: {'port-id': 1, - 'port-state': 'UP', + 'port-state': 'ACTIVE', 'attachment': 'SomeFormOfVIFID'}, 2: {'port-id': 2, 'port-state': 'DOWN', @@ -418,15 +404,6 @@ class FakePlugin(object): except KeyError: raise exc.PortNotFound(net_id=net_id, port_id=port_id) - def get_interface_details(self, tenant_id, net_id, port_id): - """ - Retrieves the remote interface that is attached at this - particular port. - """ - print("get_interface_details() called\n") - port = self._get_port(tenant_id, net_id, port_id) - return port['attachment'] - def plug_interface(self, tenant_id, net_id, port_id, remote_interface_id): """ Attaches a remote interface to the specified port on the @@ -452,14 +429,3 @@ class FakePlugin(object): # TODO(salvatore-orlando): # Should unplug on port without attachment raise an Error? port['attachment'] = None - - def get_all_attached_interfaces(self, tenant_id, net_id): - """ - Retrieves all remote interfaces that are attached to - a particular Virtual Network. - """ - print("get_all_attached_interfaces() called\n") - # returns a list of all attached remote interfaces - vifs_on_net = ["/tenant1/networks/net_id/portid/vif2.0", - "/tenant1/networks/10/121/vif1.1"] - return vifs_on_net diff --git a/quantum/plugins/openvswitch/README b/quantum/plugins/openvswitch/README index ef0660c08..b44a59672 100644 --- a/quantum/plugins/openvswitch/README +++ b/quantum/plugins/openvswitch/README @@ -79,10 +79,10 @@ $ /etc/xapi.d/plugins/ovs_quantum_agent.py /etc/xapi.d/plugins/ovs_quantum_plugi # -- Getting quantum up and running - Start quantum [on the quantum service host]: -~/src/quantum- $ PYTHONPATH=.:$PYTHONPATH python bin/quantum etc/quantum.conf +~/src/quantum $ PYTHONPATH=.:$PYTHONPATH python bin/quantum etc/quantum.conf - Run ovs_quantum_plugin.py via the quantum plugin framework cli [on the quantum service host] -~/src/quantum-framework$ PYTHONPATH=.:$PYTHONPATH python quantum/cli.py +~/src/quantum$ PYTHONPATH=.:$PYTHONPATH python quantum/cli.py This will show help all of the available commands. diff --git a/tests/functional/test_service.py b/tests/functional/test_service.py index 29d23cf3f..ba4f61416 100644 --- a/tests/functional/test_service.py +++ b/tests/functional/test_service.py @@ -49,8 +49,7 @@ def print_response(res): class QuantumTest(unittest.TestCase): def setUp(self): self.client = MiniClient(HOST, PORT, USE_SSL) - - + def create_network(self, data): content_type = "application/" + FORMAT body = Serializer().serialize(data, content_type)