diff options
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-neutronclient/neutronclient-use-csv-flag-instead-of-json.patch')
-rw-r--r-- | meta-openstack/recipes-devtools/python/python-neutronclient/neutronclient-use-csv-flag-instead-of-json.patch | 66 |
1 files changed, 66 insertions, 0 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 0000000..d9fade3 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-neutronclient/neutronclient-use-csv-flag-instead-of-json.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | From d5310139d3f7e247552433cb046b4d608bb771dd Mon Sep 17 00:00:00 2001 | ||
2 | From: Keith Holman <Keith.Holman@windriver.com> | ||
3 | Date: Wed, 25 Jun 2014 14:40:13 -0400 | ||
4 | Subject: [PATCH] neutronclient: use csv flag instead of json | ||
5 | |||
6 | The tests included with neutronclient are calling neutron commands | ||
7 | agents-list and net-list with the "-f" flag set to "json". This isn't | ||
8 | supported and throws an exception during the test. The exception is | ||
9 | unexpected and fails to free the resources allocated by the mox | ||
10 | testing library causing the following tests to fail. This patch | ||
11 | prevents the exception from being thrown by calling the commands with | ||
12 | the "-f" flag set to "csv", which is supported. | ||
13 | |||
14 | Signed-off-by: Keith Holman <Keith.Holman@windriver.com> | ||
15 | --- | ||
16 | neutronclient/tests/unit/test_cli20_agents.py | 4 ++-- | ||
17 | neutronclient/tests/unit/test_cli20_network.py | 4 ++-- | ||
18 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
19 | |||
20 | diff --git a/neutronclient/tests/unit/test_cli20_agents.py b/neutronclient/tests/unit/test_cli20_agents.py | ||
21 | index 1e75a92..ab01fb7 100644 | ||
22 | --- a/neutronclient/tests/unit/test_cli20_agents.py | ||
23 | +++ b/neutronclient/tests/unit/test_cli20_agents.py | ||
24 | @@ -25,7 +25,7 @@ class CLITestV20Agent(test_cli20.CLITestV20Base): | ||
25 | def test_list_agents(self): | ||
26 | contents = {'agents': [{'id': 'myname', 'agent_type': 'mytype', | ||
27 | 'alive': True}]} | ||
28 | - args = ['-f', 'json'] | ||
29 | + args = ['-f', 'csv'] | ||
30 | resources = "agents" | ||
31 | |||
32 | cmd = agent.ListAgent(test_cli20.MyApp(sys.stdout), None) | ||
33 | @@ -40,7 +40,7 @@ class CLITestV20Agent(test_cli20.CLITestV20Base): | ||
34 | |||
35 | def test_list_agents_field(self): | ||
36 | contents = {'agents': [{'alive': True}]} | ||
37 | - args = ['-f', 'json'] | ||
38 | + args = ['-f', 'csv'] | ||
39 | resources = "agents" | ||
40 | smile = ':-)' | ||
41 | |||
42 | diff --git a/neutronclient/tests/unit/test_cli20_network.py b/neutronclient/tests/unit/test_cli20_network.py | ||
43 | index 5e9be2a..eb562d0 100644 | ||
44 | --- a/neutronclient/tests/unit/test_cli20_network.py | ||
45 | +++ b/neutronclient/tests/unit/test_cli20_network.py | ||
46 | @@ -262,7 +262,7 @@ class CLITestV20NetworkJSON(test_cli20.CLITestV20Base): | ||
47 | fields_1=['a', 'b'], fields_2=['c', 'd']) | ||
48 | |||
49 | def _test_list_nets_columns(self, cmd, returned_body, | ||
50 | - args=['-f', 'json']): | ||
51 | + args=['-f', 'csv']): | ||
52 | resources = 'networks' | ||
53 | self.mox.StubOutWithMock(network.ListNetwork, "extend_list") | ||
54 | network.ListNetwork.extend_list(mox.IsA(list), mox.IgnoreArg()) | ||
55 | @@ -275,7 +275,7 @@ class CLITestV20NetworkJSON(test_cli20.CLITestV20Base): | ||
56 | "tenant_id": "tenant_3", | ||
57 | "subnets": []}]} | ||
58 | self._test_list_nets_columns(cmd, returned_body, | ||
59 | - args=['-f', 'json', '-c', 'id']) | ||
60 | + args=['-f', 'csv', '-c', 'id']) | ||
61 | _str = self.fake_stdout.make_string() | ||
62 | returned_networks = utils.loads(_str) | ||
63 | self.assertEqual(1, len(returned_networks)) | ||
64 | -- | ||
65 | 1.9.3 | ||
66 | |||