diff -Nru python-novaclient-2.22.0/debian/changelog python-novaclient-2.22.0/debian/changelog --- python-novaclient-2.22.0/debian/changelog 2015-03-12 15:46:36.000000000 +0000 +++ python-novaclient-2.22.0/debian/changelog 2015-11-09 21:45:25.000000000 +0000 @@ -1,3 +1,10 @@ +python-novaclient (1:2.22.0-0ubuntu2) UNRELEASED; urgency=medium + + * Fix Typo in socket attribute name in TCPKeepAliveAdapter + * Add testcase for TCPKeepAliveAdapter as well + + -- Bryan Quigley Mon, 09 Nov 2015 21:44:06 +0000 + python-novaclient (1:2.22.0-0ubuntu1) vivid; urgency=medium * New upstream release. diff -Nru python-novaclient-2.22.0/debian/patches/Add-a-test-for-the-TCPKeepAliveAdapter.patch python-novaclient-2.22.0/debian/patches/Add-a-test-for-the-TCPKeepAliveAdapter.patch --- python-novaclient-2.22.0/debian/patches/Add-a-test-for-the-TCPKeepAliveAdapter.patch 1970-01-01 00:00:00.000000000 +0000 +++ python-novaclient-2.22.0/debian/patches/Add-a-test-for-the-TCPKeepAliveAdapter.patch 2015-11-09 21:43:59.000000000 +0000 @@ -0,0 +1,44 @@ +Description: Add a test for the TCPKeepAliveAdapter + Adds a testcase to catch things like typos. + . + +--- +Origin: upstream +Bug: https://bugs.launchpad.net/python-novaclient/+bug/1430935 +Bug-Ubuntu: https://launchpad.net/bugs/1499510 + +--- python-novaclient-2.22.0.orig/novaclient/tests/unit/test_client.py ++++ python-novaclient-2.22.0/novaclient/tests/unit/test_client.py +@@ -16,6 +16,7 @@ + + import json + import logging ++import socket + + import fixtures + import mock +@@ -27,6 +28,24 @@ from novaclient.tests.unit import utils + import novaclient.v2.client + + ++class TCPKeepAliveAdapterTest(utils.TestCase): ++ ++ @mock.patch.object(requests.adapters.HTTPAdapter, 'init_poolmanager') ++ def test_init_poolmanager(self, mock_init_poolmgr): ++ adapter = novaclient.client.TCPKeepAliveAdapter() ++ kwargs = {} ++ adapter.init_poolmanager(**kwargs) ++ if requests.__version__ >= '2.4.1': ++ kwargs.setdefault('socket_options', [ ++ (socket.IPPROTO_TCP, socket.TCP_NODELAY, 1), ++ (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1), ++ ]) ++ # NOTE(melwitt): This is called twice because ++ # HTTPAdapter.__init__ calls it first. ++ self.assertEqual(2, mock_init_poolmgr.call_count) ++ mock_init_poolmgr.assert_called_with(**kwargs) ++ ++ + class ClientConnectionPoolTest(utils.TestCase): + + @mock.patch("novaclient.client.TCPKeepAliveAdapter") diff -Nru python-novaclient-2.22.0/debian/patches/Fix-typo-in-socket-attribute-name.patch python-novaclient-2.22.0/debian/patches/Fix-typo-in-socket-attribute-name.patch --- python-novaclient-2.22.0/debian/patches/Fix-typo-in-socket-attribute-name.patch 1970-01-01 00:00:00.000000000 +0000 +++ python-novaclient-2.22.0/debian/patches/Fix-typo-in-socket-attribute-name.patch 2015-11-09 21:37:29.000000000 +0000 @@ -0,0 +1,21 @@ +Description: Fix Typo in socket attribute name in TCPKeepAliveAdapter + The proper attribute name is 'IPPROTO_TCP', not 'IPROTO_TCP'. + This would lead to an AttributeError since socket does + not have an attribute named 'IPROTO_TCP'. + . +--- +Origin: upstream +Bug: https://bugs.launchpad.net/python-novaclient/+bug/1430935 +Bug-Ubuntu: https://bugs.launchpad.net/cloud-archive/+bug/1499510 + +--- python-novaclient-2.22.0.orig/novaclient/client.py ++++ python-novaclient-2.22.0/novaclient/client.py +@@ -51,7 +51,7 @@ class TCPKeepAliveAdapter(adapters.HTTPA + def init_poolmanager(self, *args, **kwargs): + if requests.__version__ >= '2.4.1': + kwargs.setdefault('socket_options', [ +- (socket.IPROTO_TCP, socket.TCP_NODELAY, 1), ++ (socket.IPPROTO_TCP, socket.TCP_NODELAY, 1), + (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1), + ]) + super(TCPKeepAliveAdapter, self).init_poolmanager(*args, **kwargs) diff -Nru python-novaclient-2.22.0/debian/patches/series python-novaclient-2.22.0/debian/patches/series --- python-novaclient-2.22.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ python-novaclient-2.22.0/debian/patches/series 2015-11-09 21:38:25.000000000 +0000 @@ -0,0 +1,2 @@ +Fix-typo-in-socket-attribute-name.patch +Add-a-test-for-the-TCPKeepAliveAdapter.patch