)]}'
{"climate/api/context.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f03d81b4d3b488bbe91ae99df1b1c65b5fc699","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"def ctx_from_headers(headers):"},{"line_number":22,"context_line":"    service_catalog \u003d json.loads(headers[\u0027X-Service-Catalog\u0027])"},{"line_number":23,"context_line":"    return context.ClimateContext("},{"line_number":24,"context_line":"        user_id\u003dheaders[\u0027X-User-Id\u0027],"},{"line_number":25,"context_line":"        tenant_id\u003dheaders[\u0027X-Tenant-Id\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9WxY%3D","line":22,"updated":"2013-12-12 11:03:42.000000000","message":"please try/except this section","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"43a8c41ca38805394e7d30ad3225bea844e08973","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"def ctx_from_headers(headers):"},{"line_number":22,"context_line":"    service_catalog \u003d json.loads(headers[\u0027X-Service-Catalog\u0027])"},{"line_number":23,"context_line":"    return context.ClimateContext("},{"line_number":24,"context_line":"        user_id\u003dheaders[\u0027X-User-Id\u0027],"},{"line_number":25,"context_line":"        tenant_id\u003dheaders[\u0027X-Tenant-Id\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9KRw%3D","line":22,"in_reply_to":"AAAATn%2F9WxY%3D","updated":"2013-12-16 06:32:57.000000000","message":"+1","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"364554dd35c90d7a7ac617ff3f2295b7e7372b10","unresolved":false,"context_lines":[{"line_number":22,"context_line":"def ctx_from_headers(headers):"},{"line_number":23,"context_line":"    try:"},{"line_number":24,"context_line":"        service_catalog \u003d json.loads(headers[\u0027X-Service-Catalog\u0027])"},{"line_number":25,"context_line":"    except Exception:"},{"line_number":26,"context_line":"        raise exceptions.NoServiceCatalog()"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    return context.ClimateContext("}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F889E%3D","line":25,"updated":"2013-12-18 13:15:31.000000000","message":"please catch two specific Exceptions, sorry if I missed to mention it.\n\nexcept KeyError: (if the header is missing)\n\nexcept ValueError: (if the content of the header is not JSON)","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e51cc2fae949667c8d0455b9843040e97c386f8e","unresolved":false,"context_lines":[{"line_number":22,"context_line":"def ctx_from_headers(headers):"},{"line_number":23,"context_line":"    try:"},{"line_number":24,"context_line":"        service_catalog \u003d json.loads(headers[\u0027X-Service-Catalog\u0027])"},{"line_number":25,"context_line":"    except Exception:"},{"line_number":26,"context_line":"        raise exceptions.NoServiceCatalog()"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    return context.ClimateContext("}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F84NU%3D","line":25,"in_reply_to":"AAAATn%2F84%2Bs%3D","updated":"2013-12-19 09:44:50.000000000","message":"ValueError is raised by json.loads in case of a malformed JSON.\n\nWe can\u0027t exclude the user intentionnally produces bad JSON in headers to harness the API.","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"30ea214d0faf3484f1b4290b13b4596f4e13759e","unresolved":false,"context_lines":[{"line_number":22,"context_line":"def ctx_from_headers(headers):"},{"line_number":23,"context_line":"    try:"},{"line_number":24,"context_line":"        service_catalog \u003d json.loads(headers[\u0027X-Service-Catalog\u0027])"},{"line_number":25,"context_line":"    except Exception:"},{"line_number":26,"context_line":"        raise exceptions.NoServiceCatalog()"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    return context.ClimateContext("}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F84%2Bs%3D","line":25,"in_reply_to":"AAAATn%2F889E%3D","updated":"2013-12-19 05:36:37.000000000","message":"Thank you about this notice - it was some sort of draft and I forgot to fix it. Do you think that catching Value Error is a good thing? Can\u0027t imagine the case.","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"}],"climate/exceptions.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"364554dd35c90d7a7ac617ff3f2295b7e7372b10","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    msg_fmt \u003d _(\"Could not find config at %(path)s\")"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"class NoServiceCatalog(ClimateException):"},{"line_number":74,"context_line":"    msg_fmt \u003d _(\"Could not find service catalog\")"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F88%2BQ%3D","line":73,"updated":"2013-12-18 13:15:31.000000000","message":"please rename to ServiceCatalogNotFound inheriting from NotFound","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"30ea214d0faf3484f1b4290b13b4596f4e13759e","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    msg_fmt \u003d _(\"Could not find config at %(path)s\")"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"class NoServiceCatalog(ClimateException):"},{"line_number":74,"context_line":"    msg_fmt \u003d _(\"Could not find service catalog\")"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F84%2BU%3D","line":73,"in_reply_to":"AAAATn%2F88%2BQ%3D","updated":"2013-12-19 05:36:37.000000000","message":"okay","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"364554dd35c90d7a7ac617ff3f2295b7e7372b10","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    msg_fmt \u003d _(\"Could not find service catalog\")"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"class NoEndpoints(ClimateException):"},{"line_number":78,"context_line":"    msg_fmt \u003d _(\"No endpoints for %(service)s\")"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F88%2BI%3D","line":77,"updated":"2013-12-18 13:15:31.000000000","message":"ditto","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"364554dd35c90d7a7ac617ff3f2295b7e7372b10","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    msg_fmt \u003d _(\"No endpoints for %(service)s\")"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"class NoService(ClimateException):"},{"line_number":82,"context_line":"    msg_fmt \u003d _(\"Service %(service)s not found\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F88%2BE%3D","line":81,"updated":"2013-12-18 13:15:31.000000000","message":"ditto","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"f21811f1dd62d5d95f57905441dd2bedc3f6afac","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    msg_fmt \u003d _(\"Could not find config at %(path)s\")"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"class ServiceCatalogNotFound(NotFound):"},{"line_number":74,"context_line":"    msg_fmt \u003d _(\"Could not find service catalog\")"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAUH%2F%2B%2FqY%3D","line":73,"updated":"2014-01-19 21:12:18.000000000","message":"if these 4 below Exceptions are raised on the Manager side, they need to be pushed in a separate file, here https://review.openstack.org/#/c/63445/1/climate/manager/exceptions.py\n\nThis patch consequently needs a dependency on 63445 (see my global comment for further details)","commit_id":"bd0f9c584ad428b6740a2e55c0eb82913c7a4241"}],"climate/tests/utils/openstack/test_keystone.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"ce5f3a027146d5ec73356c3c0d7332abb2b5e3b9","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        self.keystone.ClimateKeystoneClient(version\u003dself.version,"},{"line_number":51,"context_line":"                                            username\u003dself.username,"},{"line_number":52,"context_line":"                                            password\u003dself.password,"},{"line_number":53,"context_line":"                                            tenant\u003dself.tenant_name,"},{"line_number":54,"context_line":"                                            auth_url\u003dself.auth_url)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        self.client.assert_called_once_with(version\u003dself.version,"}],"source_content_type":"text/x-python","patch_set":41,"id":"AAAAUH%2F%2Bz0Q%3D","line":53,"updated":"2014-01-21 22:38:12.000000000","message":"typo : tenant_name instead of tenant","commit_id":"3e800b3ac68bff40ca9b89967936081027ae89ed"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"ce5f3a027146d5ec73356c3c0d7332abb2b5e3b9","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                                            auth_url\u003dself.auth_url)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        self.client.assert_called_once_with(version\u003dself.version,"},{"line_number":57,"context_line":"                                            tenant\u003dself.tenant_name,"},{"line_number":58,"context_line":"                                            username\u003dself.username,"},{"line_number":59,"context_line":"                                            password\u003dself.password,"},{"line_number":60,"context_line":"                                            auth_url\u003dself.auth_url)"}],"source_content_type":"text/x-python","patch_set":41,"id":"AAAAUH%2F%2Bz0I%3D","line":57,"updated":"2014-01-21 22:38:12.000000000","message":"ditto L53","commit_id":"3e800b3ac68bff40ca9b89967936081027ae89ed"}],"climate/tests/utils/openstack/test_nova.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0a5884c99f01fddce83961f498795a2339aad3a5","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def test_client_from_kwargs(self):"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        kwargs \u003d {\u0027version\u0027: self.version,"},{"line_number":46,"context_line":"                  \u0027username\u0027: self.username,"},{"line_number":47,"context_line":"                  \u0027token\u0027: self.token,"},{"line_number":48,"context_line":"                  \u0027tenant_id\u0027: self.tenant_id,"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FF%2Bo%3D","line":45,"updated":"2014-01-17 14:57:42.000000000","message":"kwargs don\u0027t match what is expected by ClimateNovaClient, see https://review.openstack.org/#/c/52296/30/climate/utils/openstack/nova.py L39\n\nConsequently, tests are always saying OK, while it\u0027s not...","commit_id":"e51c6912628707838b7bc1a476a1389ce1e4c35d"}],"climate/utils/openstack/__init__.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e6d08a978dbbd2971d829032aa66d74355fb227e","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 Mirantis Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9plU%3D","line":1,"updated":"2013-12-09 10:16:41.000000000","message":"no code \u003d empty file :-)","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"839b01ecf1c3bc7e326d60295bceae73e8f8af11","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 Mirantis Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9jvo%3D","line":1,"in_reply_to":"AAAATn%2F9pJU%3D","updated":"2013-12-10 09:15:32.000000000","message":"Sorry, guys - don\u0027t look at this file before. Do it in next patchset","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"c807903819ba629db39f9d11d9f75404f6836870","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 Mirantis Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9pJU%3D","line":1,"in_reply_to":"AAAATn%2F9plU%3D","updated":"2013-12-09 11:44:55.000000000","message":"Yes, as decided.","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"}],"climate/utils/openstack/base.py":[{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"073cecf9ea7a300a62918eb680ce673112a305ed","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    \"\"\"Takes one of the identity endpoints to use.\"\"\""},{"line_number":52,"context_line":"    for endpoint in identity_service[\u0027endpoints\u0027]:"},{"line_number":53,"context_line":"        if \u0027v3\u0027 in endpoint[\u0027url\u0027] and \\"},{"line_number":54,"context_line":"           endpoint[\u0027interface\u0027] \u003d\u003d endpoint_interface:"},{"line_number":55,"context_line":"            return endpoint"},{"line_number":56,"context_line":"    raise Exception(\u0027Api %s endpoint not found in service %s\u0027"},{"line_number":57,"context_line":"                    % (endpoint_interface, identity_service[\u0027type\u0027]))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FVwU%3D","line":54,"updated":"2013-10-17 15:10:06.000000000","message":"keystone v3 specific","commit_id":"7d6c5989e3d62beb65b6ff83fb6da7451ad6bf54"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"25f6cb4fbd14a3218521d16f6bbe0b334441b711","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def _get_service_from_catalog(catalog, service_type):"},{"line_number":44,"context_line":"    \"\"\"Parses JSON catalog string and returns info about needed service.\"\"\""},{"line_number":45,"context_line":"    if catalog:"},{"line_number":46,"context_line":"        catalog \u003d json.loads(catalog)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2Bm8Y%3D","line":43,"updated":"2013-11-22 15:04:54.000000000","message":"Service catalog should be directly exposed as a dict in the Context, and then this method would only be an helper for getting the right value based on the key.","commit_id":"71b81052441494e74830ec67df58de81a65d1964"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"6db5b0edbd5a0a2990df671f7606de901d559214","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def _get_service_from_catalog(catalog, service_type):"},{"line_number":44,"context_line":"    \"\"\"Parses JSON catalog string and returns info about needed service.\"\"\""},{"line_number":45,"context_line":"    if catalog:"},{"line_number":46,"context_line":"        catalog \u003d json.loads(catalog)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9qIo%3D","line":43,"in_reply_to":"AAAATn%2F%2Bm8Y%3D","updated":"2013-12-09 07:12:07.000000000","message":"Can you explain me this comment? I think I don\u0027t really get it","commit_id":"71b81052441494e74830ec67df58de81a65d1964"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e6d08a978dbbd2971d829032aa66d74355fb227e","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 Mirantis Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9pi0%3D","line":1,"updated":"2013-12-09 10:16:41.000000000","message":"I would prefer base.py to be renamed to utils.py or common.py\n\n\u0027Base\u0027 word is often used for inheritance, I wand to prevent confusion","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e6d08a978dbbd2971d829032aa66d74355fb227e","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    service \u003d _get_service_from_catalog(service_catalog, service_type)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    if service:"},{"line_number":30,"context_line":"        endpoints \u003d service[\u0027endpoints\u0027]"},{"line_number":31,"context_line":"        try:"},{"line_number":32,"context_line":"            # if Keystone API v3 endpoints returned"},{"line_number":33,"context_line":"            endpoint \u003d [e for e in endpoints"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9pkw%3D","line":30,"updated":"2013-12-09 10:16:41.000000000","message":"ditto to L38","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e6d08a978dbbd2971d829032aa66d74355fb227e","unresolved":false,"context_lines":[{"line_number":35,"context_line":"            return endpoint[\u0027url\u0027]"},{"line_number":36,"context_line":"        except KeyError:"},{"line_number":37,"context_line":"            # otherwise"},{"line_number":38,"context_line":"            return endpoints[0][\u0027%sURL\u0027 % endpoint_interface]"},{"line_number":39,"context_line":"    else:"},{"line_number":40,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9pk0%3D","line":38,"updated":"2013-12-09 10:16:41.000000000","message":"you can still get a KeyError here that must be handled","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"ca662fff7a83b3172c4672d9e5f31d955de00083","unresolved":false,"context_lines":[{"line_number":35,"context_line":"            return endpoint[\u0027url\u0027]"},{"line_number":36,"context_line":"        except KeyError:"},{"line_number":37,"context_line":"            # otherwise"},{"line_number":38,"context_line":"            return endpoints[0][\u0027%sURL\u0027 % endpoint_interface]"},{"line_number":39,"context_line":"    else:"},{"line_number":40,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9jhw%3D","line":38,"in_reply_to":"AAAATn%2F9ju8%3D","updated":"2013-12-10 09:54:17.000000000","message":"I think so, yes. In any other case there will be other error from Keystone earlier.","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"839b01ecf1c3bc7e326d60295bceae73e8f8af11","unresolved":false,"context_lines":[{"line_number":35,"context_line":"            return endpoint[\u0027url\u0027]"},{"line_number":36,"context_line":"        except KeyError:"},{"line_number":37,"context_line":"            # otherwise"},{"line_number":38,"context_line":"            return endpoints[0][\u0027%sURL\u0027 % endpoint_interface]"},{"line_number":39,"context_line":"    else:"},{"line_number":40,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9ju8%3D","line":38,"in_reply_to":"AAAATn%2F9pIw%3D","updated":"2013-12-10 09:15:32.000000000","message":"So, there is no need to handle anything?","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"c807903819ba629db39f9d11d9f75404f6836870","unresolved":false,"context_lines":[{"line_number":35,"context_line":"            return endpoint[\u0027url\u0027]"},{"line_number":36,"context_line":"        except KeyError:"},{"line_number":37,"context_line":"            # otherwise"},{"line_number":38,"context_line":"            return endpoints[0][\u0027%sURL\u0027 % endpoint_interface]"},{"line_number":39,"context_line":"    else:"},{"line_number":40,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9pIw%3D","line":38,"in_reply_to":"AAAATn%2F9pk0%3D","updated":"2013-12-09 11:44:55.000000000","message":"There is no possibility to have here KeyError for other cases. Keystone will return endpoints anyway, but there can be different types of its look.","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e6d08a978dbbd2971d829032aa66d74355fb227e","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def _get_service_from_catalog(catalog, service_type):"},{"line_number":44,"context_line":"    \"\"\"Parses JSON catalog string and returns info about needed service.\"\"\""},{"line_number":45,"context_line":"    if catalog:"},{"line_number":46,"context_line":"        catalog \u003d json.loads(catalog)"},{"line_number":47,"context_line":"        for service in catalog:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9pfs%3D","line":44,"updated":"2013-12-09 10:16:41.000000000","message":"This function is called with the context catalog as parameter. Instead of deserializing at this level, we should deserialize at the API level when receiving the headers so that the service catalog would directly be a dict object with key/values.","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"ca662fff7a83b3172c4672d9e5f31d955de00083","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def _get_service_from_catalog(catalog, service_type):"},{"line_number":44,"context_line":"    \"\"\"Parses JSON catalog string and returns info about needed service.\"\"\""},{"line_number":45,"context_line":"    if catalog:"},{"line_number":46,"context_line":"        catalog \u003d json.loads(catalog)"},{"line_number":47,"context_line":"        for service in catalog:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9jhQ%3D","line":44,"in_reply_to":"AAAATn%2F9jug%3D","updated":"2013-12-10 09:54:17.000000000","message":"I suppose you may provide changes to the context class itself it the separated change request. Like we pass there JSON string and Context is trying to parse it. Or, as Sylvain proposes, on the API level where context is created - just pass prepared dict to the __init__ method. I love the 2nd variant.","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"839b01ecf1c3bc7e326d60295bceae73e8f8af11","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def _get_service_from_catalog(catalog, service_type):"},{"line_number":44,"context_line":"    \"\"\"Parses JSON catalog string and returns info about needed service.\"\"\""},{"line_number":45,"context_line":"    if catalog:"},{"line_number":46,"context_line":"        catalog \u003d json.loads(catalog)"},{"line_number":47,"context_line":"        for service in catalog:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9jug%3D","line":44,"in_reply_to":"AAAATn%2F9pIo%3D","updated":"2013-12-10 09:15:32.000000000","message":"So, can I just mova this func to other level. That\u0027s what you are talking about?","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"c807903819ba629db39f9d11d9f75404f6836870","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def _get_service_from_catalog(catalog, service_type):"},{"line_number":44,"context_line":"    \"\"\"Parses JSON catalog string and returns info about needed service.\"\"\""},{"line_number":45,"context_line":"    if catalog:"},{"line_number":46,"context_line":"        catalog \u003d json.loads(catalog)"},{"line_number":47,"context_line":"        for service in catalog:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9pIo%3D","line":44,"in_reply_to":"AAAATn%2F9pfs%3D","updated":"2013-12-09 11:44:55.000000000","message":"Agreed.","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f03d81b4d3b488bbe91ae99df1b1c65b5fc699","unresolved":false,"context_lines":[{"line_number":18,"context_line":"            endpoint_interface\u003dNone):"},{"line_number":19,"context_line":"    \"\"\"Gets url of the service to communicate through.\"\"\""},{"line_number":20,"context_line":"    if not endpoint_interface:"},{"line_number":21,"context_line":"        endpoint_interface \u003d \u0027public\u0027"},{"line_number":22,"context_line":"    if admin:"},{"line_number":23,"context_line":"        endpoint_interface \u003d \u0027admin\u0027"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9WpI%3D","line":21,"updated":"2013-12-12 11:03:42.000000000","message":"I\u0027m not sure these values should be hardcoded with \u0027public\u0027 and \u0027admin\u0027","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"43a8c41ca38805394e7d30ad3225bea844e08973","unresolved":false,"context_lines":[{"line_number":18,"context_line":"            endpoint_interface\u003dNone):"},{"line_number":19,"context_line":"    \"\"\"Gets url of the service to communicate through.\"\"\""},{"line_number":20,"context_line":"    if not endpoint_interface:"},{"line_number":21,"context_line":"        endpoint_interface \u003d \u0027public\u0027"},{"line_number":22,"context_line":"    if admin:"},{"line_number":23,"context_line":"        endpoint_interface \u003d \u0027admin\u0027"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9KRU%3D","line":21,"in_reply_to":"AAAATn%2F9Lns%3D","updated":"2013-12-16 06:32:57.000000000","message":"Sylvain, we are not creating these endpoint types :) They are returned from Keystone :) It\u0027s Keystone format: \"admin\", \"public\", \"internal\". The last we cannot use here :) We cannot do nothing with that :)","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"554a233a0ad79971d3c09aa5d34f57219b7444ed","unresolved":false,"context_lines":[{"line_number":18,"context_line":"            endpoint_interface\u003dNone):"},{"line_number":19,"context_line":"    \"\"\"Gets url of the service to communicate through.\"\"\""},{"line_number":20,"context_line":"    if not endpoint_interface:"},{"line_number":21,"context_line":"        endpoint_interface \u003d \u0027public\u0027"},{"line_number":22,"context_line":"    if admin:"},{"line_number":23,"context_line":"        endpoint_interface \u003d \u0027admin\u0027"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9Lns%3D","line":21,"in_reply_to":"AAAATn%2F9WpI%3D","updated":"2013-12-15 14:41:04.000000000","message":"well, as I know it\u0027s okay to use \"public\" and \"admin\" endpoints.","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f03d81b4d3b488bbe91ae99df1b1c65b5fc699","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    service \u003d _get_service_from_catalog(service_catalog, service_type)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    if service:"},{"line_number":28,"context_line":"        endpoints \u003d service[\u0027endpoints\u0027]"},{"line_number":29,"context_line":"        try:"},{"line_number":30,"context_line":"            # if Keystone API v3 endpoints returned"},{"line_number":31,"context_line":"            endpoint \u003d [e for e in endpoints"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9Wno%3D","line":28,"updated":"2013-12-12 11:03:42.000000000","message":"you can possibly get a KeyError, please catch it.","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"6199931ce951240e6f4bb36c3f0b9c2310d27654","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    service \u003d _get_service_from_catalog(service_catalog, service_type)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    if service:"},{"line_number":28,"context_line":"        endpoints \u003d service[\u0027endpoints\u0027]"},{"line_number":29,"context_line":"        try:"},{"line_number":30,"context_line":"            # if Keystone API v3 endpoints returned"},{"line_number":31,"context_line":"            endpoint \u003d [e for e in endpoints"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9JvM%3D","line":28,"in_reply_to":"AAAATn%2F9KQ0%3D","updated":"2013-12-16 09:19:54.000000000","message":"Done","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"43a8c41ca38805394e7d30ad3225bea844e08973","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    service \u003d _get_service_from_catalog(service_catalog, service_type)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    if service:"},{"line_number":28,"context_line":"        endpoints \u003d service[\u0027endpoints\u0027]"},{"line_number":29,"context_line":"        try:"},{"line_number":30,"context_line":"            # if Keystone API v3 endpoints returned"},{"line_number":31,"context_line":"            endpoint \u003d [e for e in endpoints"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9KQ0%3D","line":28,"in_reply_to":"AAAATn%2F9Wno%3D","updated":"2013-12-16 06:32:57.000000000","message":"I can imagine really hard case when service won\u0027t have endpoints in Keystone, but that\u0027s possible. Nick, please, catch KeyError here.","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"554a233a0ad79971d3c09aa5d34f57219b7444ed","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    service \u003d _get_service_from_catalog(service_catalog, service_type)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    if service:"},{"line_number":28,"context_line":"        endpoints \u003d service[\u0027endpoints\u0027]"},{"line_number":29,"context_line":"        try:"},{"line_number":30,"context_line":"            # if Keystone API v3 endpoints returned"},{"line_number":31,"context_line":"            endpoint \u003d [e for e in endpoints"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9Lnk%3D","line":28,"in_reply_to":"AAAATn%2F9Wno%3D","updated":"2013-12-15 14:41:04.000000000","message":"don\u0027t think so - if we have service we\u0027ve also have an endpoint for this. I think that if we have some problems with it - it should be caught in other service, not in Climate.","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f03d81b4d3b488bbe91ae99df1b1c65b5fc699","unresolved":false,"context_lines":[{"line_number":33,"context_line":"            return endpoint[\u0027url\u0027]"},{"line_number":34,"context_line":"        except KeyError:"},{"line_number":35,"context_line":"            # otherwise"},{"line_number":36,"context_line":"            return endpoints[0][\u0027%sURL\u0027 % endpoint_interface]"},{"line_number":37,"context_line":"    else:"},{"line_number":38,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9WoM%3D","line":36,"updated":"2013-12-12 11:03:42.000000000","message":"You could still get an error with endpoints[0]","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"43a8c41ca38805394e7d30ad3225bea844e08973","unresolved":false,"context_lines":[{"line_number":33,"context_line":"            return endpoint[\u0027url\u0027]"},{"line_number":34,"context_line":"        except KeyError:"},{"line_number":35,"context_line":"            # otherwise"},{"line_number":36,"context_line":"            return endpoints[0][\u0027%sURL\u0027 % endpoint_interface]"},{"line_number":37,"context_line":"    else:"},{"line_number":38,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9KQY%3D","line":36,"in_reply_to":"AAAATn%2F9WoM%3D","updated":"2013-12-16 06:32:57.000000000","message":"If there are endpoints (Nick will catch KeyError earlier) they will be here, I suppose anyway.","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f03d81b4d3b488bbe91ae99df1b1c65b5fc699","unresolved":false,"context_lines":[{"line_number":35,"context_line":"            # otherwise"},{"line_number":36,"context_line":"            return endpoints[0][\u0027%sURL\u0027 % endpoint_interface]"},{"line_number":37,"context_line":"    else:"},{"line_number":38,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _get_service_from_catalog(catalog, service_type):"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9Woc%3D","line":38,"updated":"2013-12-12 11:03:42.000000000","message":"please raise an Exception inheriting from ClimateException","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"6199931ce951240e6f4bb36c3f0b9c2310d27654","unresolved":false,"context_lines":[{"line_number":35,"context_line":"            # otherwise"},{"line_number":36,"context_line":"            return endpoints[0][\u0027%sURL\u0027 % endpoint_interface]"},{"line_number":37,"context_line":"    else:"},{"line_number":38,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _get_service_from_catalog(catalog, service_type):"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9JvA%3D","line":38,"in_reply_to":"AAAATn%2F9KQQ%3D","updated":"2013-12-16 09:19:54.000000000","message":"Done","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"43a8c41ca38805394e7d30ad3225bea844e08973","unresolved":false,"context_lines":[{"line_number":35,"context_line":"            # otherwise"},{"line_number":36,"context_line":"            return endpoints[0][\u0027%sURL\u0027 % endpoint_interface]"},{"line_number":37,"context_line":"    else:"},{"line_number":38,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _get_service_from_catalog(catalog, service_type):"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9KQQ%3D","line":38,"in_reply_to":"AAAATn%2F9LnU%3D","updated":"2013-12-16 06:32:57.000000000","message":"Please create expect ion here and use it. It will just reduce work to be done later.","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"554a233a0ad79971d3c09aa5d34f57219b7444ed","unresolved":false,"context_lines":[{"line_number":35,"context_line":"            # otherwise"},{"line_number":36,"context_line":"            return endpoints[0][\u0027%sURL\u0027 % endpoint_interface]"},{"line_number":37,"context_line":"    else:"},{"line_number":38,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _get_service_from_catalog(catalog, service_type):"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9LnU%3D","line":38,"in_reply_to":"AAAATn%2F9Woc%3D","updated":"2013-12-15 14:41:04.000000000","message":"I suppose that we should make another patch with solved exception issue (I mean all exceptions in all file, and fix this issue also). What do you think about it?","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f03d81b4d3b488bbe91ae99df1b1c65b5fc699","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _get_service_from_catalog(catalog, service_type):"},{"line_number":42,"context_line":"    \"\"\"Parses JSON catalog string and returns info about needed service.\"\"\""},{"line_number":43,"context_line":"    for service in catalog:"},{"line_number":44,"context_line":"        if service[\u0027type\u0027] \u003d\u003d service_type:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9Wnw%3D","line":41,"updated":"2013-12-12 11:03:42.000000000","message":"As you simplified the getter from catalog, maybe this function is useless (or change it to public) and all should be provided in url_for()","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"6199931ce951240e6f4bb36c3f0b9c2310d27654","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _get_service_from_catalog(catalog, service_type):"},{"line_number":42,"context_line":"    \"\"\"Parses JSON catalog string and returns info about needed service.\"\"\""},{"line_number":43,"context_line":"    for service in catalog:"},{"line_number":44,"context_line":"        if service[\u0027type\u0027] \u003d\u003d service_type:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9J0A%3D","line":41,"in_reply_to":"AAAATn%2F9KQI%3D","updated":"2013-12-16 09:19:54.000000000","message":"Done","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"43a8c41ca38805394e7d30ad3225bea844e08973","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _get_service_from_catalog(catalog, service_type):"},{"line_number":42,"context_line":"    \"\"\"Parses JSON catalog string and returns info about needed service.\"\"\""},{"line_number":43,"context_line":"    for service in catalog:"},{"line_number":44,"context_line":"        if service[\u0027type\u0027] \u003d\u003d service_type:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9KQI%3D","line":41,"in_reply_to":"AAAATn%2F9Wnw%3D","updated":"2013-12-16 06:32:57.000000000","message":"+1","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"554a233a0ad79971d3c09aa5d34f57219b7444ed","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        raise Exception(\u0027Service \"%s\" not found\u0027 % service_type)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _get_service_from_catalog(catalog, service_type):"},{"line_number":42,"context_line":"    \"\"\"Parses JSON catalog string and returns info about needed service.\"\"\""},{"line_number":43,"context_line":"    for service in catalog:"},{"line_number":44,"context_line":"        if service[\u0027type\u0027] \u003d\u003d service_type:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9LnI%3D","line":41,"in_reply_to":"AAAATn%2F9Wnw%3D","updated":"2013-12-15 14:41:04.000000000","message":"May be.","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f03d81b4d3b488bbe91ae99df1b1c65b5fc699","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _get_service_from_catalog(catalog, service_type):"},{"line_number":42,"context_line":"    \"\"\"Parses JSON catalog string and returns info about needed service.\"\"\""},{"line_number":43,"context_line":"    for service in catalog:"},{"line_number":44,"context_line":"        if service[\u0027type\u0027] \u003d\u003d service_type:"},{"line_number":45,"context_line":"            return service"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9Wog%3D","line":42,"updated":"2013-12-12 11:03:42.000000000","message":"Comment is incorrect","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"554a233a0ad79971d3c09aa5d34f57219b7444ed","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _get_service_from_catalog(catalog, service_type):"},{"line_number":42,"context_line":"    \"\"\"Parses JSON catalog string and returns info about needed service.\"\"\""},{"line_number":43,"context_line":"    for service in catalog:"},{"line_number":44,"context_line":"        if service[\u0027type\u0027] \u003d\u003d service_type:"},{"line_number":45,"context_line":"            return service"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9LnQ%3D","line":42,"in_reply_to":"AAAATn%2F9Wog%3D","updated":"2013-12-15 14:41:04.000000000","message":"Done","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"364554dd35c90d7a7ac617ff3f2295b7e7372b10","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"def url_for(service_catalog, service_type, admin\u003dFalse,"},{"line_number":20,"context_line":"            endpoint_interface\u003dNone):"},{"line_number":21,"context_line":"    \"\"\"Gets url of the service to communicate through.\"\"\""},{"line_number":22,"context_line":"    if not endpoint_interface:"},{"line_number":23,"context_line":"        endpoint_interface \u003d \u0027public\u0027"},{"line_number":24,"context_line":"    if admin:"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F8874%3D","line":21,"updated":"2013-12-18 13:15:31.000000000","message":"it\u0027s worth mentioning as docstrings the params and their type, especially for service_catalog which needs to be a dict","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0bbdb94e97c16c6ee9bcf8695d5d859413b3ba21","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"def url_for(service_catalog, service_type, admin\u003dFalse,"},{"line_number":20,"context_line":"            endpoint_interface\u003dNone):"},{"line_number":21,"context_line":"    \"\"\"Gets url of the service to communicate through.\"\"\""},{"line_number":22,"context_line":"    if not endpoint_interface:"},{"line_number":23,"context_line":"        endpoint_interface \u003d \u0027public\u0027"},{"line_number":24,"context_line":"    if admin:"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F83i4%3D","line":21,"in_reply_to":"AAAATn%2F834o%3D","updated":"2013-12-19 11:59:34.000000000","message":"+1 for opening a bug to this, but for that case, that\u0027s really important we document it asap, as we need to make sure people who want to use it would use it correctly.\n\nOK if we don\u0027t add explicitely a docstring here, but in that case, we should correcty handle the possible exceptions below.","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"ffe4a0c3ad2cdd0fa7fe31ca2cbfe66e56ac0b3b","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"def url_for(service_catalog, service_type, admin\u003dFalse,"},{"line_number":20,"context_line":"            endpoint_interface\u003dNone):"},{"line_number":21,"context_line":"    \"\"\"Gets url of the service to communicate through.\"\"\""},{"line_number":22,"context_line":"    if not endpoint_interface:"},{"line_number":23,"context_line":"        endpoint_interface \u003d \u0027public\u0027"},{"line_number":24,"context_line":"    if admin:"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F834o%3D","line":21,"in_reply_to":"AAAATn%2F8874%3D","updated":"2013-12-19 11:02:43.000000000","message":"That should be done for all code, I suppose, not just here. I believe that it should be written \u0027low\u0027 prioritised bug for it.","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0bbdb94e97c16c6ee9bcf8695d5d859413b3ba21","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    if admin:"},{"line_number":25,"context_line":"        endpoint_interface \u003d \u0027admin\u0027"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    for service in service_catalog:"},{"line_number":28,"context_line":"        if service[\u0027type\u0027] \u003d\u003d service_type:"},{"line_number":29,"context_line":"            return service"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F83i0%3D","line":27,"updated":"2013-12-19 11:59:34.000000000","message":"here, if the service_catalog is not a dict, then it would raise an Exception","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"}],"climate/utils/openstack/keystone.py":[{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"073cecf9ea7a300a62918eb680ce673112a305ed","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import json"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from keystoneclient.v3 import client as keystone_client_v3"},{"line_number":19,"context_line":"from oslo.config import cfg"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from climate import context"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FVwA%3D","line":18,"updated":"2013-10-17 15:10:06.000000000","message":"keystone v3 only","commit_id":"7d6c5989e3d62beb65b6ff83fb6da7451ad6bf54"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"0523253129455981f813a17cfea8ed15620b43bf","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import json"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from keystoneclient.v3 import client as keystone_client_v3"},{"line_number":19,"context_line":"from oslo.config import cfg"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from climate import context"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2F2Y8%3D","line":18,"in_reply_to":"AAAATH%2F%2FVwA%3D","updated":"2013-10-27 15:41:00.000000000","message":"That\u0027s only client, it can make itself for Keystone of any version.","commit_id":"7d6c5989e3d62beb65b6ff83fb6da7451ad6bf54"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"25f6cb4fbd14a3218521d16f6bbe0b334441b711","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import json"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from keystoneclient.v3 import client as keystone_client_v3"},{"line_number":19,"context_line":"from oslo.config import cfg"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from climate import context"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2Bm5M%3D","line":18,"updated":"2013-11-22 15:04:54.000000000","message":"could we try it and except to v2 ?","commit_id":"71b81052441494e74830ec67df58de81a65d1964"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"25f6cb4fbd14a3218521d16f6bbe0b334441b711","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    if not username:"},{"line_number":43,"context_line":"        username \u003d ctx.user_name"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    keystone \u003d keystone_client_v3.Client(username\u003dusername,"},{"line_number":46,"context_line":"                                         token\u003dctx.auth_token,"},{"line_number":47,"context_line":"                                         password\u003dpassword,"},{"line_number":48,"context_line":"                                         tenant_name\u003dtenant_name,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2Bm4s%3D","line":45,"updated":"2013-11-22 15:04:54.000000000","message":"I would propose to change to keystone_client and have a flag for knowing if it\u0027s v3 or v2","commit_id":"71b81052441494e74830ec67df58de81a65d1964"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"8ffcb710f4b6edf35efa42580e5b4a41bb281bd3","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    if not username:"},{"line_number":43,"context_line":"        username \u003d ctx.user_name"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    keystone \u003d keystone_client_v3.Client(username\u003dusername,"},{"line_number":46,"context_line":"                                         token\u003dctx.auth_token,"},{"line_number":47,"context_line":"                                         password\u003dpassword,"},{"line_number":48,"context_line":"                                         tenant_name\u003dtenant_name,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2BH4g%3D","line":45,"in_reply_to":"AAAATn%2F%2Bm4s%3D","updated":"2013-12-02 11:06:32.000000000","message":"That\u0027s version for Client, not Keystone itself. Keystone service itself we may found by identity_service flag defined earlier. This code works good with Keystone API v2.","commit_id":"71b81052441494e74830ec67df58de81a65d1964"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e6d08a978dbbd2971d829032aa66d74355fb227e","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    )"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    ctx.auth_token \u003d keystone_client.auth_token"},{"line_number":71,"context_line":"    ctx.service_catalog \u003d json.dumps("},{"line_number":72,"context_line":"        keystone_client.service_catalog.catalog[\u0027catalog\u0027]"},{"line_number":73,"context_line":"    )"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9pe4%3D","line":71,"updated":"2013-12-09 10:16:41.000000000","message":"see comment about serialization/deserialization on base.py","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"c807903819ba629db39f9d11d9f75404f6836870","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    )"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    ctx.auth_token \u003d keystone_client.auth_token"},{"line_number":71,"context_line":"    ctx.service_catalog \u003d json.dumps("},{"line_number":72,"context_line":"        keystone_client.service_catalog.catalog[\u0027catalog\u0027]"},{"line_number":73,"context_line":"    )"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9pIk%3D","line":71,"in_reply_to":"AAAATn%2F9pe4%3D","updated":"2013-12-09 11:44:55.000000000","message":"+1","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"364554dd35c90d7a7ac617ff3f2295b7e7372b10","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from keystoneclient.v3 import client as keystone_client_v3"},{"line_number":17,"context_line":"from oslo.config import cfg"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from climate import context"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F884s%3D","line":16,"updated":"2013-12-18 13:15:31.000000000","message":"same remark as for Nova, we should use keystoneclient.Client and pass the param in client(version\u003d\u00273\u0027)","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"364554dd35c90d7a7ac617ff3f2295b7e7372b10","unresolved":false,"context_lines":[{"line_number":30,"context_line":"CONF.register_cli_opts(opts)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def client(username\u003dNone, password\u003dNone, trust_id\u003dNone, auth_url\u003dNone,"},{"line_number":34,"context_line":"           tenant\u003dNone, ctx\u003dNone):"},{"line_number":35,"context_line":"    \"\"\"Return Keystone client for defined in \u0027identity_service\u0027 conf.\"\"\""},{"line_number":36,"context_line":"    ctx \u003d ctx or context.ClimateContext.current()"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F887o%3D","line":33,"updated":"2013-12-18 13:15:31.000000000","message":"where are the unittests ? ;-)","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"364554dd35c90d7a7ac617ff3f2295b7e7372b10","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    if not username:"},{"line_number":41,"context_line":"        username \u003d ctx.user_name"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    keystone \u003d keystone_client_v3.Client(username\u003dusername,"},{"line_number":44,"context_line":"                                         token\u003dctx.auth_token,"},{"line_number":45,"context_line":"                                         password\u003dpassword,"},{"line_number":46,"context_line":"                                         tenant_name\u003dtenant_name,"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F884E%3D","line":43,"updated":"2013-12-18 13:15:31.000000000","message":"see above for Client(version...","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dfff5bb5d20494bdf2a535617758329a3d4f4acc","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"class ClimateKeystoneClient(object):"},{"line_number":42,"context_line":"    def __init__(self, username\u003dNone, password\u003dNone, trust_id\u003dNone,"},{"line_number":43,"context_line":"                 auth_url\u003dNone, tenant\u003dNone):"},{"line_number":44,"context_line":"        \"\"\"Return Keystone client for defined in \u0027identity_service\u0027 conf.\"\"\""},{"line_number":45,"context_line":"        ctx \u003d context.current()"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F8y%2BI%3D","line":42,"updated":"2013-12-20 08:28:44.000000000","message":"Parameters can change in between versions, that\u0027s better to use **kwargs and parse it.","commit_id":"962e6d38bf69997829fd5a0cd3969f1e7a866b70"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dfff5bb5d20494bdf2a535617758329a3d4f4acc","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    def __init__(self, username\u003dNone, password\u003dNone, trust_id\u003dNone,"},{"line_number":43,"context_line":"                 auth_url\u003dNone, tenant\u003dNone):"},{"line_number":44,"context_line":"        \"\"\"Return Keystone client for defined in \u0027identity_service\u0027 conf.\"\"\""},{"line_number":45,"context_line":"        ctx \u003d context.current()"},{"line_number":46,"context_line":"        tenant_name \u003d tenant or ctx.tenant_name"},{"line_number":47,"context_line":"        auth_url \u003d auth_url or base.url_for(ctx.service_catalog,"},{"line_number":48,"context_line":"                                            CONF.identity_service)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F8y7c%3D","line":45,"updated":"2013-12-20 08:28:44.000000000","message":"Why removing the possibility to pass a ctx to the method ?\nThere is possibility that this client could be called without context initialized (for example at Manager startup, see Host Admin Reservation). As a consequence, we should create a ctx out of the box, possibly with elevated rights.","commit_id":"962e6d38bf69997829fd5a0cd3969f1e7a866b70"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dfff5bb5d20494bdf2a535617758329a3d4f4acc","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            username \u003d ctx.user_name"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        self.keystone \u003d keystone_client.Client("},{"line_number":53,"context_line":"            version\u003dcfg.CONF.keystone_client_version,"},{"line_number":54,"context_line":"            username\u003dusername,"},{"line_number":55,"context_line":"            token\u003dctx.auth_token,"},{"line_number":56,"context_line":"            password\u003dpassword,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F8y%2Bc%3D","line":53,"updated":"2013-12-20 08:28:44.000000000","message":"As discussed with Dina, I\u0027m OK with the default version, but it should be overriden by passing parameter to __init__","commit_id":"962e6d38bf69997829fd5a0cd3969f1e7a866b70"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dfff5bb5d20494bdf2a535617758329a3d4f4acc","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self.service_exception \u003d keystone_exception"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def __getattr__(self, name, object_id):"},{"line_number":65,"context_line":"        func \u003d getattr(self.nova, name)"},{"line_number":66,"context_line":"        return func"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F8y%2Fo%3D","line":65,"updated":"2013-12-20 08:28:44.000000000","message":"bad copy/paste : self.keystone ;-)","commit_id":"962e6d38bf69997829fd5a0cd3969f1e7a866b70"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"f21811f1dd62d5d95f57905441dd2bedc3f6afac","unresolved":false,"context_lines":[{"line_number":41,"context_line":"class ClimateKeystoneClient(object):"},{"line_number":42,"context_line":"    def __init__(self, **kwargs):"},{"line_number":43,"context_line":"        \"\"\"Return Keystone client for defined in \u0027identity_service\u0027 conf.\"\"\""},{"line_number":44,"context_line":"        self.ctx \u003d kwargs.get(\u0027ctx\u0027) or context.current()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        version \u003d kwargs.get(\u0027version\u0027) or cfg.CONF.keystone_client_version"},{"line_number":47,"context_line":"        username \u003d kwargs.get(\u0027username\u0027) or self.ctx.user_name"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAUH%2F%2B%2Fqk%3D","line":44,"updated":"2014-01-19 21:12:18.000000000","message":"could you please do exactly what has been done with climate.utils.openstack.nova module ?","commit_id":"bd0f9c584ad428b6740a2e55c0eb82913c7a4241"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"4c0453a52737de94fdde40fb0efc48f3724a6e39","unresolved":false,"context_lines":[{"line_number":41,"context_line":"class ClimateKeystoneClient(object):"},{"line_number":42,"context_line":"    def __init__(self, **kwargs):"},{"line_number":43,"context_line":"        \"\"\"Return Keystone client for defined in \u0027identity_service\u0027 conf.\"\"\""},{"line_number":44,"context_line":"        self.ctx \u003d kwargs.get(\u0027ctx\u0027) or context.current()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        version \u003d kwargs.get(\u0027version\u0027) or cfg.CONF.keystone_client_version"},{"line_number":47,"context_line":"        username \u003d kwargs.get(\u0027username\u0027) or self.ctx.user_name"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAUH%2F%2B%2Bsw%3D","line":44,"in_reply_to":"AAAAUH%2F%2B%2Fqk%3D","updated":"2014-01-20 06:33:01.000000000","message":"Please, take a look at ctx_from_trust and you\u0027ll see why I don\u0027t do that\nhttps://review.openstack.org/#/c/48002/36/climate/utils/trusts.py","commit_id":"bd0f9c584ad428b6740a2e55c0eb82913c7a4241"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"d81aa7074ae59b44772ac55109d00b34792f7846","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            self.ctx.service_catalog, CONF.identity_service)"},{"line_number":53,"context_line":"        trust_id \u003d kwargs.get(\u0027trust_id\u0027) or None"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        self.keystone \u003d keystone_client.Client(version\u003dversion,"},{"line_number":56,"context_line":"                                               username\u003dusername,"},{"line_number":57,"context_line":"                                               token\u003dtoken,"},{"line_number":58,"context_line":"                                               password\u003dpassword,"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAUH%2F%2B%2FoY%3D","line":55,"updated":"2014-01-19 21:35:00.000000000","message":"I also get AttributeError: \u0027module\u0027 object has no attribute \u0027Client\u0027\nbecause my keystone client is old. Could you please update requirements.txt ?","commit_id":"bd0f9c584ad428b6740a2e55c0eb82913c7a4241"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"4c0453a52737de94fdde40fb0efc48f3724a6e39","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            self.ctx.service_catalog, CONF.identity_service)"},{"line_number":53,"context_line":"        trust_id \u003d kwargs.get(\u0027trust_id\u0027) or None"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        self.keystone \u003d keystone_client.Client(version\u003dversion,"},{"line_number":56,"context_line":"                                               username\u003dusername,"},{"line_number":57,"context_line":"                                               token\u003dtoken,"},{"line_number":58,"context_line":"                                               password\u003dpassword,"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAUH%2F%2B%2Bso%3D","line":55,"in_reply_to":"AAAAUH%2F%2B%2FoY%3D","updated":"2014-01-20 06:33:01.000000000","message":"yeap, that\u0027s a good point","commit_id":"bd0f9c584ad428b6740a2e55c0eb82913c7a4241"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4a9d5ef6b218e6c409c8c8580072919ee323288c","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            auth_url \u003d base.url_for("},{"line_number":74,"context_line":"                self.ctx.service_catalog, CONF.identity_service)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"            self.keystone \u003d keystone_client.Client(version\u003dversion,"},{"line_number":77,"context_line":"                                                   username\u003dusername,"},{"line_number":78,"context_line":"                                                   token\u003dtoken,"},{"line_number":79,"context_line":"                                                   tenant_name\u003dtenant_name,"}],"source_content_type":"text/x-python","patch_set":36,"id":"AAAAUH%2F%2B8Xc%3D","line":76,"updated":"2014-01-20 15:07:06.000000000","message":"Until https://review.openstack.org/#/c/66494/ got merged, I propose to ship this call by a try:except AttributeNotFound clause and raise explicitely that keystoneclient needs to be manually upgraded to 0.4.2\n\nOnce the patch got merged, we can update reqs.txt and remove this clause","commit_id":"50d8d30ba3f92228f37ae3ef4ea46c2e182edc48"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4a9d5ef6b218e6c409c8c8580072919ee323288c","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            tenant_name \u003d kwargs.get(\u0027tenant\u0027)"},{"line_number":87,"context_line":"            auth_url \u003d kwargs.get(\u0027auth_url\u0027)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"            self.keystone \u003d keystone_client.Client(version\u003dversion,"},{"line_number":90,"context_line":"                                                   username\u003dusername,"},{"line_number":91,"context_line":"                                                   password\u003dpassword,"},{"line_number":92,"context_line":"                                                   tenant_name\u003dtenant_name,"}],"source_content_type":"text/x-python","patch_set":36,"id":"AAAAUH%2F%2B8XU%3D","line":89,"updated":"2014-01-20 15:07:06.000000000","message":"ditto to L76","commit_id":"50d8d30ba3f92228f37ae3ef4ea46c2e182edc48"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"ce5f3a027146d5ec73356c3c0d7332abb2b5e3b9","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        :type username: str"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        :param password: password"},{"line_number":55,"context_line":"        :type api_key: str"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        :param tenant_name: tenant_name"},{"line_number":58,"context_line":"        :type api_key: str"}],"source_content_type":"text/x-python","patch_set":41,"id":"AAAAUH%2F%2Bzo0%3D","line":55,"updated":"2014-01-21 22:38:12.000000000","message":"typo : s/api_key/password/","commit_id":"3e800b3ac68bff40ca9b89967936081027ae89ed"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"ce5f3a027146d5ec73356c3c0d7332abb2b5e3b9","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        :type api_key: str"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        :param tenant_name: tenant_name"},{"line_number":58,"context_line":"        :type api_key: str"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        :param auth_url: auth_url"},{"line_number":61,"context_line":"        :type auth_url: str"}],"source_content_type":"text/x-python","patch_set":41,"id":"AAAAUH%2F%2Bzow%3D","line":58,"updated":"2014-01-21 22:38:12.000000000","message":"typo : s/api_key/tenant_name/","commit_id":"3e800b3ac68bff40ca9b89967936081027ae89ed"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"ce5f3a027146d5ec73356c3c0d7332abb2b5e3b9","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        except AttributeError:"},{"line_number":86,"context_line":"            raise manager_exceptions.WrongClientVersion()"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        self.keystone.management_url \u003d kwargs[\u0027auth_url\u0027]"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        self.exceptions \u003d keystone_exception"},{"line_number":91,"context_line":""}],"source_content_type":"text/x-python","patch_set":41,"id":"AAAAUH%2F%2Bzsg%3D","line":88,"updated":"2014-01-21 22:38:12.000000000","message":"Can\u0027t correcly work or we need to be more explicit. Default auth_url is the publicurl (port 5000), while Keystone is waiting the adminurl for management (port 35357)\n\nIn order to get that work, we should do as for ClimateNovaClient and either wait for a mgmt url or try to fetch it from base using the \"admin\" endpoint interface","commit_id":"3e800b3ac68bff40ca9b89967936081027ae89ed"}],"climate/utils/openstack/nova.py":[{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"073cecf9ea7a300a62918eb680ce673112a305ed","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from novaclient.v1_1 import client as nova_client"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import climate.utils.openstack.base as base"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"def client(ctx):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FVus%3D","line":18,"updated":"2013-10-17 15:10:06.000000000","message":"should be more readable and consitent with\nfrom climate.utils.openstack import base","commit_id":"7d6c5989e3d62beb65b6ff83fb6da7451ad6bf54"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"073cecf9ea7a300a62918eb680ce673112a305ed","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def wake_up(instance_id, ctx):"},{"line_number":39,"context_line":"    client(ctx).servers.wake_up(instance_id)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def delete(instance_id, ctx):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2FVvQ%3D","line":39,"updated":"2013-10-17 15:10:06.000000000","message":"Just to know, do you have a review in nova for the wake_up ?","commit_id":"7d6c5989e3d62beb65b6ff83fb6da7451ad6bf54"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e6d08a978dbbd2971d829032aa66d74355fb227e","unresolved":false,"context_lines":[{"line_number":25,"context_line":"def client(ctx):"},{"line_number":26,"context_line":"    compute_url \u003d base.url_for(ctx.service_catalog, \u0027compute\u0027)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    nova \u003d nova_client.Client(ctx.user_name,"},{"line_number":29,"context_line":"                              ctx.auth_token, ctx.tenant_id,"},{"line_number":30,"context_line":"                              auth_url\u003dcompute_url)"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9pj8%3D","line":28,"updated":"2013-12-09 10:16:41.000000000","message":"please call it with explicit args (username\u003dctx.user_name,...)","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"839b01ecf1c3bc7e326d60295bceae73e8f8af11","unresolved":false,"context_lines":[{"line_number":25,"context_line":"def client(ctx):"},{"line_number":26,"context_line":"    compute_url \u003d base.url_for(ctx.service_catalog, \u0027compute\u0027)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    nova \u003d nova_client.Client(ctx.user_name,"},{"line_number":29,"context_line":"                              ctx.auth_token, ctx.tenant_id,"},{"line_number":30,"context_line":"                              auth_url\u003dcompute_url)"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9juI%3D","line":28,"in_reply_to":"AAAATn%2F9pj8%3D","updated":"2013-12-10 09:15:32.000000000","message":"yeap, this is a good point","commit_id":"95f0ffcce04b05a081c1b9041e92d911d9b03532"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f03d81b4d3b488bbe91ae99df1b1c65b5fc699","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def client(ctx):"},{"line_number":26,"context_line":"    compute_url \u003d base.url_for(ctx.service_catalog, \u0027compute\u0027)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    nova \u003d nova_client.Client(username\u003dctx.user_name,"},{"line_number":29,"context_line":"                              token\u003dctx.auth_token,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9WnM%3D","line":26,"updated":"2013-12-12 11:03:42.000000000","message":"should \u0027compute\u0027 be a config option with default value instead of being hardcoded ?","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"6199931ce951240e6f4bb36c3f0b9c2310d27654","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def client(ctx):"},{"line_number":26,"context_line":"    compute_url \u003d base.url_for(ctx.service_catalog, \u0027compute\u0027)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    nova \u003d nova_client.Client(username\u003dctx.user_name,"},{"line_number":29,"context_line":"                              token\u003dctx.auth_token,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9JvQ%3D","line":26,"in_reply_to":"AAAATn%2F9KQA%3D","updated":"2013-12-16 09:19:54.000000000","message":"Done","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"43a8c41ca38805394e7d30ad3225bea844e08973","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def client(ctx):"},{"line_number":26,"context_line":"    compute_url \u003d base.url_for(ctx.service_catalog, \u0027compute\u0027)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    nova \u003d nova_client.Client(username\u003dctx.user_name,"},{"line_number":29,"context_line":"                              token\u003dctx.auth_token,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9KQA%3D","line":26,"in_reply_to":"AAAATn%2F9Lm8%3D","updated":"2013-12-16 06:32:57.000000000","message":"Nick, that\u0027s name for the service in Keystone. Theoretically you may name Nova service not as \u0027compute\u0027, but something else. So moving this param to the conf option is Ok, I suppose.","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"554a233a0ad79971d3c09aa5d34f57219b7444ed","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def client(ctx):"},{"line_number":26,"context_line":"    compute_url \u003d base.url_for(ctx.service_catalog, \u0027compute\u0027)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    nova \u003d nova_client.Client(username\u003dctx.user_name,"},{"line_number":29,"context_line":"                              token\u003dctx.auth_token,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9Lm8%3D","line":26,"in_reply_to":"AAAATn%2F9WnM%3D","updated":"2013-12-15 14:41:04.000000000","message":"We\u0027ll need discuss it, I think. But for me - hardcode is look okay there","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f03d81b4d3b488bbe91ae99df1b1c65b5fc699","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    instance_name \u003d instance.name"},{"line_number":64,"context_line":"    client(ctx).servers.create_image(instance_id,"},{"line_number":65,"context_line":"                                     \"reserved_%s\" % instance_name)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"def backup(instance_id):"},{"line_number":69,"context_line":"    raise NotImplementedError"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9Wlo%3D","line":66,"updated":"2013-12-12 11:03:42.000000000","message":"General comment about this file, we don\u0027t have to provide a wrapper for each Nova call or we would have to duplicate all calls.\n\nI would definitely prefer kind of __getattr__ method against a ClimateNovaClient which would send the *args,**kwargs directly to Nova and only parse the API/method names like this :\n\nnova_servers \u003d ClimateNovaClient(\u0027servers\u0027)\n\nnova_servers.wake_up()\n\nnova_servers.create_image(instance_id, name)\n\nIn case of any extra actions, it should be managed in the model class instead of this interface.","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"43a8c41ca38805394e7d30ad3225bea844e08973","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    instance_name \u003d instance.name"},{"line_number":64,"context_line":"    client(ctx).servers.create_image(instance_id,"},{"line_number":65,"context_line":"                                     \"reserved_%s\" % instance_name)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"def backup(instance_id):"},{"line_number":69,"context_line":"    raise NotImplementedError"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F9KPg%3D","line":66,"in_reply_to":"AAAATn%2F9Wlo%3D","updated":"2013-12-16 06:32:57.000000000","message":"I\u0027m quite ok with this statement. Although, we may look how this patchset may look like with all other comments fixed except this one and see, if it\u0027s ok or not.","commit_id":"ca5872e6fc819f8298727a3a4e56f9ee153a258e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"364554dd35c90d7a7ac617ff3f2295b7e7372b10","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from novaclient import exceptions as nova_exception"},{"line_number":17,"context_line":"from novaclient.v1_1 import client as nova_client"},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from climate.openstack.common import log as logging"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F8860%3D","line":17,"updated":"2013-12-18 13:15:31.000000000","message":"I would prefer to import client and specify which version to use when creating the Client (here \u00272\u0027).\n\nIt would be even better to pass a param version\u003d2 to client(ctx)","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"364554dd35c90d7a7ac617ff3f2295b7e7372b10","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from novaclient.v1_1 import client as nova_client"},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from climate.openstack.common import log as logging"},{"line_number":21,"context_line":"from climate.utils.openstack import base"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F885o%3D","line":20,"updated":"2013-12-18 13:15:31.000000000","message":"not needed","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"364554dd35c90d7a7ac617ff3f2295b7e7372b10","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from climate.openstack.common import log as logging"},{"line_number":21,"context_line":"from climate.utils.openstack import base"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"service_opts \u003d ["},{"line_number":26,"context_line":"    cfg.StrOpt(\u0027compute_service\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F885w%3D","line":23,"updated":"2013-12-18 13:15:31.000000000","message":"not needed","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"364554dd35c90d7a7ac617ff3f2295b7e7372b10","unresolved":false,"context_lines":[{"line_number":35,"context_line":"def client(ctx):"},{"line_number":36,"context_line":"    compute_url \u003d base.url_for(ctx.service_catalog, cfg.CONF.compute_service)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    nova \u003d nova_client.Client(username\u003dctx.user_name,"},{"line_number":39,"context_line":"                              token\u003dctx.auth_token,"},{"line_number":40,"context_line":"                              tenant_id\u003dctx.tenant_id,"},{"line_number":41,"context_line":"                              auth_url\u003dcompute_url)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F886s%3D","line":38,"updated":"2013-12-18 13:15:31.000000000","message":"see above about which module to use as nova_client","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"803b0239de9c8f241a53a83fc2721126d6f7aa00","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    return nova"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def get(instance_id, ctx):"},{"line_number":50,"context_line":"    return client(ctx).servers.get(instance_id)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F881k%3D","line":49,"updated":"2013-12-18 13:21:40.000000000","message":"(restoring previous comment)\n\nGeneral comment about this file, we don\u0027t have to provide a wrapper for each Nova call or we would have to duplicate all calls.\n\nI would definitely prefer kind of __getattr__ method against a ClimateNovaClient which would send the *args,**kwargs directly to Nova and only parse the API/method names like this :\n\nnova_servers \u003d ClimateNovaClient(\u0027servers\u0027)\n\nnova_servers.wake_up()\n\nnova_servers.create_image(instance_id, name)\n\nIn case of any extra actions, it should be managed in the model class instead of this interface.","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e51cc2fae949667c8d0455b9843040e97c386f8e","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    return nova"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def get(instance_id, ctx):"},{"line_number":50,"context_line":"    return client(ctx).servers.get(instance_id)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F83%2F8%3D","line":49,"in_reply_to":"AAAATn%2F849s%3D","updated":"2013-12-19 09:44:50.000000000","message":"See http://paste.openstack.org/show/55466/ for what I proposed","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"30ea214d0faf3484f1b4290b13b4596f4e13759e","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    return nova"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def get(instance_id, ctx):"},{"line_number":50,"context_line":"    return client(ctx).servers.get(instance_id)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F849s%3D","line":49,"in_reply_to":"AAAATn%2F881k%3D","updated":"2013-12-19 05:36:37.000000000","message":"Finally I get it :D Was too tired to understand it first time","commit_id":"5645c6c677a2fc38ad4007c6d563ae0cd5d12e04"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dfff5bb5d20494bdf2a535617758329a3d4f4acc","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class ClimateNovaClient(object):"},{"line_number":38,"context_line":"    def __init__(self):"},{"line_number":39,"context_line":"        self.ctx \u003d context.current()"},{"line_number":40,"context_line":"        compute_url \u003d base.url_for(self.ctx.service_catalog,"},{"line_number":41,"context_line":"                                   cfg.CONF.service_name)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F8y7E%3D","line":38,"updated":"2013-12-20 08:28:44.000000000","message":"__init__ should have **kwargs for Novaclient (see my comment on Keystone) and if not, default to the context ones.","commit_id":"962e6d38bf69997829fd5a0cd3969f1e7a866b70"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dfff5bb5d20494bdf2a535617758329a3d4f4acc","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        compute_url \u003d base.url_for(self.ctx.service_catalog,"},{"line_number":41,"context_line":"                                   cfg.CONF.service_name)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        self.nova \u003d nova_client.Client(cfg.CONF.nova_client_version,"},{"line_number":44,"context_line":"                                       username\u003dself.ctx.user_name,"},{"line_number":45,"context_line":"                                       token\u003dself.ctx.auth_token,"},{"line_number":46,"context_line":"                                       tenant_id\u003dself.ctx.tenant_id,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F8y9k%3D","line":43,"updated":"2013-12-20 08:28:44.000000000","message":"see comment related to version with utils.openstack.keystone","commit_id":"962e6d38bf69997829fd5a0cd3969f1e7a866b70"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dfff5bb5d20494bdf2a535617758329a3d4f4acc","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        return func"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def _image_create(self, instance_id, ctx):"},{"line_number":63,"context_line":"        instance \u003d self.nova.instance_get(instance_id)"},{"line_number":64,"context_line":"        instance_name \u003d instance.name"},{"line_number":65,"context_line":"        self.nova.servers.create_image(instance_id,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F8y84%3D","line":62,"updated":"2013-12-20 08:28:44.000000000","message":"just for clarity, could you please move the method above the __getattr__ one ? Even if Python is smart enough, I think that\u0027s nice for readability to have a catch-all method at the end.","commit_id":"962e6d38bf69997829fd5a0cd3969f1e7a866b70"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"96d93840dac357cd1ecfe56ff516878a3020ecb4","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        token \u003d kwargs.get(\u0027token\u0027) or self.ctx.auth_token"},{"line_number":53,"context_line":"        tenant_id \u003d kwargs.get(\u0027tenant_id\u0027) or self.ctx.tenant_id"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        self.nova \u003d nova_client.Client(client_version,"},{"line_number":56,"context_line":"                                       username\u003dusername,"},{"line_number":57,"context_line":"                                       api_key\u003dtoken,"},{"line_number":58,"context_line":"                                       project_id\u003dtenant_id,"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAAUH%2F%2FRIQ%3D","line":55,"updated":"2014-01-15 17:08:32.000000000","message":"please fix 55 line - client_version is not positional arg now, just kwarg :)","commit_id":"5508bd04818f5286692301e4e7bf9ca80f0c4ad3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"59f9169e086b111edc3ef85b6468c2a3c531be4c","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        auth_url \u003d kwargs.get(\u0027auth_url\u0027) or base.url_for("},{"line_number":49,"context_line":"            self.ctx.service_catalog, cfg.CONF.service_name)"},{"line_number":50,"context_line":"        client_version \u003d kwargs.get(\u0027version\u0027) or cfg.CONF.nova_client_version"},{"line_number":51,"context_line":"        username \u003d kwargs.get(\u0027username\u0027) or self.ctx.user_name"},{"line_number":52,"context_line":"        token \u003d kwargs.get(\u0027token\u0027) or self.ctx.auth_token"},{"line_number":53,"context_line":"        tenant_id \u003d kwargs.get(\u0027tenant_id\u0027) or self.ctx.tenant_id"}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAAUH%2F%2FNgs%3D","line":50,"updated":"2014-01-16 10:39:28.000000000","message":"There is a confusion : in the docstring, you talk about client_version while you extract .get(\u0027version\u0027). Please either change the doc or the call (I would prefer having version \u003d kwargs.get(\u0027version\u0027) btw.)","commit_id":"946ea9410b84e8828190a7f647f5dbbcd433228c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0a5884c99f01fddce83961f498795a2339aad3a5","unresolved":false,"context_lines":[{"line_number":37,"context_line":"class ClimateNovaClient(object):"},{"line_number":38,"context_line":"    def __init__(self, **kwargs):"},{"line_number":39,"context_line":"        \"\"\"We think about kwargs:"},{"line_number":40,"context_line":"        1. version - service client version which we will use"},{"line_number":41,"context_line":"        2. ctx - when you use your method without context, please specify it"},{"line_number":42,"context_line":"        3. username/token - credentials which will use with client"},{"line_number":43,"context_line":"        4. tenant_id"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FF%2BU%3D","line":40,"updated":"2014-01-17 14:57:42.000000000","message":"please mention the kwargs correctly using docstring params","commit_id":"e51c6912628707838b7bc1a476a1389ce1e4c35d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0a5884c99f01fddce83961f498795a2339aad3a5","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        \"\"\"We think about kwargs:"},{"line_number":40,"context_line":"        1. version - service client version which we will use"},{"line_number":41,"context_line":"        2. ctx - when you use your method without context, please specify it"},{"line_number":42,"context_line":"        3. username/token - credentials which will use with client"},{"line_number":43,"context_line":"        4. tenant_id"},{"line_number":44,"context_line":"        5. auth_url"},{"line_number":45,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FF%2BA%3D","line":42,"updated":"2014-01-17 14:57:42.000000000","message":"which one from username or token should be used ? As per the code, both should be parameters, so please amend this line.","commit_id":"e51c6912628707838b7bc1a476a1389ce1e4c35d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0a5884c99f01fddce83961f498795a2339aad3a5","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        4. tenant_id"},{"line_number":44,"context_line":"        5. auth_url"},{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        self.ctx \u003d kwargs.get(\u0027ctx\u0027) or context.current()"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        auth_url \u003d kwargs.get(\u0027auth_url\u0027) or base.url_for("},{"line_number":49,"context_line":"            self.ctx.service_catalog, cfg.CONF.service_name)"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FF5g%3D","line":46,"updated":"2014-01-17 14:57:42.000000000","message":"Novaclient doesn\u0027t use contexts, I don\u0027t think there is a need for this","commit_id":"e51c6912628707838b7bc1a476a1389ce1e4c35d"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"7dbd06f92ec47383b43302a7261cc92d8a36b1a4","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        4. tenant_id"},{"line_number":44,"context_line":"        5. auth_url"},{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        self.ctx \u003d kwargs.get(\u0027ctx\u0027) or context.current()"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        auth_url \u003d kwargs.get(\u0027auth_url\u0027) or base.url_for("},{"line_number":49,"context_line":"            self.ctx.service_catalog, cfg.CONF.service_name)"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FFq0%3D","line":46,"in_reply_to":"AAAAUH%2F%2FF5g%3D","updated":"2014-01-17 15:42:54.000000000","message":"It\u0027s in the right place as for me. We can create client using kwargs, or using current context. We don\u0027t use it right now, but one day we may need it.\nThe way of creating from context here is for future. But I need to correct it, yeah.","commit_id":"e51c6912628707838b7bc1a476a1389ce1e4c35d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0a5884c99f01fddce83961f498795a2339aad3a5","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                                       project_id\u003dtenant_id,"},{"line_number":59,"context_line":"                                       auth_url\u003dauth_url)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        self.nova.client.auth_token \u003d self.ctx.auth_token"},{"line_number":62,"context_line":"        self.nova.client.management_url \u003d auth_url"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        self.exceptions \u003d nova_exception"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FF6M%3D","line":61,"updated":"2014-01-17 14:57:42.000000000","message":"I don\u0027t think there is a need for this, plus you don\u0027t use token if specified as param","commit_id":"e51c6912628707838b7bc1a476a1389ce1e4c35d"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"7dbd06f92ec47383b43302a7261cc92d8a36b1a4","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                                       project_id\u003dtenant_id,"},{"line_number":59,"context_line":"                                       auth_url\u003dauth_url)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        self.nova.client.auth_token \u003d self.ctx.auth_token"},{"line_number":62,"context_line":"        self.nova.client.management_url \u003d auth_url"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        self.exceptions \u003d nova_exception"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FFqo%3D","line":61,"in_reply_to":"AAAAUH%2F%2FF6M%3D","updated":"2014-01-17 15:42:54.000000000","message":"I\u0027ll focus on it in next patchset. Need to check novaclient itself.","commit_id":"e51c6912628707838b7bc1a476a1389ce1e4c35d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0a5884c99f01fddce83961f498795a2339aad3a5","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                                       auth_url\u003dauth_url)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        self.nova.client.auth_token \u003d self.ctx.auth_token"},{"line_number":62,"context_line":"        self.nova.client.management_url \u003d auth_url"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        self.exceptions \u003d nova_exception"},{"line_number":65,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FF6I%3D","line":62,"updated":"2014-01-17 14:57:42.000000000","message":"I don\u0027t think there is a need for this","commit_id":"e51c6912628707838b7bc1a476a1389ce1e4c35d"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"7dbd06f92ec47383b43302a7261cc92d8a36b1a4","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                                       auth_url\u003dauth_url)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        self.nova.client.auth_token \u003d self.ctx.auth_token"},{"line_number":62,"context_line":"        self.nova.client.management_url \u003d auth_url"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        self.exceptions \u003d nova_exception"},{"line_number":65,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FFqY%3D","line":62,"in_reply_to":"AAAAUH%2F%2FF6I%3D","updated":"2014-01-17 15:42:54.000000000","message":"The same as L61","commit_id":"e51c6912628707838b7bc1a476a1389ce1e4c35d"}]}
