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-09-25 16:45:04.000000000 +0000 @@ -1,3 +1,9 @@ +python-novaclient (1:2.22.0-0ubuntu2) UNRELEASED; urgency=medium + + * Fix Typo in socket attribute name in TCPKeepAliveAdapter + + -- Bryan Quigley Fri, 25 Sep 2015 16:43:53 +0000 + python-novaclient (1:2.22.0-0ubuntu1) vivid; urgency=medium * New upstream release. diff -Nru python-novaclient-2.22.0/debian/patches/fix_TCPKeepAliveAdapter.patch python-novaclient-2.22.0/debian/patches/fix_TCPKeepAliveAdapter.patch --- python-novaclient-2.22.0/debian/patches/fix_TCPKeepAliveAdapter.patch 1970-01-01 00:00:00.000000000 +0000 +++ python-novaclient-2.22.0/debian/patches/fix_TCPKeepAliveAdapter.patch 2015-09-25 17:00:33.000000000 +0000 @@ -0,0 +1,65 @@ +Description: Fix typo in socket attribute name + + 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'. . + + python-novaclient (1:2.22.0-0ubuntu2) UNRELEASED; urgency=medium + . + * Fix Typo in socket attribute name in TCPKeepAliveAdapter +Author: Bryan Quigley + +--- + +Origin: upstream +Bug: https://bugs.launchpad.net/python-novaclient/+bug/1430935 + +--- 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) +--- 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/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-09-25 16:58:45.000000000 +0000 @@ -0,0 +1 @@ +fix_TCPKeepAliveAdapter.patch