)]}'
{"nova/tests/unit/volume/test_cinder.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"acc1facf53c7b315eefda4fcf4f1e8d4ca0088f6","unresolved":false,"context_lines":[{"line_number":730,"context_line":"        # Mock out the keystoneauth stuff."},{"line_number":731,"context_line":"        self.mock_session \u003d mock.Mock("},{"line_number":732,"context_line":"            autospec\u003d\u0027keystoneauth1.loading.session.Session\u0027)"},{"line_number":733,"context_line":"        load_session \u003d mock.patch(\u0027keystoneauth1.loading.\u0027"},{"line_number":734,"context_line":"                                  \u0027load_session_from_conf_options\u0027,"},{"line_number":735,"context_line":"                                  return_value\u003dself.mock_session).start()"},{"line_number":736,"context_line":"        self.addCleanup(load_session.stop)"},{"line_number":737,"context_line":""},{"line_number":738,"context_line":"    @mock.patch(\u0027cinderclient.client.get_volume_api_from_url\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_a987e9b6","line":735,"range":{"start_line":733,"start_character":0,"end_line":735,"end_character":73},"updated":"2017-06-07 14:06:18.000000000","message":"you could just have done something like \n\n  return_value\u003dks.Session(auth\u003dNone) \n\nwhere ks is keystoneauth1.session or you could have made a KeystoneFixture that could be helpful for other times we want to fake clients but meh, okay.","commit_id":"89e95b91c6f7367a28ca1a7ef56c1f864c0f639a"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"d06ebe97da1f1173ac47c05cd503a5d9862d6de8","unresolved":false,"context_lines":[{"line_number":759,"context_line":"            self.mock_session.get_endpoint.return_value)"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    @mock.patch(\u0027cinderclient.client.get_volume_api_from_url\u0027,"},{"line_number":762,"context_line":"                return_value\u003d\u00273\u0027)"},{"line_number":763,"context_line":"    @mock.patch(\u0027cinderclient.client.get_highest_client_server_version\u0027,"},{"line_number":764,"context_line":"                return_value\u003d2.0)   # Fake the case that cinder is really old."},{"line_number":765,"context_line":"    def test_create_v3_client_with_microversion_too_new(self,"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_253d592c","line":762,"updated":"2017-06-06 22:05:56.000000000","message":"This is a bit weird because if v3 is in the keystone catalog, the server supports v3.\nSo I can\u0027t think of a case where the get_highest_client_server_version would be 2.0 if we have v3 in the catalog.","commit_id":"89e95b91c6f7367a28ca1a7ef56c1f864c0f639a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"852b0b9c17d4e8d853cc3d407e6ec3e21e37c404","unresolved":false,"context_lines":[{"line_number":759,"context_line":"            self.mock_session.get_endpoint.return_value)"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    @mock.patch(\u0027cinderclient.client.get_volume_api_from_url\u0027,"},{"line_number":762,"context_line":"                return_value\u003d\u00273\u0027)"},{"line_number":763,"context_line":"    @mock.patch(\u0027cinderclient.client.get_highest_client_server_version\u0027,"},{"line_number":764,"context_line":"                return_value\u003d2.0)   # Fake the case that cinder is really old."},{"line_number":765,"context_line":"    def test_create_v3_client_with_microversion_too_new(self,"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_9f20e09d","line":762,"in_reply_to":"df140735_253d592c","updated":"2017-06-07 10:38:12.000000000","message":"Couldn\u0027t you hit this if you configured nova for v3 using:\n\nCONF.cinder.endpoint_template\n\nBut cinder v3 isn\u0027t available? Because http://git.openstack.org/cgit/openstack/python-cinderclient/tree/cinderclient/client.py#n105 is just parsing the URL, it\u0027s not checking with keystone - hence the TODO from jamielennox in the code.","commit_id":"89e95b91c6f7367a28ca1a7ef56c1f864c0f639a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"acc1facf53c7b315eefda4fcf4f1e8d4ca0088f6","unresolved":false,"context_lines":[{"line_number":777,"context_line":"            self.mock_session.get_endpoint.return_value)"},{"line_number":778,"context_line":""},{"line_number":779,"context_line":"    @mock.patch(\u0027cinderclient.client.get_highest_client_server_version\u0027,"},{"line_number":780,"context_line":"                return_value\u003dfloat(cinder_api_versions.MAX_VERSION))"},{"line_number":781,"context_line":"    @mock.patch(\u0027cinderclient.client.get_volume_api_from_url\u0027,"},{"line_number":782,"context_line":"                return_value\u003d\u00273\u0027)"},{"line_number":783,"context_line":"    def test_create_v3_client_with_microversion_available(self,"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_c917bd51","line":780,"range":{"start_line":780,"start_character":35,"end_line":780,"end_character":67},"updated":"2017-06-07 14:06:18.000000000","message":"FWIW, that works because MAX_VERSION is as of now greater than 3.27 (3.33)","commit_id":"89e95b91c6f7367a28ca1a7ef56c1f864c0f639a"}],"nova/volume/cinder.py":[{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"17609e18258cf550ab82c1d80ef685b02e84685b","unresolved":false,"context_lines":[{"line_number":532,"context_line":"        )"},{"line_number":533,"context_line":""},{"line_number":534,"context_line":"    @translate_volume_exception"},{"line_number":535,"context_line":"    def attachment_create(self, context, volume_id, instance_id,"},{"line_number":536,"context_line":"                          connector\u003dNone):"},{"line_number":537,"context_line":"        \"\"\"Create a volume attachment. This requires microversion \u003e\u003d 3.27."},{"line_number":538,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df140735_91877962","line":535,"range":{"start_line":535,"start_character":8,"end_line":535,"end_character":25},"updated":"2017-05-31 17:07:46.000000000","message":"So where we plan to call this we should fall back to the old flow in case it raises the added exception, right?","commit_id":"375330972a21ef116c9bf5371db20c28e4b1606e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c52e83b6ffa05d3d98d6eac504347a1cc384448a","unresolved":false,"context_lines":[{"line_number":532,"context_line":"        )"},{"line_number":533,"context_line":""},{"line_number":534,"context_line":"    @translate_volume_exception"},{"line_number":535,"context_line":"    def attachment_create(self, context, volume_id, instance_id,"},{"line_number":536,"context_line":"                          connector\u003dNone):"},{"line_number":537,"context_line":"        \"\"\"Create a volume attachment. This requires microversion \u003e\u003d 3.27."},{"line_number":538,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df140735_e72ef3a3","line":535,"range":{"start_line":535,"start_character":8,"end_line":535,"end_character":25},"in_reply_to":"df140735_91877962","updated":"2017-05-31 18:48:13.000000000","message":"See https://review.openstack.org/#/c/469618/ for an example of how I expect this to be used.","commit_id":"375330972a21ef116c9bf5371db20c28e4b1606e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ca38b6e95e2363dc2bfe731fa6646ad92120e086","unresolved":false,"context_lines":[{"line_number":556,"context_line":"                    getattr(attachment, \u0027connection_info\u0027, None)"},{"line_number":557,"context_line":"        \"\"\""},{"line_number":558,"context_line":"        try:"},{"line_number":559,"context_line":"            return cinderclient(context).attachments.create("},{"line_number":560,"context_line":"                volume_id, connector, instance_id)"},{"line_number":561,"context_line":"        except cinder_exception.ClientException as ex:"},{"line_number":562,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":1,"id":"df140735_ee91309b","line":559,"range":{"start_line":559,"start_character":19,"end_line":559,"end_character":31},"updated":"2017-05-31 16:43:40.000000000","message":"pass 3.27 here","commit_id":"375330972a21ef116c9bf5371db20c28e4b1606e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"17609e18258cf550ab82c1d80ef685b02e84685b","unresolved":false,"context_lines":[{"line_number":581,"context_line":"            representing the updated volume attachment."},{"line_number":582,"context_line":"        \"\"\""},{"line_number":583,"context_line":"        try:"},{"line_number":584,"context_line":"            return cinderclient(context).attachments.update("},{"line_number":585,"context_line":"                attachment_id, connector)"},{"line_number":586,"context_line":"        except cinder_exception.ClientException as ex:"},{"line_number":587,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":1,"id":"df140735_51f681fb","line":584,"range":{"start_line":584,"start_character":19,"end_line":584,"end_character":31},"updated":"2017-05-31 17:07:46.000000000","message":"pass 3.27 here","commit_id":"375330972a21ef116c9bf5371db20c28e4b1606e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"17609e18258cf550ab82c1d80ef685b02e84685b","unresolved":false,"context_lines":[{"line_number":594,"context_line":"    @translate_attachment_exception"},{"line_number":595,"context_line":"    def attachment_delete(self, context, attachment_id):"},{"line_number":596,"context_line":"        try:"},{"line_number":597,"context_line":"            cinderclient("},{"line_number":598,"context_line":"                context).attachments.delete(attachment_id)"},{"line_number":599,"context_line":"        except cinder_exception.ClientException as ex:"},{"line_number":600,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":1,"id":"df140735_d1e1712c","line":597,"range":{"start_line":597,"start_character":12,"end_line":597,"end_character":24},"updated":"2017-05-31 17:07:46.000000000","message":"pass 3.27 here","commit_id":"375330972a21ef116c9bf5371db20c28e4b1606e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c52e83b6ffa05d3d98d6eac504347a1cc384448a","unresolved":false,"context_lines":[{"line_number":594,"context_line":"    @translate_attachment_exception"},{"line_number":595,"context_line":"    def attachment_delete(self, context, attachment_id):"},{"line_number":596,"context_line":"        try:"},{"line_number":597,"context_line":"            cinderclient("},{"line_number":598,"context_line":"                context).attachments.delete(attachment_id)"},{"line_number":599,"context_line":"        except cinder_exception.ClientException as ex:"},{"line_number":600,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":1,"id":"df140735_4717df52","line":597,"range":{"start_line":597,"start_character":12,"end_line":597,"end_character":24},"in_reply_to":"df140735_d1e1712c","updated":"2017-05-31 18:48:13.000000000","message":"Yeah I decided to do these methods in a separate change:\n\nhttps://review.openstack.org/#/c/469609/","commit_id":"375330972a21ef116c9bf5371db20c28e4b1606e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a95bb71b50a34c82051c88c4e7e4672ff1afbf0f","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    if version \u003d\u003d \u00272\u0027:"},{"line_number":123,"context_line":"        if microversion is not None:"},{"line_number":124,"context_line":"            # The Cinder v2 API does not support microversions."},{"line_number":125,"context_line":"            raise exception.CinderAPIVersionNotAvailable(version\u003dmicroversion)"},{"line_number":126,"context_line":"        LOG.warning(\"The support for the Cinder API v2 is deprecated, please \""},{"line_number":127,"context_line":"                    \"upgrade to Cinder API v3.\")"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_76eedbb4","line":125,"range":{"start_line":125,"start_character":28,"end_line":125,"end_character":56},"updated":"2017-06-02 10:46:17.000000000","message":"not sure it\u0027s the proper exception to raise but meh it\u0027s a nit.\nI was rather thinking of something like a separate exception, because it\u0027s a very different experience if you ask for a microversion when your Cinder API is just having a v2 version.","commit_id":"89e95b91c6f7367a28ca1a7ef56c1f864c0f639a"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"2a5d65a60b6ebfedebeb816df6bd13955b724d2d","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    if version \u003d\u003d \u00272\u0027:"},{"line_number":123,"context_line":"        if microversion is not None:"},{"line_number":124,"context_line":"            # The Cinder v2 API does not support microversions."},{"line_number":125,"context_line":"            raise exception.CinderAPIVersionNotAvailable(version\u003dmicroversion)"},{"line_number":126,"context_line":"        LOG.warning(\"The support for the Cinder API v2 is deprecated, please \""},{"line_number":127,"context_line":"                    \"upgrade to Cinder API v3.\")"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_a5bcc96c","line":125,"range":{"start_line":125,"start_character":28,"end_line":125,"end_character":56},"in_reply_to":"df140735_76eedbb4","updated":"2017-06-06 22:15:05.000000000","message":"I think it\u0027s a good enough starting point.\n\nI\u0027m also unsure at this point how much users are aware when micorversions got introduced in Cinder so it might be good overall, but I understand the concern with this. We can get back to this if the patch needs another iteration or in a follow up patch.","commit_id":"89e95b91c6f7367a28ca1a7ef56c1f864c0f639a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"852b0b9c17d4e8d853cc3d407e6ec3e21e37c404","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    if version \u003d\u003d \u00272\u0027:"},{"line_number":123,"context_line":"        if microversion is not None:"},{"line_number":124,"context_line":"            # The Cinder v2 API does not support microversions."},{"line_number":125,"context_line":"            raise exception.CinderAPIVersionNotAvailable(version\u003dmicroversion)"},{"line_number":126,"context_line":"        LOG.warning(\"The support for the Cinder API v2 is deprecated, please \""},{"line_number":127,"context_line":"                    \"upgrade to Cinder API v3.\")"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_2458a954","line":125,"range":{"start_line":125,"start_character":28,"end_line":125,"end_character":56},"in_reply_to":"df140735_a5bcc96c","updated":"2017-06-07 10:38:12.000000000","message":"The point is the caller needs to handle it the same, if it\u0027s talking to cinder v2 (no microversions) or cinder v3 before the requested microversion. In the compute API we\u0027re going to call this during volume attach and handle this exception to determine that we need to fallback to the old way of doing attachments. So that\u0027s why it\u0027s the same exception both ways.","commit_id":"89e95b91c6f7367a28ca1a7ef56c1f864c0f639a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ecf9f2b239431917fa5f577242dfc91b456edf44","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    if max_api_version.matches(microversion):"},{"line_number":77,"context_line":"        # The requested microversion is supported by the client and the server."},{"line_number":78,"context_line":"        return microversion"},{"line_number":79,"context_line":"    raise exception.CinderAPIVersionNotAvailable(version\u003dmicroversion)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"def cinderclient(context, microversion\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf091321_d7b51af0","line":79,"updated":"2017-06-08 14:49:42.000000000","message":"Its tempting to catch this actually, as we do create the cinder clients very frequently, but that can be a follow on thing.","commit_id":"d655179182b708aa8566b810b77951e1cb3aab19"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5d32c24ea5bc1d909e60c82256625612b6511a33","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    if max_api_version.matches(microversion):"},{"line_number":77,"context_line":"        # The requested microversion is supported by the client and the server."},{"line_number":78,"context_line":"        return microversion"},{"line_number":79,"context_line":"    raise exception.CinderAPIVersionNotAvailable(version\u003dmicroversion)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"def cinderclient(context, microversion\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf091321_b788661f","line":79,"in_reply_to":"bf091321_d7b51af0","updated":"2017-06-08 14:52:00.000000000","message":"We are catching it and fall back to the old flow if the requested version is not available. You can see an example here: https://review.openstack.org/#/c/330285/47/nova/compute/api.py","commit_id":"d655179182b708aa8566b810b77951e1cb3aab19"}]}
