aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-openstack/recipes-devtools/python/python-neutronclient/neutronclient-use-csv-flag-instead-of-json.patch66
-rw-r--r--meta-openstack/recipes-devtools/python/python-neutronclient_git.bb4
2 files changed, 69 insertions, 1 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-neutronclient/neutronclient-use-csv-flag-instead-of-json.patch b/meta-openstack/recipes-devtools/python/python-neutronclient/neutronclient-use-csv-flag-instead-of-json.patch
new file mode 100644
index 00000000..d9fade3a
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-neutronclient/neutronclient-use-csv-flag-instead-of-json.patch
@@ -0,0 +1,66 @@
+From d5310139d3f7e247552433cb046b4d608bb771dd Mon Sep 17 00:00:00 2001
+From: Keith Holman <Keith.Holman@windriver.com>
+Date: Wed, 25 Jun 2014 14:40:13 -0400
+Subject: [PATCH] neutronclient: use csv flag instead of json
+
+The tests included with neutronclient are calling neutron commands
+agents-list and net-list with the "-f" flag set to "json". This isn't
+supported and throws an exception during the test. The exception is
+unexpected and fails to free the resources allocated by the mox
+testing library causing the following tests to fail. This patch
+prevents the exception from being thrown by calling the commands with
+the "-f" flag set to "csv", which is supported.
+
+Signed-off-by: Keith Holman <Keith.Holman@windriver.com>
+---
+ neutronclient/tests/unit/test_cli20_agents.py | 4 ++--
+ neutronclient/tests/unit/test_cli20_network.py | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/neutronclient/tests/unit/test_cli20_agents.py b/neutronclient/tests/unit/test_cli20_agents.py
+index 1e75a92..ab01fb7 100644
+--- a/neutronclient/tests/unit/test_cli20_agents.py
++++ b/neutronclient/tests/unit/test_cli20_agents.py
+@@ -25,7 +25,7 @@ class CLITestV20Agent(test_cli20.CLITestV20Base):
+ def test_list_agents(self):
+ contents = {'agents': [{'id': 'myname', 'agent_type': 'mytype',
+ 'alive': True}]}
+- args = ['-f', 'json']
++ args = ['-f', 'csv']
+ resources = "agents"
+
+ cmd = agent.ListAgent(test_cli20.MyApp(sys.stdout), None)
+@@ -40,7 +40,7 @@ class CLITestV20Agent(test_cli20.CLITestV20Base):
+
+ def test_list_agents_field(self):
+ contents = {'agents': [{'alive': True}]}
+- args = ['-f', 'json']
++ args = ['-f', 'csv']
+ resources = "agents"
+ smile = ':-)'
+
+diff --git a/neutronclient/tests/unit/test_cli20_network.py b/neutronclient/tests/unit/test_cli20_network.py
+index 5e9be2a..eb562d0 100644
+--- a/neutronclient/tests/unit/test_cli20_network.py
++++ b/neutronclient/tests/unit/test_cli20_network.py
+@@ -262,7 +262,7 @@ class CLITestV20NetworkJSON(test_cli20.CLITestV20Base):
+ fields_1=['a', 'b'], fields_2=['c', 'd'])
+
+ def _test_list_nets_columns(self, cmd, returned_body,
+- args=['-f', 'json']):
++ args=['-f', 'csv']):
+ resources = 'networks'
+ self.mox.StubOutWithMock(network.ListNetwork, "extend_list")
+ network.ListNetwork.extend_list(mox.IsA(list), mox.IgnoreArg())
+@@ -275,7 +275,7 @@ class CLITestV20NetworkJSON(test_cli20.CLITestV20Base):
+ "tenant_id": "tenant_3",
+ "subnets": []}]}
+ self._test_list_nets_columns(cmd, returned_body,
+- args=['-f', 'json', '-c', 'id'])
++ args=['-f', 'csv', '-c', 'id'])
+ _str = self.fake_stdout.make_string()
+ returned_networks = utils.loads(_str)
+ self.assertEqual(1, len(returned_networks))
+--
+1.9.3
+
diff --git a/meta-openstack/recipes-devtools/python/python-neutronclient_git.bb b/meta-openstack/recipes-devtools/python/python-neutronclient_git.bb
index 753abcdf..2e83208c 100644
--- a/meta-openstack/recipes-devtools/python/python-neutronclient_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-neutronclient_git.bb
@@ -20,7 +20,9 @@ RDEPENDS_${PN} +="python-cliff \
PR = "r0"
-SRC_URI = "git://github.com/openstack/python-neutronclient.git;branch=master"
+SRC_URI = "git://github.com/openstack/python-neutronclient.git;branch=master \
+ file://neutronclient-use-csv-flag-instead-of-json.patch \
+ "
PV="2.3.4+git${SRCPV}"
SRCREV="663f8bd2cf5825ff587b2b10bf5d4a4bfc082534"