)]}'
{"ceilometer/meter/notifications.py":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d2aca63677c6cc5e45b1d3f8c19bfcfaaed6cd7b","unresolved":false,"context_lines":[{"line_number":11,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":12,"context_line":"# under the License."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import fnmatch"},{"line_number":15,"context_line":"import jsonpath_rw"},{"line_number":16,"context_line":"import os"},{"line_number":17,"context_line":"from oslo_config import cfg"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_89cdc15f","line":14,"updated":"2015-07-03 18:43:37.000000000","message":"move up to native group","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d2aca63677c6cc5e45b1d3f8c19bfcfaaed6cd7b","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# under the License."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import fnmatch"},{"line_number":15,"context_line":"import jsonpath_rw"},{"line_number":16,"context_line":"import os"},{"line_number":17,"context_line":"from oslo_config import cfg"},{"line_number":18,"context_line":"from oslo_log import log"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_c9eae9ac","line":15,"updated":"2015-07-03 18:43:37.000000000","message":"move down to middle 3rd party lib group","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d2aca63677c6cc5e45b1d3f8c19bfcfaaed6cd7b","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import fnmatch"},{"line_number":15,"context_line":"import jsonpath_rw"},{"line_number":16,"context_line":"import os"},{"line_number":17,"context_line":"from oslo_config import cfg"},{"line_number":18,"context_line":"from oslo_log import log"},{"line_number":19,"context_line":"import oslo_messaging"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_09e1b1d0","line":16,"updated":"2015-07-03 18:43:37.000000000","message":"move up to native group","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6924,"name":"Pradeep Kilambi","email":"pkilambi@redhat.com","username":"pkilambi"},"change_message_id":"a6fb5146703ce721f1f5eab3fdb054e28208ac17","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import fnmatch"},{"line_number":15,"context_line":"import jsonpath_rw"},{"line_number":16,"context_line":"import os"},{"line_number":17,"context_line":"from oslo_config import cfg"},{"line_number":18,"context_line":"from oslo_log import log"},{"line_number":19,"context_line":"import oslo_messaging"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_0eef3eb1","line":16,"in_reply_to":"ba3cc151_09e1b1d0","updated":"2015-07-06 18:49:16.000000000","message":"Done","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ffb36aa77bcc3c5c6a2d5aed6e3c55ae548b1a1c","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        :param conf: Configuration."},{"line_number":94,"context_line":"        \"\"\""},{"line_number":95,"context_line":"        targets \u003d []"},{"line_number":96,"context_line":"        exchanges \u003d ["},{"line_number":97,"context_line":"            conf.nova_control_exchange,"},{"line_number":98,"context_line":"            conf.cinder_control_exchange,"},{"line_number":99,"context_line":"            conf.glance_control_exchange,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_1015659a","line":96,"updated":"2015-07-03 10:21:33.000000000","message":"For future reference (that is, something to change later): Presumably this means this file needs to change every time a new control_exchange is created. Those kinds of in-code changes are exactly what we\u0027re hoping to avoid over the long term, yeah?","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d2aca63677c6cc5e45b1d3f8c19bfcfaaed6cd7b","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        :param conf: Configuration."},{"line_number":94,"context_line":"        \"\"\""},{"line_number":95,"context_line":"        targets \u003d []"},{"line_number":96,"context_line":"        exchanges \u003d ["},{"line_number":97,"context_line":"            conf.nova_control_exchange,"},{"line_number":98,"context_line":"            conf.cinder_control_exchange,"},{"line_number":99,"context_line":"            conf.glance_control_exchange,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_49c0192b","line":96,"in_reply_to":"ba3cc151_1015659a","updated":"2015-07-03 18:43:37.000000000","message":"this could be a list/set of string and then to keep backward compatbility we add in all these conf opts (if set) to the list","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6924,"name":"Pradeep Kilambi","email":"pkilambi@redhat.com","username":"pkilambi"},"change_message_id":"a6fb5146703ce721f1f5eab3fdb054e28208ac17","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        :param conf: Configuration."},{"line_number":94,"context_line":"        \"\"\""},{"line_number":95,"context_line":"        targets \u003d []"},{"line_number":96,"context_line":"        exchanges \u003d ["},{"line_number":97,"context_line":"            conf.nova_control_exchange,"},{"line_number":98,"context_line":"            conf.cinder_control_exchange,"},{"line_number":99,"context_line":"            conf.glance_control_exchange,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_5d93c1a3","line":96,"in_reply_to":"ba3cc151_49c0192b","updated":"2015-07-06 18:49:16.000000000","message":"agreed. I\u0027ll look into this as a subsequent improvement.","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d2aca63677c6cc5e45b1d3f8c19bfcfaaed6cd7b","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    def process_notification(self, notification_body):"},{"line_number":117,"context_line":"        config_def \u003d setup_meters_config()"},{"line_number":118,"context_line":"        self.event_types \u003d notification_body[\u0027event_type\u0027]"},{"line_number":119,"context_line":"        definitions \u003d ["},{"line_number":120,"context_line":"            MeterDefinition(event_def, notification_body)"},{"line_number":121,"context_line":"            for event_def in reversed(config_def[\u0027metric\u0027])]"},{"line_number":122,"context_line":"        for d in definitions:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_a90a0578","line":119,"updated":"2015-07-03 18:43:37.000000000","message":"another way would be to make everyone of these definitions it\u0027s own individual endpoint so the oslo.messaging can fan out the message to all of them... not sure if that makes a difference or if you gave it a try? this is not a request, just a question.","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d2aca63677c6cc5e45b1d3f8c19bfcfaaed6cd7b","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                projectid \u003d self.get_project_id(d, notification_body)"},{"line_number":126,"context_line":"                resourceid \u003d d.parse_fields(\u0027resource_id\u0027)"},{"line_number":127,"context_line":"                yield sample.Sample.from_notification("},{"line_number":128,"context_line":"                    name\u003dd.cfg[\u0027name\u0027] or self.event_types,"},{"line_number":129,"context_line":"                    type\u003dd.cfg[\u0027type\u0027],"},{"line_number":130,"context_line":"                    unit\u003dd.cfg[\u0027unit\u0027],"},{"line_number":131,"context_line":"                    volume\u003dself.get_volume(d),"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_09645147","line":128,"updated":"2015-07-03 18:43:37.000000000","message":"what\u0027s or self.event_types? i don\u0027t think we\u0027re making meter names from event type","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6924,"name":"Pradeep Kilambi","email":"pkilambi@redhat.com","username":"pkilambi"},"change_message_id":"a6fb5146703ce721f1f5eab3fdb054e28208ac17","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                projectid \u003d self.get_project_id(d, notification_body)"},{"line_number":126,"context_line":"                resourceid \u003d d.parse_fields(\u0027resource_id\u0027)"},{"line_number":127,"context_line":"                yield sample.Sample.from_notification("},{"line_number":128,"context_line":"                    name\u003dd.cfg[\u0027name\u0027] or self.event_types,"},{"line_number":129,"context_line":"                    type\u003dd.cfg[\u0027type\u0027],"},{"line_number":130,"context_line":"                    unit\u003dd.cfg[\u0027unit\u0027],"},{"line_number":131,"context_line":"                    volume\u003dself.get_volume(d),"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_ae2ad2e5","line":128,"in_reply_to":"ba3cc151_09645147","updated":"2015-07-06 18:49:16.000000000","message":"Done","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d2aca63677c6cc5e45b1d3f8c19bfcfaaed6cd7b","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                    resource_id\u003dresourceid,"},{"line_number":133,"context_line":"                    user_id\u003duserid,"},{"line_number":134,"context_line":"                    project_id\u003dprojectid,"},{"line_number":135,"context_line":"                    message\u003dnotification_body)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @staticmethod"},{"line_number":138,"context_line":"    def get_user_id(d, notification_body):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_29e4b5aa","line":135,"updated":"2015-07-03 18:43:37.000000000","message":"i don\u0027t know if we want to start enforcing this here but one of reasons our db is so large is because we\u0027re blindly capturing entire notification body as \u0027metadata\u0027","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ffb36aa77bcc3c5c6a2d5aed6e3c55ae548b1a1c","unresolved":false,"context_lines":[{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @staticmethod"},{"line_number":138,"context_line":"    def get_user_id(d, notification_body):"},{"line_number":139,"context_line":"        return d.parse_fields(\u0027user_id\u0027) or \\"},{"line_number":140,"context_line":"            notification_body.get(\u0027_context_user_id\u0027) or \\"},{"line_number":141,"context_line":"            notification_body.get(\u0027_context_user\u0027, None)"},{"line_number":142,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_902975e8","line":139,"updated":"2015-07-03 10:21:33.000000000","message":"Is parens rather than \\ the way to go these days?","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6924,"name":"Pradeep Kilambi","email":"pkilambi@redhat.com","username":"pkilambi"},"change_message_id":"a6fb5146703ce721f1f5eab3fdb054e28208ac17","unresolved":false,"context_lines":[{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @staticmethod"},{"line_number":138,"context_line":"    def get_user_id(d, notification_body):"},{"line_number":139,"context_line":"        return d.parse_fields(\u0027user_id\u0027) or \\"},{"line_number":140,"context_line":"            notification_body.get(\u0027_context_user_id\u0027) or \\"},{"line_number":141,"context_line":"            notification_body.get(\u0027_context_user\u0027, None)"},{"line_number":142,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_eef1ba96","line":139,"in_reply_to":"ba3cc151_6925dd08","updated":"2015-07-06 18:49:16.000000000","message":"Done","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d2aca63677c6cc5e45b1d3f8c19bfcfaaed6cd7b","unresolved":false,"context_lines":[{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @staticmethod"},{"line_number":138,"context_line":"    def get_user_id(d, notification_body):"},{"line_number":139,"context_line":"        return d.parse_fields(\u0027user_id\u0027) or \\"},{"line_number":140,"context_line":"            notification_body.get(\u0027_context_user_id\u0027) or \\"},{"line_number":141,"context_line":"            notification_body.get(\u0027_context_user\u0027, None)"},{"line_number":142,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_6925dd08","line":139,"in_reply_to":"ba3cc151_902975e8","updated":"2015-07-03 18:43:37.000000000","message":"yep","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d2aca63677c6cc5e45b1d3f8c19bfcfaaed6cd7b","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    def get_volume(d):"},{"line_number":151,"context_line":"        vol \u003d d.parse_fields(\u0027volume\u0027)"},{"line_number":152,"context_line":"        if vol is None:"},{"line_number":153,"context_line":"            return 1"},{"line_number":154,"context_line":"        return vol"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_291fd5b8","line":153,"updated":"2015-07-03 18:43:37.000000000","message":"return 1 if vol is None else vol\n\n\nthat said, i feel like vol should be a required attribute","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6924,"name":"Pradeep Kilambi","email":"pkilambi@redhat.com","username":"pkilambi"},"change_message_id":"a6fb5146703ce721f1f5eab3fdb054e28208ac17","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    def get_volume(d):"},{"line_number":151,"context_line":"        vol \u003d d.parse_fields(\u0027volume\u0027)"},{"line_number":152,"context_line":"        if vol is None:"},{"line_number":153,"context_line":"            return 1"},{"line_number":154,"context_line":"        return vol"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_6e34ca49","line":153,"in_reply_to":"ba3cc151_291fd5b8","updated":"2015-07-06 18:49:16.000000000","message":"Done","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"e1d4176aab28719dfd7adf38cfba9d0af3799f54","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        \"\"\"Return a sequence of oslo_messaging.Target"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        It is defining the exchange and topics to be connected for this plugin."},{"line_number":96,"context_line":"        :param conf: Configuration."},{"line_number":97,"context_line":"        \"\"\""},{"line_number":98,"context_line":"        targets \u003d []"},{"line_number":99,"context_line":"        exchanges \u003d ["}],"source_content_type":"text/x-python","patch_set":6,"id":"ba3cc151_90ca4b19","line":96,"updated":"2015-07-07 20:48:51.000000000","message":"add a TODO that this should really be defined in notification agent.","commit_id":"856fc1b3775f2bce9e50693cb7487120d04ac591"},{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"1dcb7a01109a0b892af9024a72312070defb089e","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        return targets"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def process_notification(self, notification_body):"},{"line_number":120,"context_line":"        config_def \u003d setup_meters_config()"},{"line_number":121,"context_line":"        self.event_types \u003d notification_body[\u0027event_type\u0027]"},{"line_number":122,"context_line":"        definitions \u003d ["},{"line_number":123,"context_line":"            MeterDefinition(event_def, notification_body)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba3cc151_bcd8761f","line":120,"updated":"2015-07-08 08:54:27.000000000","message":"I think we should avoid to load config file to every notification. Maybe it is better to move setup_meters_config to ProcessMeterNotifications initialization?","commit_id":"856fc1b3775f2bce9e50693cb7487120d04ac591"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"e1d4176aab28719dfd7adf38cfba9d0af3799f54","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                resourceid \u003d d.parse_fields(\u0027resource_id\u0027)"},{"line_number":130,"context_line":"                yield sample.Sample.from_notification("},{"line_number":131,"context_line":"                    name\u003dd.cfg[\u0027name\u0027],"},{"line_number":132,"context_line":"                    type\u003dd.cfg[\u0027type\u0027],"},{"line_number":133,"context_line":"                    unit\u003dd.cfg[\u0027unit\u0027],"},{"line_number":134,"context_line":"                    volume\u003dd.parse_fields(\u0027volume\u0027),"},{"line_number":135,"context_line":"                    resource_id\u003dresourceid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba3cc151_d01bf3c8","line":132,"updated":"2015-07-07 20:48:51.000000000","message":"should be validated","commit_id":"856fc1b3775f2bce9e50693cb7487120d04ac591"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"915d088cc824ac3a747101464cac3d852518c4a7","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                resourceid \u003d d.parse_fields(\u0027resource_id\u0027)"},{"line_number":130,"context_line":"                yield sample.Sample.from_notification("},{"line_number":131,"context_line":"                    name\u003dd.cfg[\u0027name\u0027],"},{"line_number":132,"context_line":"                    type\u003dd.cfg[\u0027type\u0027],"},{"line_number":133,"context_line":"                    unit\u003dd.cfg[\u0027unit\u0027],"},{"line_number":134,"context_line":"                    volume\u003dd.parse_fields(\u0027volume\u0027),"},{"line_number":135,"context_line":"                    resource_id\u003dresourceid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba3cc151_904d6b9b","line":132,"in_reply_to":"ba3cc151_d01bf3c8","updated":"2015-07-07 20:51:56.000000000","message":"i think it should be prevalidated during load","commit_id":"856fc1b3775f2bce9e50693cb7487120d04ac591"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"e1d4176aab28719dfd7adf38cfba9d0af3799f54","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                    name\u003dd.cfg[\u0027name\u0027],"},{"line_number":132,"context_line":"                    type\u003dd.cfg[\u0027type\u0027],"},{"line_number":133,"context_line":"                    unit\u003dd.cfg[\u0027unit\u0027],"},{"line_number":134,"context_line":"                    volume\u003dd.parse_fields(\u0027volume\u0027),"},{"line_number":135,"context_line":"                    resource_id\u003dresourceid,"},{"line_number":136,"context_line":"                    user_id\u003duserid,"},{"line_number":137,"context_line":"                    project_id\u003dprojectid,"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba3cc151_1022bb01","line":134,"updated":"2015-07-07 20:48:51.000000000","message":"should be validated","commit_id":"856fc1b3775f2bce9e50693cb7487120d04ac591"},{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"1dcb7a01109a0b892af9024a72312070defb089e","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            config \u003d cf.read()"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        try:"},{"line_number":170,"context_line":"            events_config \u003d yaml.safe_load(config)"},{"line_number":171,"context_line":"        except yaml.YAMLError as err:"},{"line_number":172,"context_line":"            if hasattr(err, \u0027problem_mark\u0027):"},{"line_number":173,"context_line":"                mark \u003d err.problem_mark"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba3cc151_1c3962d7","line":170,"updated":"2015-07-08 08:54:27.000000000","message":"s/events_config/meters_config","commit_id":"856fc1b3775f2bce9e50693cb7487120d04ac591"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"bf41c029bcf95980f1d2c07f8c25972c43ccc324","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"OPTS \u003d ["},{"line_number":29,"context_line":"    cfg.StrOpt(\u0027definitions_cfg_file\u0027,"},{"line_number":30,"context_line":"               default\u003d\"etc/ceilometer/meters.yaml\","},{"line_number":31,"context_line":"               help\u003d\"Configuration file for defining meter notifications.\""},{"line_number":32,"context_line":"               ),"},{"line_number":33,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_3a817cc3","line":30,"updated":"2015-07-09 13:28:43.000000000","message":"a slash need to added to the start of the above line, otherwise, the os.path.exists(config_file) will be always False usaully if we don\u0027t config this option","commit_id":"ae107329d37f2c5f3ff5cf9326b05d84b6b7276d"},{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"193513bb88091cf9dffdeaa891bfb4d5e5c96eff","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"OPTS \u003d ["},{"line_number":29,"context_line":"    cfg.StrOpt(\u0027definitions_cfg_file\u0027,"},{"line_number":30,"context_line":"               default\u003d\"etc/ceilometer/meters.yaml\","},{"line_number":31,"context_line":"               help\u003d\"Configuration file for defining meter notifications.\""},{"line_number":32,"context_line":"               ),"},{"line_number":33,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_9819a9d3","line":30,"in_reply_to":"ba3cc151_3a817cc3","updated":"2015-07-09 14:26:18.000000000","message":"I suggest to define default option as a default\u003d\"meters.yaml\" as in other yaml configs [1], [2], [3]. How i understand this path is relative to our config file but I can a mistake.\n\n\n[1] https://github.com/openstack/ceilometer/blob/master/ceilometer/event/converter.py#L31\n[2] https://github.com/openstack/ceilometer/blob/master/ceilometer/pipeline.py#L40\n[3]https://github.com/openstack/ceilometer/blob/master/ceilometer/pipeline.py#L44","commit_id":"ae107329d37f2c5f3ff5cf9326b05d84b6b7276d"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"bf41c029bcf95980f1d2c07f8c25972c43ccc324","unresolved":false,"context_lines":[{"line_number":134,"context_line":"    return meters_config"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"class ProcessMeterNotifications(plugin_base.NotificationBase):"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    event_types \u003d []"},{"line_number":140,"context_line":"    config_def \u003d setup_meters_config()"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_50f45fef","line":137,"updated":"2015-07-09 13:28:43.000000000","message":"this endpoint need to be added to the start of NotificationService. will be in another patch?","commit_id":"ae107329d37f2c5f3ff5cf9326b05d84b6b7276d"},{"author":{"_account_id":6924,"name":"Pradeep Kilambi","email":"pkilambi@redhat.com","username":"pkilambi"},"change_message_id":"392c8321b75aee4a8b978d6d79919ecb192704d2","unresolved":false,"context_lines":[{"line_number":134,"context_line":"    return meters_config"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"class ProcessMeterNotifications(plugin_base.NotificationBase):"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    event_types \u003d []"},{"line_number":140,"context_line":"    config_def \u003d setup_meters_config()"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_38017d05","line":137,"in_reply_to":"ba3cc151_50f45fef","updated":"2015-07-10 17:17:33.000000000","message":"yes if you look at the initial patchsets i had the extension. But  tempest dint like it as devstack dint know about this file yet. I\u0027ll add this as a subsequent patch to enable and disable the deprecated ones.","commit_id":"ae107329d37f2c5f3ff5cf9326b05d84b6b7276d"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"bf41c029bcf95980f1d2c07f8c25972c43ccc324","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            conf.trove_control_exchange,"},{"line_number":159,"context_line":"            conf.zaqar_control_exchange,"},{"line_number":160,"context_line":"            conf.swift_control_exchange,"},{"line_number":161,"context_line":"            conf.magnetodb_control_exchange,"},{"line_number":162,"context_line":"        ]"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        for exchange in exchanges:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_50ac5f9e","line":161,"updated":"2015-07-09 13:28:43.000000000","message":"the \u0027ceilometer_control_exchange\u0027 [1] need also to be added to exchanges list, but.. I\u0027m not sure that should be a particular case , because users may broken the posting samples functionality by config the definitions_cfg_file.\n\n[1] http://git.openstack.org/cgit/openstack/ceilometer/tree/ceilometer/telemetry/notifications.py#n22","commit_id":"ae107329d37f2c5f3ff5cf9326b05d84b6b7276d"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"bf41c029bcf95980f1d2c07f8c25972c43ccc324","unresolved":false,"context_lines":[{"line_number":170,"context_line":"    def process_notification(self, notification_body):"},{"line_number":171,"context_line":"        self.event_types \u003d notification_body[\u0027event_type\u0027]"},{"line_number":172,"context_line":"        definitions \u003d ["},{"line_number":173,"context_line":"            MeterDefinition(event_def, notification_body)"},{"line_number":174,"context_line":"            for event_def in reversed(self.config_def[\u0027metric\u0027])]"},{"line_number":175,"context_line":"        for d in definitions:"},{"line_number":176,"context_line":"            if d.match_type(self.event_types):"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_6bd2d85d","line":173,"updated":"2015-07-09 13:28:43.000000000","message":"it is better to move the definitions list out of the method to avoid initialization in every call in every notification processing \n\nand I think the notification_body don\u0027t need to be attached to every MeterDefinition. maybe it is better to define a class that parse the whole definitions_cfg_file.","commit_id":"ae107329d37f2c5f3ff5cf9326b05d84b6b7276d"},{"author":{"_account_id":6924,"name":"Pradeep Kilambi","email":"pkilambi@redhat.com","username":"pkilambi"},"change_message_id":"5cb165cb51758f7cca588dcb6e1f9a897c44a840","unresolved":false,"context_lines":[{"line_number":170,"context_line":"    def process_notification(self, notification_body):"},{"line_number":171,"context_line":"        self.event_types \u003d notification_body[\u0027event_type\u0027]"},{"line_number":172,"context_line":"        definitions \u003d ["},{"line_number":173,"context_line":"            MeterDefinition(event_def, notification_body)"},{"line_number":174,"context_line":"            for event_def in reversed(self.config_def[\u0027metric\u0027])]"},{"line_number":175,"context_line":"        for d in definitions:"},{"line_number":176,"context_line":"            if d.match_type(self.event_types):"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_5212d50a","line":173,"in_reply_to":"ba3cc151_46cd3fb6","updated":"2015-07-10 18:51:02.000000000","message":"i could move the notification parm out of the init and try passing to the parse_fields. Will push a patch set with changes.","commit_id":"ae107329d37f2c5f3ff5cf9326b05d84b6b7276d"},{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"193513bb88091cf9dffdeaa891bfb4d5e5c96eff","unresolved":false,"context_lines":[{"line_number":170,"context_line":"    def process_notification(self, notification_body):"},{"line_number":171,"context_line":"        self.event_types \u003d notification_body[\u0027event_type\u0027]"},{"line_number":172,"context_line":"        definitions \u003d ["},{"line_number":173,"context_line":"            MeterDefinition(event_def, notification_body)"},{"line_number":174,"context_line":"            for event_def in reversed(self.config_def[\u0027metric\u0027])]"},{"line_number":175,"context_line":"        for d in definitions:"},{"line_number":176,"context_line":"            if d.match_type(self.event_types):"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_789145f0","line":173,"in_reply_to":"ba3cc151_6bd2d85d","updated":"2015-07-09 14:26:18.000000000","message":"agree. It\u0027s better to move it to ProcessMeterNotifications initialization","commit_id":"ae107329d37f2c5f3ff5cf9326b05d84b6b7276d"},{"author":{"_account_id":6924,"name":"Pradeep Kilambi","email":"pkilambi@redhat.com","username":"pkilambi"},"change_message_id":"392c8321b75aee4a8b978d6d79919ecb192704d2","unresolved":false,"context_lines":[{"line_number":170,"context_line":"    def process_notification(self, notification_body):"},{"line_number":171,"context_line":"        self.event_types \u003d notification_body[\u0027event_type\u0027]"},{"line_number":172,"context_line":"        definitions \u003d ["},{"line_number":173,"context_line":"            MeterDefinition(event_def, notification_body)"},{"line_number":174,"context_line":"            for event_def in reversed(self.config_def[\u0027metric\u0027])]"},{"line_number":175,"context_line":"        for d in definitions:"},{"line_number":176,"context_line":"            if d.match_type(self.event_types):"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_46cd3fb6","line":173,"in_reply_to":"ba3cc151_789145f0","updated":"2015-07-10 17:17:33.000000000","message":"I thought about this. Since we sub class NotificationBase, the notification message is only accessible to us here and the init only takes a manager.","commit_id":"ae107329d37f2c5f3ff5cf9326b05d84b6b7276d"},{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"d7c49388ede767a36a89feee41ad7edf068e2969","unresolved":false,"context_lines":[{"line_number":58,"context_line":"            event_type \u003d self.cfg[\u0027event_type\u0027]"},{"line_number":59,"context_line":"        except KeyError as err:"},{"line_number":60,"context_line":"            raise MeterDefinitionException("},{"line_number":61,"context_line":"                _(\"Required field %s not specified\") % err.args[0], self.cfg)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        if isinstance(event_type, six.string_types):"},{"line_number":64,"context_line":"            event_type \u003d [event_type]"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a41bdd9_dd601138","line":61,"updated":"2015-07-13 18:06:28.000000000","message":"\".\" at EOL","commit_id":"d8378ce07019582e15ba4d179093064860d4bea0"},{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"d7c49388ede767a36a89feee41ad7edf068e2969","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    def _validate_type(self):"},{"line_number":88,"context_line":"        if self.cfg[\u0027type\u0027] not in sample.TYPES:"},{"line_number":89,"context_line":"            raise MeterDefinitionException("},{"line_number":90,"context_line":"                _(\"Invalid type %s specified\") % self.cfg[\u0027type\u0027], self.cfg)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"def get_config_file():"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a41bdd9_9d5a8982","line":90,"updated":"2015-07-13 18:06:28.000000000","message":"\".\" at EOL","commit_id":"d8378ce07019582e15ba4d179093064860d4bea0"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"7030ea9b3cf490f08f4ee9e7dbe0ebbe029e759a","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import oslo_messaging"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from ceilometer.agent import plugin_base"},{"line_number":25,"context_line":"from ceilometer.i18n import _"},{"line_number":26,"context_line":"from ceilometer import sample"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"OPTS \u003d ["}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_f6ecd4f4","line":25,"updated":"2015-07-15 01:30:13.000000000","message":"use _LE for exceptions","commit_id":"7d7ba1a633c11fbfde0e0eb6fcf8cc5ca0b6aaba"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"7030ea9b3cf490f08f4ee9e7dbe0ebbe029e759a","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    def __init__(self, manager):"},{"line_number":146,"context_line":"        super(ProcessMeterNotifications, self).__init__(manager)"},{"line_number":147,"context_line":"        self.definitions \u003d load_definitions(setup_meters_config())"},{"line_number":148,"context_line":"        self.manager \u003d manager"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def get_targets(self, conf):"},{"line_number":151,"context_line":"        \"\"\"Return a sequence of oslo_messaging.Target"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_3b546551","line":148,"updated":"2015-07-15 01:30:13.000000000","message":"drop this line. it\u0027s done in super class.","commit_id":"7d7ba1a633c11fbfde0e0eb6fcf8cc5ca0b6aaba"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"4fcfebfb81d73ee70bd154905c487f956ebb24b5","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    def match_type(self, meter_name):"},{"line_number":57,"context_line":"        try:"},{"line_number":58,"context_line":"            event_type \u003d self.cfg[\u0027event_type\u0027]"},{"line_number":59,"context_line":"        except KeyError as err:"},{"line_number":60,"context_line":"            raise MeterDefinitionException("},{"line_number":61,"context_line":"                _LE(\"Required field %s not specified\") % err.args[0], self.cfg)"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a41bdd9_9642d1ac","line":59,"updated":"2015-07-16 10:42:06.000000000","message":"This check could be done in __init__ to not doing it again and again, like _validate_type.","commit_id":"0a895a8212cdaa71c91c7f92b38057e6a0d0a3d9"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"4fcfebfb81d73ee70bd154905c487f956ebb24b5","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                _LE(\"Required field %s not specified\") % err.args[0], self.cfg)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        if isinstance(event_type, six.string_types):"},{"line_number":64,"context_line":"            event_type \u003d [event_type]"},{"line_number":65,"context_line":"        for t in event_type:"},{"line_number":66,"context_line":"            if fnmatch.fnmatch(meter_name, t):"},{"line_number":67,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a41bdd9_3153cf18","line":64,"updated":"2015-07-16 10:42:06.000000000","message":"This normalisation too.","commit_id":"0a895a8212cdaa71c91c7f92b38057e6a0d0a3d9"}],"ceilometer/tests/meter/test_notifications.py":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d2aca63677c6cc5e45b1d3f8c19bfcfaaed6cd7b","unresolved":false,"context_lines":[{"line_number":403,"context_line":"            self.path_get(\u0027etc/ceilometer/meters.yaml\u0027), group\u003d\u0027meter\u0027)"},{"line_number":404,"context_line":"        self.handler \u003d notifications.ProcessMeterNotifications(mock.Mock())"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    def _verify_common_counter(self, c, name, volume, resource_id):"},{"line_number":407,"context_line":"        self.assertIsNotNone(c)"},{"line_number":408,"context_line":"        self.assertEqual(name, c.name)"},{"line_number":409,"context_line":"        self.assertEqual(resource_id, c.resource_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_a9ae857f","line":406,"updated":"2015-07-03 18:43:37.000000000","message":"so i\u0027m wondering if we need to test each and every sample. it might be a tad verbose especially because one reason for this mechanism is to give user full flexibility to build whatever they want.","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"e1d4176aab28719dfd7adf38cfba9d0af3799f54","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"NOW \u003d datetime.datetime.isoformat(datetime.datetime.utcnow())"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"NOTIFICATION_SEND \u003d {"},{"line_number":33,"context_line":"    u\u0027event_type\u0027: u\u0027image.send\u0027,"},{"line_number":34,"context_line":"    u\u0027timestamp\u0027: NOW,"},{"line_number":35,"context_line":"    u\u0027message_id\u0027: fake_uuid(\u0027a\u0027),"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba3cc151_50012369","line":32,"updated":"2015-07-07 20:48:51.000000000","message":"i don\u0027t think we need this verbose testing tbh. i think we really just need to validate that each of the values of definition is validated appropriately. \n\nie. \n  - you can set all values to specific path\n  - volume is always numerical\n  - we can match to a specific event_type criteria\n  - you get multiple meters from common shared notification\n  - don\u0027t get meters when no matches\n  - type is valid option\n\ni\u0027m not sure the value of validating all the possible notifications especially since they are all madeup or are/will be stale.","commit_id":"856fc1b3775f2bce9e50693cb7487120d04ac591"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"7030ea9b3cf490f08f4ee9e7dbe0ebbe029e759a","unresolved":false,"context_lines":[{"line_number":45,"context_line":"class TestMeterDefinition(test.BaseTestCase):"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def setUp(self):"},{"line_number":48,"context_line":"        super(TestMeterDefinition, self).setUp()"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def test_config_definition(self):"},{"line_number":51,"context_line":"        cfg \u003d dict(name\u003d\"test\","}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_f65db415","line":48,"updated":"2015-07-15 01:30:13.000000000","message":"not needed","commit_id":"7d7ba1a633c11fbfde0e0eb6fcf8cc5ca0b6aaba"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"7030ea9b3cf490f08f4ee9e7dbe0ebbe029e759a","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        self.CONF.set_override("},{"line_number":89,"context_line":"            \u0027meter_definitions_cfg_file\u0027,"},{"line_number":90,"context_line":"            self.path_get(\u0027etc/ceilometer/meters.yaml\u0027), group\u003d\u0027meter\u0027)"},{"line_number":91,"context_line":"        self.mock_pm \u003d mock.MagicMock()"},{"line_number":92,"context_line":"        self.handler \u003d notifications.ProcessMeterNotifications(self.mock_pm)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def __setup_meter_def_file(self, cfg):"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_56a34000","line":91,"updated":"2015-07-15 01:30:13.000000000","message":"not needed","commit_id":"7d7ba1a633c11fbfde0e0eb6fcf8cc5ca0b6aaba"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"3053eab2e81175b3549cd7a3eb45bbe4edc96243","unresolved":false,"context_lines":[{"line_number":16,"context_line":"import six"},{"line_number":17,"context_line":"import yaml"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from oslo_config import fixture as fixture_config"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from ceilometer.meter import notifications"},{"line_number":22,"context_line":"from ceilometer.openstack.common import fileutils"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a41bdd9_9c01743c","line":19,"updated":"2015-07-16 17:32:54.000000000","message":"this should be grouped with above","commit_id":"0a895a8212cdaa71c91c7f92b38057e6a0d0a3d9"}],"etc/ceilometer/meters.yaml":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d2aca63677c6cc5e45b1d3f8c19bfcfaaed6cd7b","unresolved":false,"context_lines":[{"line_number":8,"context_line":"      - \"image.update\""},{"line_number":9,"context_line":"    type: \"gauge\""},{"line_number":10,"context_line":"    unit: B"},{"line_number":11,"context_line":"    counter_name: \"image.size\""},{"line_number":12,"context_line":"    volume: payload.size"},{"line_number":13,"context_line":"    resource_id: payload.id"},{"line_number":14,"context_line":"    project_id: payload.owner"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"ba3cc151_c9ae6998","line":11,"updated":"2015-07-03 18:43:37.000000000","message":"what\u0027s the difference between name and counter_name? let\u0027s not use counter regardless since we (unsuccessfully) dropped it many cycles ago.","commit_id":"069cefe66dc347d5e04143fcdd996aad3ff8aba1"}]}
