)]}'
{"etc/monasca.conf":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"a612cd4892269c9322334098a387724002d1c983","unresolved":false,"context_lines":[{"line_number":4,"context_line":"log_file \u003d monasca.log"},{"line_number":5,"context_line":"log_dir \u003d ."},{"line_number":6,"context_line":"log_level \u003d DEBUG"},{"line_number":7,"context_line":"default_log_levels \u003d monasca\u003dDEBUG"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"# Identifies the region that the Monasca API is running in."},{"line_number":10,"context_line":"region \u003d na"}],"source_content_type":"text/plain","patch_set":1,"id":"9aa7fdbe_3e228201","line":7,"updated":"2014-10-23 01:10:07.000000000","message":"Is this funky syntax correct?","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"aa2aa5dd8c096c8b6092b70ba8cc318f75d6c0bd","unresolved":false,"context_lines":[{"line_number":4,"context_line":"log_file \u003d monasca.log"},{"line_number":5,"context_line":"log_dir \u003d ."},{"line_number":6,"context_line":"log_level \u003d DEBUG"},{"line_number":7,"context_line":"default_log_levels \u003d monasca\u003dDEBUG"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"# Identifies the region that the Monasca API is running in."},{"line_number":10,"context_line":"region \u003d na"}],"source_content_type":"text/plain","patch_set":1,"id":"9aa7fdbe_6b127c58","line":7,"updated":"2014-10-23 14:23:45.000000000","message":"why do we need this?","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":4,"context_line":"log_file \u003d monasca.log"},{"line_number":5,"context_line":"log_dir \u003d ."},{"line_number":6,"context_line":"log_level \u003d DEBUG"},{"line_number":7,"context_line":"default_log_levels \u003d monasca\u003dDEBUG"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"# Identifies the region that the Monasca API is running in."},{"line_number":10,"context_line":"region \u003d na"}],"source_content_type":"text/plain","patch_set":1,"id":"9aa7fdbe_a11565e6","line":7,"in_reply_to":"9aa7fdbe_3e228201","updated":"2014-10-23 15:32:19.000000000","message":"it works, i had wanted to turn debug on.  I will remove this line, it\u0027s only for debug.  just log_level\u003dDEBUG does not turn on debug level for monasca.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":4,"context_line":"log_file \u003d monasca.log"},{"line_number":5,"context_line":"log_dir \u003d ."},{"line_number":6,"context_line":"log_level \u003d DEBUG"},{"line_number":7,"context_line":"default_log_levels \u003d monasca\u003dDEBUG"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"# Identifies the region that the Monasca API is running in."},{"line_number":10,"context_line":"region \u003d na"}],"source_content_type":"text/plain","patch_set":1,"id":"9aa7fdbe_c1d5091d","line":7,"in_reply_to":"9aa7fdbe_6b127c58","updated":"2014-10-23 15:32:19.000000000","message":"i had wanted to turn debug on.  I will remove this line, it\u0027s only for debug.  just log_level\u003dDEBUG does not turn on debug level for monasca.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"aa2aa5dd8c096c8b6092b70ba8cc318f75d6c0bd","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"# The driver to use for the notifications repository"},{"line_number":44,"context_line":"notifications_driver \u003d mysql_notifications_repo"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"[dispatcher]"},{"line_number":47,"context_line":"driver \u003d v2_reference"},{"line_number":48,"context_line":""}],"source_content_type":"text/plain","patch_set":1,"id":"9aa7fdbe_4b3cd8c8","line":45,"updated":"2014-10-23 14:23:45.000000000","message":"i think this repo is going to be used for more than just notifications.  i think it should be called mysq_metrics_repo to reflect that it is separate from tranforms and events, but is for all metric things.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"# The driver to use for the notifications repository"},{"line_number":44,"context_line":"notifications_driver \u003d mysql_notifications_repo"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"[dispatcher]"},{"line_number":47,"context_line":"driver \u003d v2_reference"},{"line_number":48,"context_line":""}],"source_content_type":"text/plain","patch_set":1,"id":"9aa7fdbe_01aab184","line":45,"in_reply_to":"9aa7fdbe_4b3cd8c8","updated":"2014-10-23 15:32:19.000000000","message":"If you look above that there is a separate repo for transforms as well.  I think Roland want\u0027s to keep this very configurable by resource, he pointed out that I needed one for Notifications.  What do you think?","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"}],"monasca/api/monasca_api_v2.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"a612cd4892269c9322334098a387724002d1c983","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        res.status \u003d \u0027501 Not Implemented\u0027"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    @resource_api.Restify(\u0027/v2.0/notification-methods/{id}\u0027, method\u003d\u0027get\u0027)"},{"line_number":66,"context_line":"    def do_get_notification_method_by_id(self, req, res, id):"},{"line_number":67,"context_line":"        res.status \u003d \u0027501 Not Implemented\u0027"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @resource_api.Restify(\u0027/v2.0/alarm-definitions\u0027, method\u003d\u0027post\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_5e7826f2","line":66,"updated":"2014-10-23 01:10:07.000000000","message":"Should this just get do_get_notification_method and the one above plural, as in do_get_notfication_methods?\n\nI see that the precedent has already been set of do_get_alarm_by_id below and I\u0027m OK following that, I\u0027m just wondering if we should change this in both places.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        res.status \u003d \u0027501 Not Implemented\u0027"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    @resource_api.Restify(\u0027/v2.0/notification-methods/{id}\u0027, method\u003d\u0027get\u0027)"},{"line_number":66,"context_line":"    def do_get_notification_method_by_id(self, req, res, id):"},{"line_number":67,"context_line":"        res.status \u003d \u0027501 Not Implemented\u0027"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @resource_api.Restify(\u0027/v2.0/alarm-definitions\u0027, method\u003d\u0027post\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_2102556f","line":66,"in_reply_to":"9aa7fdbe_5e7826f2","updated":"2014-10-23 15:32:19.000000000","message":"I was following Jonathan\u0027s naming, I can change this to the names you suggest.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"}],"monasca/api/monasca_notifications_api_v2.py":[{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"aa2aa5dd8c096c8b6092b70ba8cc318f75d6c0bd","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class NotificationsV2API(object):"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    def __init__(self, global_conf):"},{"line_number":25,"context_line":"        LOG.debug(\u0027initializing V2API!\u0027)"},{"line_number":26,"context_line":"        self.global_conf \u003d global_conf"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_8b8ec077","line":23,"updated":"2014-10-23 14:23:45.000000000","message":"i think all metric-like things should go in the metrics.py file.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class NotificationsV2API(object):"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    def __init__(self, global_conf):"},{"line_number":25,"context_line":"        LOG.debug(\u0027initializing V2API!\u0027)"},{"line_number":26,"context_line":"        self.global_conf \u003d global_conf"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_414119a8","line":23,"in_reply_to":"9aa7fdbe_8b8ec077","updated":"2014-10-23 15:32:19.000000000","message":"I was following Roland\u0027s recommendation.  This way each resource is configurable.  I guess we need a decision on this, because I was told to do it this way.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"}],"monasca/api/server.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"a612cd4892269c9322334098a387724002d1c983","unresolved":false,"context_lines":[{"line_number":214,"context_line":"    # add the driver to the application"},{"line_number":215,"context_line":"    app.add_route(None, notifications_manager.driver)"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    LOG.debug(\u0027Notifications dispatcher driver has been added to the routes!\u0027)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    return app"},{"line_number":220,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_fe5e3a75","line":217,"updated":"2014-10-23 01:10:07.000000000","message":"I wanted to do this last time around, but this same block of code is duplicated, except for the dispatcher namespace and driver, several times. Maybe we should make a method for this, or even make this table driven too.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"aa2aa5dd8c096c8b6092b70ba8cc318f75d6c0bd","unresolved":false,"context_lines":[{"line_number":214,"context_line":"    # add the driver to the application"},{"line_number":215,"context_line":"    app.add_route(None, notifications_manager.driver)"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    LOG.debug(\u0027Notifications dispatcher driver has been added to the routes!\u0027)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    return app"},{"line_number":220,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_8be5e039","line":217,"updated":"2014-10-23 14:23:45.000000000","message":"i think that there should only be one driver for all the metric-related things.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":214,"context_line":"    # add the driver to the application"},{"line_number":215,"context_line":"    app.add_route(None, notifications_manager.driver)"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    LOG.debug(\u0027Notifications dispatcher driver has been added to the routes!\u0027)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    return app"},{"line_number":220,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_a172c50e","line":217,"in_reply_to":"9aa7fdbe_fe5e3a75","updated":"2014-10-23 15:32:19.000000000","message":"That\u0027s a good idea.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"}],"monasca/common/repositories/mysql/notifications_repository.py":[{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"aa2aa5dd8c096c8b6092b70ba8cc318f75d6c0bd","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 Hewlett-Packard"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_6b4a7c27","line":1,"updated":"2014-10-23 14:23:45.000000000","message":"i think that there should be only one repository for all metric-related things.  so, this file could be renamed to metrics_repository.py and all metric-related mysql stuff goes in it.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"a612cd4892269c9322334098a387724002d1c983","unresolved":false,"context_lines":[{"line_number":22,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"class Notification_Method(model.Model):"},{"line_number":26,"context_line":"    id \u003d peewee.TextField(36)"},{"line_number":27,"context_line":"    tenant_id \u003d peewee.TextField(36)"},{"line_number":28,"context_line":"    name \u003d peewee.TextField()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_5e4f46bd","line":25,"updated":"2014-10-23 01:10:07.000000000","message":"Shouldn\u0027t have that \"_\" in there I\u0027m assuming.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":22,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"class Notification_Method(model.Model):"},{"line_number":26,"context_line":"    id \u003d peewee.TextField(36)"},{"line_number":27,"context_line":"    tenant_id \u003d peewee.TextField(36)"},{"line_number":28,"context_line":"    name \u003d peewee.TextField()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_6101bd37","line":25,"in_reply_to":"9aa7fdbe_5e4f46bd","updated":"2014-10-23 15:32:19.000000000","message":"I\u0027ll try that out, wasn\u0027t sure if peewee needed it.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"aa2aa5dd8c096c8b6092b70ba8cc318f75d6c0bd","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"class Notification_Method(model.Model):"},{"line_number":26,"context_line":"    id \u003d peewee.TextField(36)"},{"line_number":27,"context_line":"    tenant_id \u003d peewee.TextField(36)"},{"line_number":28,"context_line":"    name \u003d peewee.TextField()"},{"line_number":29,"context_line":"    type \u003d peewee.TextField()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_eb3e6c8b","line":26,"updated":"2014-10-23 14:23:45.000000000","message":"i would prefer to use pyodbc instead of peewee or sqlalchemy.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"e27979610fbefa783a30246a19d8ccd8361a9c4c","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                    Notification_Method.name \u003d\u003d name))"},{"line_number":50,"context_line":"            results \u003d q.execute()"},{"line_number":51,"context_line":"            for result in results:"},{"line_number":52,"context_line":"                return 1"},{"line_number":53,"context_line":"            return 0"},{"line_number":54,"context_line":"        except Exception as ex:"},{"line_number":55,"context_line":"            LOG.exception(str(ex))"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_2afa41bd","line":52,"updated":"2014-10-23 13:47:07.000000000","message":"Should return True and False. Might be better to do a count() and return True if q.execute() is \u003e 0\n\nIf you want to still use select, it should be return len(results) \u003e 0","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                    Notification_Method.name \u003d\u003d name))"},{"line_number":50,"context_line":"            results \u003d q.execute()"},{"line_number":51,"context_line":"            for result in results:"},{"line_number":52,"context_line":"                return 1"},{"line_number":53,"context_line":"            return 0"},{"line_number":54,"context_line":"        except Exception as ex:"},{"line_number":55,"context_line":"            LOG.exception(str(ex))"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_418bd9c2","line":52,"in_reply_to":"9aa7fdbe_2afa41bd","updated":"2014-10-23 15:32:19.000000000","message":"good idea, will do","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"e27979610fbefa783a30246a19d8ccd8361a9c4c","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                Notification_Method.tenant_id \u003d\u003d tenant_id)"},{"line_number":78,"context_line":"            results \u003d q.execute()"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"            notifications \u003d []"},{"line_number":81,"context_line":"            for result in results:"},{"line_number":82,"context_line":"                notifications.append(self.notification_from_result(result))"},{"line_number":83,"context_line":"            return notifications"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_8a8fadcb","line":80,"updated":"2014-10-23 13:47:07.000000000","message":"This should be written as:\n\nnotifications \u003d [self.notification_from_result(result) for result in results ]\n\nIts more pythonic :) \n\nhttp://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#list-comprehensions","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                Notification_Method.tenant_id \u003d\u003d tenant_id)"},{"line_number":78,"context_line":"            results \u003d q.execute()"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"            notifications \u003d []"},{"line_number":81,"context_line":"            for result in results:"},{"line_number":82,"context_line":"                notifications.append(self.notification_from_result(result))"},{"line_number":83,"context_line":"            return notifications"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_41b2f994","line":80,"in_reply_to":"9aa7fdbe_8a8fadcb","updated":"2014-10-23 15:32:19.000000000","message":"thanks for the tip, will do","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"e27979610fbefa783a30246a19d8ccd8361a9c4c","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        return"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def list_notifications_by_id(self, tenant_id, notification_id):"},{"line_number":106,"context_line":"        try:"},{"line_number":107,"context_line":"            result \u003d Notification_Method.get("},{"line_number":108,"context_line":"                (Notification_Method.tenant_id \u003d\u003d tenant_id) \u0026 ("}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_ca99b520","line":105,"updated":"2014-10-23 13:47:07.000000000","message":"Seems strange this is called list_notifications_by_id when there is only ever one returned","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        return"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def list_notifications_by_id(self, tenant_id, notification_id):"},{"line_number":106,"context_line":"        try:"},{"line_number":107,"context_line":"            result \u003d Notification_Method.get("},{"line_number":108,"context_line":"                (Notification_Method.tenant_id \u003d\u003d tenant_id) \u0026 ("}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_817f81aa","line":105,"in_reply_to":"9aa7fdbe_ca99b520","updated":"2014-10-23 15:32:19.000000000","message":"will change the name to list_notification","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"a612cd4892269c9322334098a387724002d1c983","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                (Notification_Method.tenant_id \u003d\u003d tenant_id) \u0026 ("},{"line_number":109,"context_line":"                    Notification_Method.id \u003d\u003d notification_id))"},{"line_number":110,"context_line":"            return (self.notification_from_result(result))"},{"line_number":111,"context_line":"        except Notification_Method.DoesNotExist as dnex:"},{"line_number":112,"context_line":"            raise exceptions.DoesNotExistException(str(dnex))"},{"line_number":113,"context_line":"        except Exception as ex:"},{"line_number":114,"context_line":"            LOG.exception(str(ex))"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_7ef88a49","line":111,"updated":"2014-10-23 01:10:07.000000000","message":"Should just be e or ex, not dnex. I think most of the Pyhonistas would use just e as idiomatic. But I tend to use ex, as I can search for ex, but e just results in too much.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                (Notification_Method.tenant_id \u003d\u003d tenant_id) \u0026 ("},{"line_number":109,"context_line":"                    Notification_Method.id \u003d\u003d notification_id))"},{"line_number":110,"context_line":"            return (self.notification_from_result(result))"},{"line_number":111,"context_line":"        except Notification_Method.DoesNotExist as dnex:"},{"line_number":112,"context_line":"            raise exceptions.DoesNotExistException(str(dnex))"},{"line_number":113,"context_line":"        except Exception as ex:"},{"line_number":114,"context_line":"            LOG.exception(str(ex))"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_8156a128","line":111,"in_reply_to":"9aa7fdbe_7ef88a49","updated":"2014-10-23 15:32:19.000000000","message":"thanks for the tip, I will do that.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"e27979610fbefa783a30246a19d8ccd8361a9c4c","unresolved":false,"context_lines":[{"line_number":134,"context_line":"            raise exceptions.RepositoryException(str(ex))"},{"line_number":135,"context_line":"        else:"},{"line_number":136,"context_line":"            if num_rows_updated \u003d\u003d 0:"},{"line_number":137,"context_line":"                raise exceptions.DoesNotExistException(\u0027404 id not found\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_6a9449e2","line":137,"updated":"2014-10-23 13:47:07.000000000","message":"Doesn\u0027t this already get translated into a 404? Do you really have to prepend it with a 404?","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":134,"context_line":"            raise exceptions.RepositoryException(str(ex))"},{"line_number":135,"context_line":"        else:"},{"line_number":136,"context_line":"            if num_rows_updated \u003d\u003d 0:"},{"line_number":137,"context_line":"                raise exceptions.DoesNotExistException(\u0027404 id not found\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_213fb5d7","line":137,"in_reply_to":"9aa7fdbe_6a9449e2","updated":"2014-10-23 15:32:19.000000000","message":"The exception requires a title, I\u0027ll change it to Not Found.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"b7cf991025f0384af4c6d1e24f73f24ac39e04cf","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                (Notification_Method.tenant_id \u003d\u003d tenant_id) \u0026 ("},{"line_number":49,"context_line":"                    Notification_Method.name \u003d\u003d name)).count() \u003e 0)"},{"line_number":50,"context_line":"        except Exception as ex:"},{"line_number":51,"context_line":"            LOG.exception(str(ex))"},{"line_number":52,"context_line":"            raise exceptions.RepositoryException(str(ex))"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def create_notification("}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa7fdbe_50bc66dc","line":51,"updated":"2014-10-24 14:22:20.000000000","message":"i don\u0027 think that the str(ex) is necessary; just ex works, i believe.","commit_id":"ad08dc0773c9bd8b6d4ad6ad9e71c362da3d8dae"}],"monasca/common/repositories/notifications_repository.py":[{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"aa2aa5dd8c096c8b6092b70ba8cc318f75d6c0bd","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 Hewlett-Packard"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"# not use this file except in compliance with the License. You may obtain"},{"line_number":5,"context_line":"# a copy of the License at"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_cb8a881a","line":2,"updated":"2014-10-23 14:23:45.000000000","message":"i think that this should go in metrics_repository.py","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"}],"monasca/common/resource_api.py":[{"author":{"_account_id":12512,"name":"Deklan Dieterly","email":"deklan.dieterly@hpe.com","username":"deklan"},"change_message_id":"b7cf991025f0384af4c6d1e24f73f24ac39e04cf","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    :param namespace: the resource namespace (in setup.cfg)."},{"line_number":32,"context_line":"    :param driver_name: the driver name (in monasca.conf)"},{"line_number":33,"context_line":"    :param invoke_args: args to pass to the driver (a tuple)"},{"line_number":34,"context_line":"    \u0027\u0027\u0027"},{"line_number":35,"context_line":"    invoke_args_tuple \u003d ()"},{"line_number":36,"context_line":"    if drv_invoke_args:"},{"line_number":37,"context_line":"        invoke_args_tuple \u003d drv_invoke_args"}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa7fdbe_f07aba22","line":34,"updated":"2014-10-24 14:22:20.000000000","message":"docstrings should follow these guidelines.  http://docs.openstack.org/developer/hacking/  yes, i know it\u0027s a pain.","commit_id":"ad08dc0773c9bd8b6d4ad6ad9e71c362da3d8dae"}],"monasca/v2/reference/helpers.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"a612cd4892269c9322334098a387724002d1c983","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    :return: Returns True if in the list of authorized roles, otherwise False."},{"line_number":42,"context_line":"    \u0027\u0027\u0027"},{"line_number":43,"context_line":"    str_roles \u003d req.get_header(\u0027X-ROLES\u0027)"},{"line_number":44,"context_line":"    if str_roles is None:"},{"line_number":45,"context_line":"        return False"},{"line_number":46,"context_line":"    roles \u003d str_roles.lower().split(\u0027,\u0027)"},{"line_number":47,"context_line":"    for role in roles:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_1e8a1ebf","line":44,"updated":"2014-10-23 01:10:07.000000000","message":"Good catch.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"e27979610fbefa783a30246a19d8ccd8361a9c4c","unresolved":false,"context_lines":[{"line_number":246,"context_line":"    :param uri: the http request.uri."},{"line_number":247,"context_line":"    \u0027\u0027\u0027"},{"line_number":248,"context_line":"    for resource in resourcelist:"},{"line_number":249,"context_line":"        add_links_to_resource(resource, uri)"},{"line_number":250,"context_line":"    return resourcelist"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_8aa6cd51","line":249,"updated":"2014-10-23 13:47:07.000000000","message":"This should be written as:\n\nadd_links_to_resource(resource, uri) for resource in resourcelist","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":246,"context_line":"    :param uri: the http request.uri."},{"line_number":247,"context_line":"    \u0027\u0027\u0027"},{"line_number":248,"context_line":"    for resource in resourcelist:"},{"line_number":249,"context_line":"        add_links_to_resource(resource, uri)"},{"line_number":250,"context_line":"    return resourcelist"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_7c3960d6","line":249,"in_reply_to":"9aa7fdbe_8aa6cd51","updated":"2014-10-23 15:32:19.000000000","message":"will do","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"}],"monasca/v2/reference/notifications.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"a612cd4892269c9322334098a387724002d1c983","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            invoke_on_load\u003dTrue,"},{"line_number":51,"context_line":"            invoke_args\u003d()"},{"line_number":52,"context_line":"        )"},{"line_number":53,"context_line":"        self._notifications_repo \u003d mgr.driver"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _read_notification(self, req):"},{"line_number":56,"context_line":"        \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_1e785ec3","line":53,"updated":"2014-10-23 01:10:07.000000000","message":"Maybe we should create a helper. We keep re-creating this snippet of code in all the implementations.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            invoke_on_load\u003dTrue,"},{"line_number":51,"context_line":"            invoke_args\u003d()"},{"line_number":52,"context_line":"        )"},{"line_number":53,"context_line":"        self._notifications_repo \u003d mgr.driver"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _read_notification(self, req):"},{"line_number":56,"context_line":"        \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_bc5d8817","line":53,"in_reply_to":"9aa7fdbe_1e785ec3","updated":"2014-10-23 15:32:19.000000000","message":"yeah, for initializing the repo, good idea","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"a612cd4892269c9322334098a387724002d1c983","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            LOG.debug(ex)"},{"line_number":68,"context_line":"            raise falcon.HTTPBadRequest("},{"line_number":69,"context_line":"                \u0027Bad request\u0027,"},{"line_number":70,"context_line":"                \u0027Request body is not valid JSON\u0027)"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def _validate_notification(self, notification):"},{"line_number":73,"context_line":"        \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_de45f670","line":70,"updated":"2014-10-23 01:10:07.000000000","message":"Also, maybe we should create a helper for this too, as it is the same for metrics.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            LOG.debug(ex)"},{"line_number":68,"context_line":"            raise falcon.HTTPBadRequest("},{"line_number":69,"context_line":"                \u0027Bad request\u0027,"},{"line_number":70,"context_line":"                \u0027Request body is not valid JSON\u0027)"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def _validate_notification(self, notification):"},{"line_number":73,"context_line":"        \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_9cb7e439","line":70,"in_reply_to":"9aa7fdbe_de45f670","updated":"2014-10-23 15:32:19.000000000","message":"yep, good eye, it\u0027s the same","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"e27979610fbefa783a30246a19d8ccd8361a9c4c","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                notification_type,"},{"line_number":125,"context_line":"                address)"},{"line_number":126,"context_line":"        except repository_exceptions.DoesNotExistException:"},{"line_number":127,"context_line":"            msg \u003d \u0027No notification method exists for tenant_id \u003d %s id \u003d %s\u0027 % ("},{"line_number":128,"context_line":"                tenant_id, id)"},{"line_number":129,"context_line":"            raise falcon.HTTPError("},{"line_number":130,"context_line":"                status\u003d\"404 not found\","}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_285cfaec","line":127,"updated":"2014-10-23 13:47:07.000000000","message":"This same code block exists below. Maybe you should call a helper method?","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                notification_type,"},{"line_number":125,"context_line":"                address)"},{"line_number":126,"context_line":"        except repository_exceptions.DoesNotExistException:"},{"line_number":127,"context_line":"            msg \u003d \u0027No notification method exists for tenant_id \u003d %s id \u003d %s\u0027 % ("},{"line_number":128,"context_line":"                tenant_id, id)"},{"line_number":129,"context_line":"            raise falcon.HTTPError("},{"line_number":130,"context_line":"                status\u003d\"404 not found\","}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_1c0e94e5","line":127,"in_reply_to":"9aa7fdbe_285cfaec","updated":"2014-10-23 15:32:19.000000000","message":"I think you mean the exception handling part? I could create a helper for that.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"a612cd4892269c9322334098a387724002d1c983","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                status\u003d\"404 not found\","},{"line_number":131,"context_line":"                title\u003d\u0027Not Found\u0027,"},{"line_number":132,"context_line":"                description\u003dmsg,"},{"line_number":133,"context_line":"                code\u003d404)"},{"line_number":134,"context_line":"        except repository_exceptions.RepositoryException as ex:"},{"line_number":135,"context_line":"            LOG.error(ex)"},{"line_number":136,"context_line":"            raise falcon.HTTPInternalServerError("}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_5e07461c","line":133,"updated":"2014-10-23 01:10:07.000000000","message":"Do you really need to use multiple lines for these exceptions. Just trying to make the code as concise as possible, and this definitely stretches it out a bit.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                status\u003d\"404 not found\","},{"line_number":131,"context_line":"                title\u003d\u0027Not Found\u0027,"},{"line_number":132,"context_line":"                description\u003dmsg,"},{"line_number":133,"context_line":"                code\u003d404)"},{"line_number":134,"context_line":"        except repository_exceptions.RepositoryException as ex:"},{"line_number":135,"context_line":"            LOG.error(ex)"},{"line_number":136,"context_line":"            raise falcon.HTTPInternalServerError("}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_3ce198fe","line":133,"in_reply_to":"9aa7fdbe_5e07461c","updated":"2014-10-23 15:32:19.000000000","message":"I was getting pep8 errors about line length, I could condense it a bit.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"a612cd4892269c9322334098a387724002d1c983","unresolved":false,"context_lines":[{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _list_notifications(self, tenant_id, uri):"},{"line_number":153,"context_line":"        \u0027\u0027\u0027"},{"line_number":154,"context_line":"        Lists all notification for this tenant id."},{"line_number":155,"context_line":"        :param tenant_id: The tenant id."},{"line_number":156,"context_line":"        :raises: falcon.HTTPServiceUnavailable:"},{"line_number":157,"context_line":"        \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_010e4334","line":154,"updated":"2014-10-23 01:10:07.000000000","message":"Should be notifications with an \"s\"","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _list_notifications(self, tenant_id, uri):"},{"line_number":153,"context_line":"        \u0027\u0027\u0027"},{"line_number":154,"context_line":"        Lists all notification for this tenant id."},{"line_number":155,"context_line":"        :param tenant_id: The tenant id."},{"line_number":156,"context_line":"        :raises: falcon.HTTPServiceUnavailable:"},{"line_number":157,"context_line":"        \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_dcbc0cdf","line":154,"in_reply_to":"9aa7fdbe_010e4334","updated":"2014-10-23 15:32:19.000000000","message":"yes","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"e27979610fbefa783a30246a19d8ccd8361a9c4c","unresolved":false,"context_lines":[{"line_number":166,"context_line":"                \u0027Service unavailable\u0027,"},{"line_number":167,"context_line":"                ex.message)"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def _list_notifications_by_id(self, tenant_id, notification_id, uri):"},{"line_number":170,"context_line":"        \u0027\u0027\u0027"},{"line_number":171,"context_line":"        Lists the notification by id."},{"line_number":172,"context_line":"        :param tenant_id: The tenant id."}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_885326e1","line":169,"updated":"2014-10-23 13:47:07.000000000","message":"This should be _get_notification_by_id. It only returns one","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"},{"author":{"_account_id":12133,"name":"Cindy O\u0027Neill","email":"cindy.o-neill@hpe.com","username":"oneilcin"},"change_message_id":"03959d3f54b756e28162f2f71932ad13c5b31916","unresolved":false,"context_lines":[{"line_number":166,"context_line":"                \u0027Service unavailable\u0027,"},{"line_number":167,"context_line":"                ex.message)"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def _list_notifications_by_id(self, tenant_id, notification_id, uri):"},{"line_number":170,"context_line":"        \u0027\u0027\u0027"},{"line_number":171,"context_line":"        Lists the notification by id."},{"line_number":172,"context_line":"        :param tenant_id: The tenant id."}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_bcc3c855","line":169,"in_reply_to":"9aa7fdbe_885326e1","updated":"2014-10-23 15:32:19.000000000","message":"changing to list_notification, satisfies roland too.","commit_id":"b42310b8ba8097414dfdb8ca58f4280bdb39c341"}]}
