)]}'
{"ceilometer/api/controllers/v2/alarm_rules/gnocchi.py":[{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"c5e292567b49db8efbe61d5c4cf8427cf244f9e5","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from oslo_config import cfg"},{"line_number":17,"context_line":"from oslo_serialization import jsonutils"},{"line_number":18,"context_line":"from pytimeparse import timeparse"},{"line_number":19,"context_line":"import requests"},{"line_number":20,"context_line":"import six"},{"line_number":21,"context_line":"import uuid"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_3d0b792c","line":18,"updated":"2015-03-18 16:10:07.000000000","message":"i guess do we need add pytimeparse module in requirements or it is already there in some implicit manner?","commit_id":"ef5addb6997d93aff321dc922d75634a62949d85"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"81d7643f1fe13ce4fd997f849a8472253081b1e5","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            elif r.status_code // 200 !\u003d 1:"},{"line_number":146,"context_line":"                raise base.ClientSideError(r.body, status_code\u003dr.status_code)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        try:"},{"line_number":149,"context_line":"            uuid.UUID(rule.resource_constraint)"},{"line_number":150,"context_line":"            url \u003d (\"%s/v1/resource/%s/%s\") % (rule.gnocchi_url,"},{"line_number":151,"context_line":"                                              rule.resource_type,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_7fe92eb6","line":148,"updated":"2015-03-13 13:30:03.000000000","message":"Can you add a comment here? It\u0027s non-obvious what is raising the ValueError and what it means and why it results in needed to different urls.","commit_id":"ef5addb6997d93aff321dc922d75634a62949d85"},{"author":{"_account_id":13273,"name":"Lena Novokshonova","email":"enovokshonova@mirantis.com","username":"enovokshonova"},"change_message_id":"441d6b707fe0a4990b896d345adac30fafd6d1f7","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            elif r.status_code // 200 !\u003d 1:"},{"line_number":146,"context_line":"                raise base.ClientSideError(r.body, status_code\u003dr.status_code)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        try:"},{"line_number":149,"context_line":"            uuid.UUID(rule.resource_constraint)"},{"line_number":150,"context_line":"            url \u003d (\"%s/v1/resource/%s/%s\") % (rule.gnocchi_url,"},{"line_number":151,"context_line":"                                              rule.resource_type,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_d074c9d0","line":148,"in_reply_to":"9a80dd14_32a1adf8","updated":"2015-03-13 14:20:59.000000000","message":"We can do queries two types: like http://localhost:8041/v1/resources/instance/\u003cinstance_id\u003e and http://localhost:8041/v1/resources/instance?id\u003d\u003cinstance_id\u003e and this code check in which format we like to query.","commit_id":"ef5addb6997d93aff321dc922d75634a62949d85"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"000c507679882233d8e1bfa6b2a536d0644cbb52","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            elif r.status_code // 200 !\u003d 1:"},{"line_number":146,"context_line":"                raise base.ClientSideError(r.body, status_code\u003dr.status_code)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        try:"},{"line_number":149,"context_line":"            uuid.UUID(rule.resource_constraint)"},{"line_number":150,"context_line":"            url \u003d (\"%s/v1/resource/%s/%s\") % (rule.gnocchi_url,"},{"line_number":151,"context_line":"                                              rule.resource_type,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_32a1adf8","line":148,"in_reply_to":"9a80dd14_7fe92eb6","updated":"2015-03-13 13:50:35.000000000","message":"We have recently changed the gnocchi API to make clearer what the endpoint does, because here it\u0027s not clear when the url is an aggregation of across multiple resources or not. I\u0027m working on the ceilometer update for that here: https://review.openstack.org/#/c/164173/.","commit_id":"ef5addb6997d93aff321dc922d75634a62949d85"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"000c507679882233d8e1bfa6b2a536d0644cbb52","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        except ValueError:"},{"line_number":154,"context_line":"            url \u003d (\"%s/v1/resource/%s?%s\") % (rule.gnocchi_url,"},{"line_number":155,"context_line":"                                              rule.resource_type,"},{"line_number":156,"context_line":"                                              rule.resource_constraint)"},{"line_number":157,"context_line":"        try:"},{"line_number":158,"context_line":"            r \u003d requests.get(url, headers\u003drule._get_headers())"},{"line_number":159,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_d2c0512d","line":156,"updated":"2015-03-13 13:50:35.000000000","message":"I\u0027m not sure this case is valid, if the resource_constraint is not a uuid, that means this is a query to get measurements accross multiple resources (but exact url have changed recently in gnocchi).\n\nOnce built, this built wil looks like: http://localhost:8041/v1/resources/instance?server_group\u003dmy_autoscaling_group and that is not a valid endpoint.\n\nI think you just have to \u0027return\u0027 here, we cannot do more in this case.","commit_id":"ef5addb6997d93aff321dc922d75634a62949d85"},{"author":{"_account_id":13273,"name":"Lena Novokshonova","email":"enovokshonova@mirantis.com","username":"enovokshonova"},"change_message_id":"f19bce15f71bdde1c333c4d168c9c90df95e008e","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        except ValueError:"},{"line_number":154,"context_line":"            url \u003d (\"%s/v1/resource/%s?%s\") % (rule.gnocchi_url,"},{"line_number":155,"context_line":"                                              rule.resource_type,"},{"line_number":156,"context_line":"                                              rule.resource_constraint)"},{"line_number":157,"context_line":"        try:"},{"line_number":158,"context_line":"            r \u003d requests.get(url, headers\u003drule._get_headers())"},{"line_number":159,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_f0a9cd7c","line":156,"in_reply_to":"9a80dd14_d2c0512d","updated":"2015-03-13 14:15:31.000000000","message":"Why do you think it\u0027s not valid? I checked this case, I made query like this: http://localhost:8041/v1/resources/instance?id\u003d\u003cinstance_id\u003e or http://localhost:8041/v1/resources/instance?user_id\u003d\u003cuser_id\u003e and it works normally.","commit_id":"ef5addb6997d93aff321dc922d75634a62949d85"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"81d7643f1fe13ce4fd997f849a8472253081b1e5","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                                              rule.resource_constraint)"},{"line_number":157,"context_line":"        try:"},{"line_number":158,"context_line":"            r \u003d requests.get(url, headers\u003drule._get_headers())"},{"line_number":159,"context_line":"        except Exception:"},{"line_number":160,"context_line":"            raise"},{"line_number":161,"context_line":"        try:"},{"line_number":162,"context_line":"            fields \u003d jsonutils.loads(r.text)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_bf3c8630","line":159,"updated":"2015-03-13 13:30:03.000000000","message":"This is redundant is it not? The exception will raise anyway.\n\nWith all of these exceptions happening through this block, is there something that will be catching them and turning them into appropriate HTTP response codes?","commit_id":"ef5addb6997d93aff321dc922d75634a62949d85"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"000c507679882233d8e1bfa6b2a536d0644cbb52","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            try:"},{"line_number":172,"context_line":"                rm \u003d requests.get(urlm, headers\u003drule._get_headers())"},{"line_number":173,"context_line":"            except Exception:"},{"line_number":174,"context_line":"                raise"},{"line_number":175,"context_line":"            try:"},{"line_number":176,"context_line":"                fieldsm \u003d jsonutils.loads(rm.text)"},{"line_number":177,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_92d179fd","line":174,"updated":"2015-03-13 13:50:35.000000000","message":"Same, useless exception catching","commit_id":"ef5addb6997d93aff321dc922d75634a62949d85"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"81d7643f1fe13ce4fd997f849a8472253081b1e5","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                raise"},{"line_number":175,"context_line":"            try:"},{"line_number":176,"context_line":"                fieldsm \u003d jsonutils.loads(rm.text)"},{"line_number":177,"context_line":"            except Exception:"},{"line_number":178,"context_line":"                raise Exception(\"Error with parsing response from metric.\")"},{"line_number":179,"context_line":"            for am in fieldsm[\u0027archive_policy\u0027][\u0027definition\u0027]:"},{"line_number":180,"context_line":"                seconds \u003d timeparse.timeparse(six.text_type(am[\u0027granularity\u0027]))"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_5fce2a2e","line":177,"updated":"2015-03-13 13:30:03.000000000","message":"This structure swallows any details of what caused the exception which makes making good logs or good error reports to the caller pretty much impossible.","commit_id":"ef5addb6997d93aff321dc922d75634a62949d85"}]}
