)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b89313a04ce37fa364f96ce05a1e58a4764f23b8","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Cristian A Sanchez \u003ccristian.a.sanchez@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-03-07 13:39:05 -0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Sends notifications at lease events"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This blueprint uses oslo.notify to send notifications when"},{"line_number":10,"context_line":"relevant lease events happen. This implementation adds new"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"AAAAVn%2F%2FBkI%3D","line":7,"updated":"2014-03-10 16:16:51.000000000","message":"\"and CRUD\" you could add","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b89313a04ce37fa364f96ce05a1e58a4764f23b8","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Sends notifications at lease events"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This blueprint uses oslo.notify to send notifications when"},{"line_number":10,"context_line":"relevant lease events happen. This implementation adds new"},{"line_number":11,"context_line":"event types and a new oslo.notify wrapper class."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I861540e5ec5d1309ded2de56b2135bae5b59dad9"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"AAAAVn%2F%2FB2M%3D","line":10,"updated":"2014-03-10 16:16:51.000000000","message":"what are relevant lease events .. do you mean all events ?\nwhich new event do you introduce? should be explicit in commit message","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"7b0772b51cd882c4ff4ae878c7252a69efea551e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Sends notifications at lease events"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This blueprint uses oslo.notify to send notifications when"},{"line_number":10,"context_line":"CURD lease opeations and executed and when relevant lease"},{"line_number":11,"context_line":"events happen (start_lease, before_end_lease, end_lease)."},{"line_number":12,"context_line":"This implementation also adds one new event type called"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAW3%2F%2FS5U%3D","line":9,"updated":"2014-04-15 15:28:30.000000000","message":"I think \"Climate uses oslo.notify\" is better than \"This blueprint uses oslo.notify\"","commit_id":"b6c980b11d73ceb113635391014fd8bc50ebba6c"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"7b0772b51cd882c4ff4ae878c7252a69efea551e","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Sends notifications at lease events"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This blueprint uses oslo.notify to send notifications when"},{"line_number":10,"context_line":"CURD lease opeations and executed and when relevant lease"},{"line_number":11,"context_line":"events happen (start_lease, before_end_lease, end_lease)."},{"line_number":12,"context_line":"This implementation also adds one new event type called"},{"line_number":13,"context_line":"before_end_lease to be sent when a lease is close to be ended."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAW3%2F%2FS6I%3D","line":10,"updated":"2014-04-15 15:28:30.000000000","message":"s/CURD/CRUD/\ns/opeations/operations/\ns/and/are/","commit_id":"b6c980b11d73ceb113635391014fd8bc50ebba6c"}],"climate/manager/notification/notifier.py":[{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b463e73f539136d594b0988b7bcb4f7467f21f5d","unresolved":false,"context_lines":[{"line_number":22,"context_line":"notification_opts \u003d ["},{"line_number":23,"context_line":"    cfg.BoolOpt(\u0027enabled\u0027,"},{"line_number":24,"context_line":"                default\u003dFalse,"},{"line_number":25,"context_line":"                help\u003d\u0027Notification mechanism enabled\u0027),"},{"line_number":26,"context_line":"    cfg.StrOpt(\u0027publisher\u0027,"},{"line_number":27,"context_line":"               default\u003d\"lease\","},{"line_number":28,"context_line":"               help\u003d\u0027Published ID for notifications\u0027),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAU3%2F%2F3jY%3D","line":25,"updated":"2014-02-24 13:09:19.000000000","message":"bad way : we should let oslo.messaging configuration decide to \"enable\" notifications if driver is set. see comment above.","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"7d8a7b065b694905ce3c027d2e85ae11690b485e","unresolved":false,"context_lines":[{"line_number":22,"context_line":"notification_opts \u003d ["},{"line_number":23,"context_line":"    cfg.BoolOpt(\u0027enabled\u0027,"},{"line_number":24,"context_line":"                default\u003dFalse,"},{"line_number":25,"context_line":"                help\u003d\u0027Notification mechanism enabled\u0027),"},{"line_number":26,"context_line":"    cfg.StrOpt(\u0027publisher\u0027,"},{"line_number":27,"context_line":"               default\u003d\"lease\","},{"line_number":28,"context_line":"               help\u003d\u0027Published ID for notifications\u0027),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAU3%2F%2Fcmk%3D","line":25,"in_reply_to":"AAAAU3%2F%2F3jY%3D","updated":"2014-02-28 21:15:47.000000000","message":"Done","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b463e73f539136d594b0988b7bcb4f7467f21f5d","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    cfg.StrOpt(\u0027publisher\u0027,"},{"line_number":27,"context_line":"               default\u003d\"lease\","},{"line_number":28,"context_line":"               help\u003d\u0027Published ID for notifications\u0027),"},{"line_number":29,"context_line":"    cfg.StrOpt(\u0027level\u0027,"},{"line_number":30,"context_line":"               default\u003d\"info\","},{"line_number":31,"context_line":"               help\u003d\"Notification level. Valid values: audit|debug|info|warn|\""},{"line_number":32,"context_line":"                    \"error|critical|sample\"),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAU3%2F%2F3jI%3D","line":29,"updated":"2014-02-24 13:09:19.000000000","message":"same here, must use oslo.messaging configuration : default_notification_level","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"7d8a7b065b694905ce3c027d2e85ae11690b485e","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    cfg.StrOpt(\u0027publisher\u0027,"},{"line_number":27,"context_line":"               default\u003d\"lease\","},{"line_number":28,"context_line":"               help\u003d\u0027Published ID for notifications\u0027),"},{"line_number":29,"context_line":"    cfg.StrOpt(\u0027level\u0027,"},{"line_number":30,"context_line":"               default\u003d\"info\","},{"line_number":31,"context_line":"               help\u003d\"Notification level. Valid values: audit|debug|info|warn|\""},{"line_number":32,"context_line":"                    \"error|critical|sample\"),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAU3%2F%2Fcmg%3D","line":29,"in_reply_to":"AAAAU3%2F%2F3jI%3D","updated":"2014-02-28 21:15:47.000000000","message":"Done","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b463e73f539136d594b0988b7bcb4f7467f21f5d","unresolved":false,"context_lines":[{"line_number":30,"context_line":"               default\u003d\"info\","},{"line_number":31,"context_line":"               help\u003d\"Notification level. Valid values: audit|debug|info|warn|\""},{"line_number":32,"context_line":"                    \"error|critical|sample\"),"},{"line_number":33,"context_line":"    cfg.StrOpt(\u0027topic\u0027,"},{"line_number":34,"context_line":"               default\u003d\u0027notifications\u0027,"},{"line_number":35,"context_line":"               help\u003d\u0027Notification topic\u0027),"},{"line_number":36,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAU3%2F%2F3jU%3D","line":33,"updated":"2014-02-24 13:09:19.000000000","message":"same here, use oslo.messaging configuration : notification_topics","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"7d8a7b065b694905ce3c027d2e85ae11690b485e","unresolved":false,"context_lines":[{"line_number":30,"context_line":"               default\u003d\"info\","},{"line_number":31,"context_line":"               help\u003d\"Notification level. Valid values: audit|debug|info|warn|\""},{"line_number":32,"context_line":"                    \"error|critical|sample\"),"},{"line_number":33,"context_line":"    cfg.StrOpt(\u0027topic\u0027,"},{"line_number":34,"context_line":"               default\u003d\u0027notifications\u0027,"},{"line_number":35,"context_line":"               help\u003d\u0027Notification topic\u0027),"},{"line_number":36,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAU3%2F%2Fcmc%3D","line":33,"in_reply_to":"AAAAU3%2F%2F3jU%3D","updated":"2014-02-28 21:15:47.000000000","message":"Done","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b463e73f539136d594b0988b7bcb4f7467f21f5d","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    def __init__(self):"},{"line_number":50,"context_line":"        self.notifier_method \u003d self._get_notify_method()"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def notify(self, context, event_type, payload):"},{"line_number":53,"context_line":"        if self.notifier_method:"},{"line_number":54,"context_line":"            # NOTE(casanch1) notification is ignored when callable notify"},{"line_number":55,"context_line":"            # is None. This means that notifications are not enabled"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAU3%2F%2F3NQ%3D","line":52,"updated":"2014-02-24 13:09:19.000000000","message":"You should add extra parameter \u0027level\u0027,\nuse CONF.default_notification_level by default if not provided","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b463e73f539136d594b0988b7bcb4f7467f21f5d","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    def notify(self, context, event_type, payload):"},{"line_number":53,"context_line":"        if self.notifier_method:"},{"line_number":54,"context_line":"            # NOTE(casanch1) notification is ignored when callable notify"},{"line_number":55,"context_line":"            # is None. This means that notifications are not enabled"},{"line_number":56,"context_line":"            self.notifier_method(context, event_type, payload)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _get_notify_method(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAU3%2F%2F3nM%3D","line":55,"updated":"2014-02-24 13:09:19.000000000","message":"This is oslo.messaging configuration options which must do this choice depending if notification_driver is set or not.","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b463e73f539136d594b0988b7bcb4f7467f21f5d","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            notifier \u003d notify.Notifier("},{"line_number":62,"context_line":"                transport\u003dmessaging.get_transport(cfg.CONF),"},{"line_number":63,"context_line":"                publisher_id\u003dcfg.CONF.notification.publisher,"},{"line_number":64,"context_line":"                topic\u003d\u0027notifications\u0027)"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"            notifier_method \u003d getattr(notifier,"},{"line_number":67,"context_line":"                                      cfg.CONF.notification.level,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAU3%2F%2F3jw%3D","line":64,"updated":"2014-02-24 13:09:19.000000000","message":"topic must be configurable and should be a list to permit to have many receiver.\nHopefully it\u0027s also a oslo.messaging option : notification_topics :)","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"}],"climate/manager/service.py":[{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b463e73f539136d594b0988b7bcb4f7467f21f5d","unresolved":false,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def list_leases(self):"},{"line_number":156,"context_line":"        return db_api.lease_list()"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    def create_lease(self, lease_values):"},{"line_number":159,"context_line":"        \"\"\"Create a lease with reservations."},{"line_number":160,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAU3%2F%2F3H8%3D","line":157,"updated":"2014-02-24 13:09:19.000000000","message":"we should send notification here at creation","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"7d8a7b065b694905ce3c027d2e85ae11690b485e","unresolved":false,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def list_leases(self):"},{"line_number":156,"context_line":"        return db_api.lease_list()"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    def create_lease(self, lease_values):"},{"line_number":159,"context_line":"        \"\"\"Create a lease with reservations."},{"line_number":160,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAVX%2F%2F3J8%3D","line":157,"in_reply_to":"AAAAU3%2F%2F3H8%3D","updated":"2014-02-28 21:15:47.000000000","message":"Done","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b463e73f539136d594b0988b7bcb4f7467f21f5d","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                db_api.lease_destroy(lease_id)"},{"line_number":221,"context_line":"            else:"},{"line_number":222,"context_line":"                return db_api.lease_get(lease[\u0027id\u0027])"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    def update_lease(self, lease_id, values):"},{"line_number":225,"context_line":"        if not values:"},{"line_number":226,"context_line":"            return db_api.lease_get(lease_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAU3%2F%2F3II%3D","line":223,"updated":"2014-02-24 13:09:19.000000000","message":"we should send notification here at updating","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"7d8a7b065b694905ce3c027d2e85ae11690b485e","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                db_api.lease_destroy(lease_id)"},{"line_number":221,"context_line":"            else:"},{"line_number":222,"context_line":"                return db_api.lease_get(lease[\u0027id\u0027])"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    def update_lease(self, lease_id, values):"},{"line_number":225,"context_line":"        if not values:"},{"line_number":226,"context_line":"            return db_api.lease_get(lease_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAVX%2F%2Ft0s%3D","line":223,"in_reply_to":"AAAAU3%2F%2F3II%3D","updated":"2014-02-28 21:15:47.000000000","message":"Done","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b463e73f539136d594b0988b7bcb4f7467f21f5d","unresolved":false,"context_lines":[{"line_number":331,"context_line":"        with trusts.create_ctx_from_trust(lease[\u0027trust_id\u0027]) as context:"},{"line_number":332,"context_line":"            self._basic_action(lease_id, event_id, \u0027on_start\u0027, \u0027active\u0027)"},{"line_number":333,"context_line":"            self.notifier.notify(context, \u0027start_lease\u0027,"},{"line_number":334,"context_line":"                                 self._get_lease_payload(lease))"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"    def end_lease(self, lease_id, event_id):"},{"line_number":337,"context_line":"        lease \u003d self.get_lease(lease_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAU3%2F%2F3GQ%3D","line":334,"updated":"2014-02-24 13:09:19.000000000","message":"Those notifications can be by passed if the user redefine per plugins method handler see L107\n\nSending notifications should take place somewhere we sure they will be always sent : ie in _event.()\n\nMay we need to rework our plugin interface.","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"7d8a7b065b694905ce3c027d2e85ae11690b485e","unresolved":false,"context_lines":[{"line_number":331,"context_line":"        with trusts.create_ctx_from_trust(lease[\u0027trust_id\u0027]) as context:"},{"line_number":332,"context_line":"            self._basic_action(lease_id, event_id, \u0027on_start\u0027, \u0027active\u0027)"},{"line_number":333,"context_line":"            self.notifier.notify(context, \u0027start_lease\u0027,"},{"line_number":334,"context_line":"                                 self._get_lease_payload(lease))"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"    def end_lease(self, lease_id, event_id):"},{"line_number":337,"context_line":"        lease \u003d self.get_lease(lease_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAVX%2F%2FtX0%3D","line":334,"in_reply_to":"AAAAU3%2F%2F3GQ%3D","updated":"2014-02-28 21:15:47.000000000","message":"done. \nEvents are send after they are processed. But CRUD operations are still notified from each method","commit_id":"bc803177852ccf0b8653371673211e91b4eed0b7"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b89313a04ce37fa364f96ce05a1e58a4764f23b8","unresolved":false,"context_lines":[{"line_number":38,"context_line":"                help\u003d\u0027All plugins to use (one for every resource type to \u0027"},{"line_number":39,"context_line":"                     \u0027support.)\u0027),"},{"line_number":40,"context_line":"    cfg.IntOpt(\u0027pre_end_lease_hours\u0027,"},{"line_number":41,"context_line":"               default\u003d48,"},{"line_number":42,"context_line":"               help\u003d\u0027Number of hours prior to lead end in which a Lease to \u0027"},{"line_number":43,"context_line":"                    \u0027expire notification will be sent\u0027)"},{"line_number":44,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FCQY%3D","line":41,"updated":"2014-03-10 16:16:51.000000000","message":"what\u0027s happen when leases are less than 2 days ?\n\nmore important,\nI think the name is not relevant, Do that mean : send a notification before X hours the end ? if yes, we can simply to name it like \u0027notify_x_hours_before_the_end\u0027\n\nwith set to 0 disable the feature.\n\nOr may be you would like implement a more generic event \u0027before end\" ?","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a39ea4c3342d79625107b1d51f1f6734877f29b4","unresolved":false,"context_lines":[{"line_number":38,"context_line":"                help\u003d\u0027All plugins to use (one for every resource type to \u0027"},{"line_number":39,"context_line":"                     \u0027support.)\u0027),"},{"line_number":40,"context_line":"    cfg.IntOpt(\u0027pre_end_lease_hours\u0027,"},{"line_number":41,"context_line":"               default\u003d48,"},{"line_number":42,"context_line":"               help\u003d\u0027Number of hours prior to lead end in which a Lease to \u0027"},{"line_number":43,"context_line":"                    \u0027expire notification will be sent\u0027)"},{"line_number":44,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAWH%2F%2Fq%2Fw%3D","line":41,"in_reply_to":"AAAAVn%2F%2B2ao%3D","updated":"2014-03-14 15:38:07.000000000","message":"don\u0027t like too :)","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"03ac8eaf910e7c8b28ca4114501cbb4470606c7c","unresolved":false,"context_lines":[{"line_number":38,"context_line":"                help\u003d\u0027All plugins to use (one for every resource type to \u0027"},{"line_number":39,"context_line":"                     \u0027support.)\u0027),"},{"line_number":40,"context_line":"    cfg.IntOpt(\u0027pre_end_lease_hours\u0027,"},{"line_number":41,"context_line":"               default\u003d48,"},{"line_number":42,"context_line":"               help\u003d\u0027Number of hours prior to lead end in which a Lease to \u0027"},{"line_number":43,"context_line":"                    \u0027expire notification will be sent\u0027)"},{"line_number":44,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2B2ao%3D","line":41,"in_reply_to":"AAAAVn%2F%2FCQY%3D","updated":"2014-03-11 19:29:05.000000000","message":"I will rename the event to: \"before_end\". \nThe name of the configuration item is: \"notify_hours_before_lease_end\". Didn\u0027t like the x there.","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b89313a04ce37fa364f96ce05a1e58a4764f23b8","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def list_leases(self, tenant_id\u003dNone):"},{"line_number":164,"context_line":"        return db_api.lease_list(tenant_id)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def create_lease(self, lease_values):"},{"line_number":167,"context_line":"        \"\"\"Create a lease with reservations."},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FBro%3D","line":165,"updated":"2014-03-10 16:16:51.000000000","message":"we could need a notificaiton at lease creation too","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"03ac8eaf910e7c8b28ca4114501cbb4470606c7c","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def list_leases(self, tenant_id\u003dNone):"},{"line_number":164,"context_line":"        return db_api.lease_list(tenant_id)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def create_lease(self, lease_values):"},{"line_number":167,"context_line":"        \"\"\"Create a lease with reservations."},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2B2ag%3D","line":165,"in_reply_to":"AAAAVn%2F%2FBro%3D","updated":"2014-03-11 19:29:05.000000000","message":"Done","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b89313a04ce37fa364f96ce05a1e58a4764f23b8","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                                       \u0027time\u0027: start_date,"},{"line_number":207,"context_line":"                                       \u0027status\u0027: \u0027UNDONE\u0027})"},{"line_number":208,"context_line":"        lease_values[\u0027events\u0027].append({\u0027event_type\u0027: \u0027pre_end_lease\u0027,"},{"line_number":209,"context_line":"                                       \u0027time\u0027: end_date - delta,"},{"line_number":210,"context_line":"                                       \u0027status\u0027: \u0027UNDONE\u0027})"},{"line_number":211,"context_line":"        lease_values[\u0027events\u0027].append({\u0027event_type\u0027: \u0027end_lease\u0027,"},{"line_number":212,"context_line":"                                       \u0027time\u0027: end_date,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FB%2Fw%3D","line":209,"updated":"2014-03-10 16:16:51.000000000","message":"what\u0027s happen when the reservation period is \u003e than delta?\nMay be an event before the start of the lease ? at least we create an useless entry in db.","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a39ea4c3342d79625107b1d51f1f6734877f29b4","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                                       \u0027time\u0027: start_date,"},{"line_number":207,"context_line":"                                       \u0027status\u0027: \u0027UNDONE\u0027})"},{"line_number":208,"context_line":"        lease_values[\u0027events\u0027].append({\u0027event_type\u0027: \u0027pre_end_lease\u0027,"},{"line_number":209,"context_line":"                                       \u0027time\u0027: end_date - delta,"},{"line_number":210,"context_line":"                                       \u0027status\u0027: \u0027UNDONE\u0027})"},{"line_number":211,"context_line":"        lease_values[\u0027events\u0027].append({\u0027event_type\u0027: \u0027end_lease\u0027,"},{"line_number":212,"context_line":"                                       \u0027time\u0027: end_date,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAWH%2F%2Fq%2BE%3D","line":209,"in_reply_to":"AAAAVn%2F%2B2Qc%3D","updated":"2014-03-14 15:38:07.000000000","message":"if you mean sending the notification at start time all time if before_end \u003e\u003d start time : ok, why not.","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"03ac8eaf910e7c8b28ca4114501cbb4470606c7c","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                                       \u0027time\u0027: start_date,"},{"line_number":207,"context_line":"                                       \u0027status\u0027: \u0027UNDONE\u0027})"},{"line_number":208,"context_line":"        lease_values[\u0027events\u0027].append({\u0027event_type\u0027: \u0027pre_end_lease\u0027,"},{"line_number":209,"context_line":"                                       \u0027time\u0027: end_date - delta,"},{"line_number":210,"context_line":"                                       \u0027status\u0027: \u0027UNDONE\u0027})"},{"line_number":211,"context_line":"        lease_values[\u0027events\u0027].append({\u0027event_type\u0027: \u0027end_lease\u0027,"},{"line_number":212,"context_line":"                                       \u0027time\u0027: end_date,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2B2Qc%3D","line":209,"in_reply_to":"AAAAVn%2F%2FB%2Fw%3D","updated":"2014-03-11 19:29:05.000000000","message":"What if the pre_end_lease event has the same date of the start of the lease? It may make sense to have both events in the same date. Because it is starting AND it is also close to end... \n\nWhat do you think?","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b89313a04ce37fa364f96ce05a1e58a4764f23b8","unresolved":false,"context_lines":[{"line_number":318,"context_line":"            raise common_ex.ClimateException("},{"line_number":319,"context_line":"                \u0027End lease event not found\u0027)"},{"line_number":320,"context_line":"        db_api.event_update(event[\u0027id\u0027], {\u0027time\u0027: values[\u0027end_date\u0027]})"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        event \u003d db_api.event_get_first_sorted_by_filters("},{"line_number":323,"context_line":"            \u0027lease_id\u0027,"},{"line_number":324,"context_line":"            \u0027asc\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FCGU%3D","line":321,"updated":"2014-03-10 16:16:51.000000000","message":"I think this method is enough complex, could you please split new code in separate method(s).\nWill be more maintainable and readable.","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"03ac8eaf910e7c8b28ca4114501cbb4470606c7c","unresolved":false,"context_lines":[{"line_number":318,"context_line":"            raise common_ex.ClimateException("},{"line_number":319,"context_line":"                \u0027End lease event not found\u0027)"},{"line_number":320,"context_line":"        db_api.event_update(event[\u0027id\u0027], {\u0027time\u0027: values[\u0027end_date\u0027]})"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        event \u003d db_api.event_get_first_sorted_by_filters("},{"line_number":323,"context_line":"            \u0027lease_id\u0027,"},{"line_number":324,"context_line":"            \u0027asc\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2B2P0%3D","line":321,"in_reply_to":"AAAAVn%2F%2FCGU%3D","updated":"2014-03-11 19:29:05.000000000","message":"Will do","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b89313a04ce37fa364f96ce05a1e58a4764f23b8","unresolved":false,"context_lines":[{"line_number":383,"context_line":"    def pre_end_lease(self, lease_id, event_id):"},{"line_number":384,"context_line":"        lease \u003d self.get_lease(lease_id)"},{"line_number":385,"context_line":"        with trusts.create_ctx_from_trust(lease[\u0027trust_id\u0027]):"},{"line_number":386,"context_line":"            self._basic_action(lease_id, event_id, \u0027on_pre_end\u0027)"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"    def _basic_action(self, lease_id, event_id, action_time,"},{"line_number":389,"context_line":"                      reservation_status\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FBqc%3D","line":386,"updated":"2014-03-10 16:16:51.000000000","message":"If you followed me (useless event exposed to plugins), you can send the notification here AND don\u0027t call anymore the basic_actin from the plugin.","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"03ac8eaf910e7c8b28ca4114501cbb4470606c7c","unresolved":false,"context_lines":[{"line_number":383,"context_line":"    def pre_end_lease(self, lease_id, event_id):"},{"line_number":384,"context_line":"        lease \u003d self.get_lease(lease_id)"},{"line_number":385,"context_line":"        with trusts.create_ctx_from_trust(lease[\u0027trust_id\u0027]):"},{"line_number":386,"context_line":"            self._basic_action(lease_id, event_id, \u0027on_pre_end\u0027)"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"    def _basic_action(self, lease_id, event_id, action_time,"},{"line_number":389,"context_line":"                      reservation_status\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2B2NM%3D","line":386,"in_reply_to":"AAAAVn%2F%2FBqc%3D","updated":"2014-03-11 19:29:05.000000000","message":"Notifications for ALL events are sent in the _event method. And are sent separately for lease creation, modification and deletion. So, here I can just put a pass. Maybe in the future something can be done apart from sending the notification. \n\nWill also remove the plugin method, so the call to _basic_action will not be needed anymore.","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b89313a04ce37fa364f96ce05a1e58a4764f23b8","unresolved":false,"context_lines":[{"line_number":410,"context_line":""},{"line_number":411,"context_line":"        db_api.event_update(event_id, {\u0027status\u0027: \u0027DONE\u0027})"},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"    def _get_lease_payload(self, lease):"},{"line_number":414,"context_line":"        return {"},{"line_number":415,"context_line":"            \u0027lease_id\u0027: lease[\u0027id\u0027],"},{"line_number":416,"context_line":"            \u0027user_id\u0027: lease[\u0027user_id\u0027],"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FCH4%3D","line":413,"updated":"2014-03-10 16:16:51.000000000","message":"I would prefere to put this in climate/notification/api.py with function named like format_lease_payload() or something.\nBecause we ca see notifications like a new API for the world ie ceilometer","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"03ac8eaf910e7c8b28ca4114501cbb4470606c7c","unresolved":false,"context_lines":[{"line_number":410,"context_line":""},{"line_number":411,"context_line":"        db_api.event_update(event_id, {\u0027status\u0027: \u0027DONE\u0027})"},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"    def _get_lease_payload(self, lease):"},{"line_number":414,"context_line":"        return {"},{"line_number":415,"context_line":"            \u0027lease_id\u0027: lease[\u0027id\u0027],"},{"line_number":416,"context_line":"            \u0027user_id\u0027: lease[\u0027user_id\u0027],"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2B2M8%3D","line":413,"in_reply_to":"AAAAVn%2F%2FCH4%3D","updated":"2014-03-11 19:29:05.000000000","message":"Will do","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"7b0772b51cd882c4ff4ae878c7252a69efea551e","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            actions[resource_type][\u0027on_end\u0027] \u003d plugin.on_end"},{"line_number":117,"context_line":"            plugin.setup(None)"},{"line_number":118,"context_line":"        return actions"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    @service_utils.with_empty_context"},{"line_number":121,"context_line":"    def _event(self):"},{"line_number":122,"context_line":"        \"\"\"Tries to commit event."}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAW3%2F%2FSsw%3D","line":119,"updated":"2014-04-15 15:28:30.000000000","message":"This decorator could be in conflict with my comment on _send_notification()","commit_id":"b6c980b11d73ceb113635391014fd8bc50ebba6c"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"7b0772b51cd882c4ff4ae878c7252a69efea551e","unresolved":false,"context_lines":[{"line_number":416,"context_line":"        if ctx:"},{"line_number":417,"context_line":"            notify(payload, events, ctx)"},{"line_number":418,"context_line":"        else:"},{"line_number":419,"context_line":"            with trusts.create_ctx_from_trust(lease[\u0027trust_id\u0027]) as ctx:"},{"line_number":420,"context_line":"                notify(payload, events, ctx)"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"    def _update_before_end_event_date(self, event, delta, lease):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAW3%2F%2FStI%3D","line":419,"updated":"2014-04-15 15:28:30.000000000","message":"Maybe could be better to let the method that calls _send_notification() to decide if want to use trusts or not. I think would be better to get the current context instead of creating a new one (climate.context.current())","commit_id":"b6c980b11d73ceb113635391014fd8bc50ebba6c"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"14f65dc59238b7b043c0a18259028fecbf83f1af","unresolved":false,"context_lines":[{"line_number":416,"context_line":"        if ctx:"},{"line_number":417,"context_line":"            notify(payload, events, ctx)"},{"line_number":418,"context_line":"        else:"},{"line_number":419,"context_line":"            with trusts.create_ctx_from_trust(lease[\u0027trust_id\u0027]) as ctx:"},{"line_number":420,"context_line":"                notify(payload, events, ctx)"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"    def _update_before_end_event_date(self, event, delta, lease):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAW3%2F%2FSFg%3D","line":419,"in_reply_to":"AAAAW3%2F%2FStI%3D","updated":"2014-04-15 18:39:08.000000000","message":"now a context will be created before making the call to this method","commit_id":"b6c980b11d73ceb113635391014fd8bc50ebba6c"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"54d70e3597b65928ae02773d4bdd8b2414584e01","unresolved":false,"context_lines":[{"line_number":381,"context_line":"            self._basic_action(lease_id, event_id, \u0027on_end\u0027, \u0027deleted\u0027)"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    def before_end_lease(self, lease_id, event_id):"},{"line_number":384,"context_line":"        # Note(casanch1) This is only a placeholder for future implementation."},{"line_number":385,"context_line":"        # It might be needed to do something when a lease is close to expire."},{"line_number":386,"context_line":"        pass"},{"line_number":387,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAXH%2F%2Fp6s%3D","line":384,"updated":"2014-04-18 13:57:04.000000000","message":"should be addressed in an other patch, no need this eventual \u0027remainder\u0027 code","commit_id":"b61b46f951c02d930eb39cee9a0b6f74dbda3ce8"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"d1c41205578e51c8a4c25838333d9c917d4e4c3c","unresolved":false,"context_lines":[{"line_number":381,"context_line":"            self._basic_action(lease_id, event_id, \u0027on_end\u0027, \u0027deleted\u0027)"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    def before_end_lease(self, lease_id, event_id):"},{"line_number":384,"context_line":"        # Note(casanch1) This is only a placeholder for future implementation."},{"line_number":385,"context_line":"        # It might be needed to do something when a lease is close to expire."},{"line_number":386,"context_line":"        pass"},{"line_number":387,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAXH%2F%2FeEc%3D","line":384,"in_reply_to":"AAAAXH%2F%2Fp6s%3D","updated":"2014-04-21 15:16:46.000000000","message":"Done","commit_id":"b61b46f951c02d930eb39cee9a0b6f74dbda3ce8"}],"climate/notification/notifier.py":[{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"7b0772b51cd882c4ff4ae878c7252a69efea551e","unresolved":false,"context_lines":[{"line_number":27,"context_line":"SERVICE \u003d \u0027lease\u0027"},{"line_number":28,"context_line":"CONF \u003d cfg.CONF"},{"line_number":29,"context_line":"CONF.register_opts(notification_opts, \u0027notifications\u0027)"},{"line_number":30,"context_line":"CONF \u003d cfg.CONF"},{"line_number":31,"context_line":"TRANSPORT \u003d None"},{"line_number":32,"context_line":"NOTIFIER \u003d None"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAW3%2F%2FSiA%3D","line":30,"updated":"2014-04-15 15:28:30.000000000","message":"Remove this line","commit_id":"b6c980b11d73ceb113635391014fd8bc50ebba6c"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"14f65dc59238b7b043c0a18259028fecbf83f1af","unresolved":false,"context_lines":[{"line_number":27,"context_line":"SERVICE \u003d \u0027lease\u0027"},{"line_number":28,"context_line":"CONF \u003d cfg.CONF"},{"line_number":29,"context_line":"CONF.register_opts(notification_opts, \u0027notifications\u0027)"},{"line_number":30,"context_line":"CONF \u003d cfg.CONF"},{"line_number":31,"context_line":"TRANSPORT \u003d None"},{"line_number":32,"context_line":"NOTIFIER \u003d None"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAW3%2F%2FSE8%3D","line":30,"in_reply_to":"AAAAW3%2F%2FSiA%3D","updated":"2014-04-15 18:39:08.000000000","message":"will do","commit_id":"b6c980b11d73ceb113635391014fd8bc50ebba6c"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"7b0772b51cd882c4ff4ae878c7252a69efea551e","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        self._notify(context, \u0027info\u0027, notification, lease)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _notify(self, context, level, event_type, payload):"},{"line_number":66,"context_line":"        notifier \u003d get_notifier(CONF.notifications.publisher_id)"},{"line_number":67,"context_line":"        method \u003d getattr(notifier, level, None)"},{"line_number":68,"context_line":"        if method:"},{"line_number":69,"context_line":"            method(context, event_type, payload)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAW3%2F%2FSOk%3D","line":66,"updated":"2014-04-15 15:28:30.000000000","message":"Seems that the notifier is prepared all the times. Is this needed? The configuration is loaded when climate starts, so the publisher id should not change until climate is restarted.","commit_id":"b6c980b11d73ceb113635391014fd8bc50ebba6c"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"14f65dc59238b7b043c0a18259028fecbf83f1af","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        self._notify(context, \u0027info\u0027, notification, lease)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _notify(self, context, level, event_type, payload):"},{"line_number":66,"context_line":"        notifier \u003d get_notifier(CONF.notifications.publisher_id)"},{"line_number":67,"context_line":"        method \u003d getattr(notifier, level, None)"},{"line_number":68,"context_line":"        if method:"},{"line_number":69,"context_line":"            method(context, event_type, payload)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAW3%2F%2FR%2BQ%3D","line":66,"in_reply_to":"AAAAW3%2F%2FSOk%3D","updated":"2014-04-15 18:39:08.000000000","message":"I will change get_notifier method to return the created instance.","commit_id":"b6c980b11d73ceb113635391014fd8bc50ebba6c"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"7b0772b51cd882c4ff4ae878c7252a69efea551e","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _notify(self, context, level, event_type, payload):"},{"line_number":66,"context_line":"        notifier \u003d get_notifier(CONF.notifications.publisher_id)"},{"line_number":67,"context_line":"        method \u003d getattr(notifier, level, None)"},{"line_number":68,"context_line":"        if method:"},{"line_number":69,"context_line":"            method(context, event_type, payload)"},{"line_number":70,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAW3%2F%2FSM8%3D","line":67,"updated":"2014-04-15 15:28:30.000000000","message":"You could remove the if changing the None for \u0027info\u0027","commit_id":"b6c980b11d73ceb113635391014fd8bc50ebba6c"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"14f65dc59238b7b043c0a18259028fecbf83f1af","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _notify(self, context, level, event_type, payload):"},{"line_number":66,"context_line":"        notifier \u003d get_notifier(CONF.notifications.publisher_id)"},{"line_number":67,"context_line":"        method \u003d getattr(notifier, level, None)"},{"line_number":68,"context_line":"        if method:"},{"line_number":69,"context_line":"            method(context, event_type, payload)"},{"line_number":70,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAW3%2F%2FR%2BE%3D","line":67,"in_reply_to":"AAAAW3%2F%2FSM8%3D","updated":"2014-04-15 18:39:08.000000000","message":"you\u0027re right. I will change this.","commit_id":"b6c980b11d73ceb113635391014fd8bc50ebba6c"}],"climate/notification/rpc.py":[{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b89313a04ce37fa364f96ce05a1e58a4764f23b8","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from oslo import messaging"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo.config import cfg"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FBmQ%3D","line":15,"updated":"2014-03-10 16:16:51.000000000","message":"the name \u0027rpc\u0027 disturbs me in the \u0027notification\u0027 namespace module,\n\nbecause for me, the Remote Procedure Call is a different thing than notifications although they use the same transport.\n\nmay I\u0027am wrong here.","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a39ea4c3342d79625107b1d51f1f6734877f29b4","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from oslo import messaging"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo.config import cfg"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAWH%2F%2Fq4k%3D","line":15,"in_reply_to":"AAAAVn%2F%2B2L8%3D","updated":"2014-03-14 15:38:07.000000000","message":"There are many things in NOVA which are historic .. not necessarily the state of the art  IMHO ;)","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"03ac8eaf910e7c8b28ca4114501cbb4470606c7c","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from oslo import messaging"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo.config import cfg"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2B2L8%3D","line":15,"in_reply_to":"AAAAVn%2F%2FBmQ%3D","updated":"2014-03-11 19:29:05.000000000","message":"here I followed Nova\u0027s approach. It also looked wrong for me. I can change the name to factory or something like that","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"402e3974790080314fe47b18e67c8270a4cafbe8","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from oslo import messaging"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo.config import cfg"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAWH%2F%2FqoE%3D","line":15,"in_reply_to":"AAAAWH%2F%2Fq4k%3D","updated":"2014-03-14 16:00:33.000000000","message":"I thought more about this and decided to refactor the whole thing. Now I have embedded this in notification/notifier.py.","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"}],"climate/plugins/base.py":[{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b89313a04ce37fa364f96ce05a1e58a4764f23b8","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        \"\"\"Wake up resource.\"\"\""},{"line_number":86,"context_line":"        pass"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    @abc.abstractmethod"},{"line_number":89,"context_line":"    def on_pre_end(self, resource_id):"},{"line_number":90,"context_line":"        \"\"\"Prepare to delete resource.\"\"\""},{"line_number":91,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FB0k%3D","line":88,"updated":"2014-03-10 16:16:51.000000000","message":"IIRC, this event is never \u0027implemented\u0027, do you want to send a notification with ?\n\nIf the goal is to send a notification before the end of a lease, I think this event souldn\u0027t be exposed to plugins.\nJust have a configuration option to set the \"time before the end\" to send the notification and manage that in the event handler (aka the manager for now)","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"03ac8eaf910e7c8b28ca4114501cbb4470606c7c","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        \"\"\"Wake up resource.\"\"\""},{"line_number":86,"context_line":"        pass"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    @abc.abstractmethod"},{"line_number":89,"context_line":"    def on_pre_end(self, resource_id):"},{"line_number":90,"context_line":"        \"\"\"Prepare to delete resource.\"\"\""},{"line_number":91,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2B2Lc%3D","line":88,"in_reply_to":"AAAAVn%2F%2FB0k%3D","updated":"2014-03-11 19:29:05.000000000","message":"Agree. Will remove this.","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"}],"climate/tests/manager/test_service.py":[{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"37f9e4f23158e165ebfbd3a50c9a88fb382cb78f","unresolved":false,"context_lines":[{"line_number":16,"context_line":"import datetime"},{"line_number":17,"context_line":"import eventlet"},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":"from mox import IsA  # noqa"},{"line_number":20,"context_line":"from oslo.config import cfg"},{"line_number":21,"context_line":"from stevedore import enabled"},{"line_number":22,"context_line":"import testtools"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2Fi8M%3D","line":19,"updated":"2014-03-05 13:55:53.000000000","message":"I\u0027m just surprised :) Is that smth that cannot be managed by mock? :)","commit_id":"cf34be75440fc6243c7265838b6c22492a5a7392"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"82c2e115cfeea083e66502b4965ec8fc6641fa8f","unresolved":false,"context_lines":[{"line_number":16,"context_line":"import datetime"},{"line_number":17,"context_line":"import eventlet"},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":"from mox import IsA  # noqa"},{"line_number":20,"context_line":"from oslo.config import cfg"},{"line_number":21,"context_line":"from stevedore import enabled"},{"line_number":22,"context_line":"import testtools"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2FhIs%3D","line":19,"in_reply_to":"AAAAVn%2F%2Fi8M%3D","updated":"2014-03-05 16:43:49.000000000","message":"Yes, it can... I thought it would look weird in the assertion because it must expect an internal method of the mock. I\u0027ll see if I can change this and make it look better.","commit_id":"cf34be75440fc6243c7265838b6c22492a5a7392"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"975557ecb69e611dede9fd37483f54606822f341","unresolved":false,"context_lines":[{"line_number":129,"context_line":"             {\u0027on_start\u0027: self.fake_plugin.on_start,"},{"line_number":130,"context_line":"              \u0027on_end\u0027: self.fake_plugin.on_end}}"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def tearDown(self):"},{"line_number":133,"context_line":"        super(ServiceTestCase, self).tearDown()"},{"line_number":134,"context_line":"        self.cfg.CONF.clear_override(\u0027notify_hours_before_lease_end\u0027,"},{"line_number":135,"context_line":"                                     group\u003d\u0027manager\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAXH%2F%2Fp7s%3D","line":132,"updated":"2014-04-18 13:53:09.000000000","message":"please use self.addCleanup() instead for cleaning the cfg value","commit_id":"b61b46f951c02d930eb39cee9a0b6f74dbda3ce8"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"d1c41205578e51c8a4c25838333d9c917d4e4c3c","unresolved":false,"context_lines":[{"line_number":129,"context_line":"             {\u0027on_start\u0027: self.fake_plugin.on_start,"},{"line_number":130,"context_line":"              \u0027on_end\u0027: self.fake_plugin.on_end}}"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def tearDown(self):"},{"line_number":133,"context_line":"        super(ServiceTestCase, self).tearDown()"},{"line_number":134,"context_line":"        self.cfg.CONF.clear_override(\u0027notify_hours_before_lease_end\u0027,"},{"line_number":135,"context_line":"                                     group\u003d\u0027manager\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAXH%2F%2Fd%2Fo%3D","line":132,"in_reply_to":"AAAAXH%2F%2Fp7s%3D","updated":"2014-04-21 15:16:46.000000000","message":"Done","commit_id":"b61b46f951c02d930eb39cee9a0b6f74dbda3ce8"}],"climate/tests/notification/__init__.py":[{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"37f9e4f23158e165ebfbd3a50c9a88fb382cb78f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"__author__ \u003d \u0027casanch1\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2Fi70%3D","line":1,"updated":"2014-03-05 13:55:53.000000000","message":"remove it :)\nbtw, do you use PyCharm? :)","commit_id":"cf34be75440fc6243c7265838b6c22492a5a7392"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"82c2e115cfeea083e66502b4965ec8fc6641fa8f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"__author__ \u003d \u0027casanch1\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2FiWc%3D","line":1,"in_reply_to":"AAAAVn%2F%2Fi70%3D","updated":"2014-03-05 16:43:49.000000000","message":"Oops didn\u0027t notice that :( \nYes, I use PyCharm :)","commit_id":"cf34be75440fc6243c7265838b6c22492a5a7392"}],"climate/tests/notification/test_notifier.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"975557ecb69e611dede9fd37483f54606822f341","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        notification.init()"},{"line_number":49,"context_line":"        self.notifier \u003d notification.Notifier()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def tearDown(self):"},{"line_number":52,"context_line":"        super(NotifierTestCase, self).tearDown()"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def test_notify_with_wrong_level(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAXH%2F%2Fp7g%3D","line":51,"updated":"2014-04-18 13:53:09.000000000","message":"this method is useless, please remove it","commit_id":"b61b46f951c02d930eb39cee9a0b6f74dbda3ce8"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"d1c41205578e51c8a4c25838333d9c917d4e4c3c","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        notification.init()"},{"line_number":49,"context_line":"        self.notifier \u003d notification.Notifier()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def tearDown(self):"},{"line_number":52,"context_line":"        super(NotifierTestCase, self).tearDown()"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def test_notify_with_wrong_level(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAXH%2F%2FdzQ%3D","line":51,"in_reply_to":"AAAAXH%2F%2Fp7g%3D","updated":"2014-04-21 15:16:46.000000000","message":"Done","commit_id":"b61b46f951c02d930eb39cee9a0b6f74dbda3ce8"}],"etc/climate/climate.conf.sample":[{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"b89313a04ce37fa364f96ce05a1e58a4764f23b8","unresolved":false,"context_lines":[{"line_number":715,"context_line":"# Options defined in climate.notification.notifier"},{"line_number":716,"context_line":"#"},{"line_number":717,"context_line":""},{"line_number":718,"context_line":"# Publisher ID for notifications (string value)"},{"line_number":719,"context_line":"#publisher_id\u003dclimate.lease"},{"line_number":720,"context_line":""},{"line_number":721,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":6,"id":"AAAAVn%2F%2FCQ8%3D","line":718,"updated":"2014-03-10 16:16:51.000000000","message":"we could call this param \"notification_namespace\"","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a39ea4c3342d79625107b1d51f1f6734877f29b4","unresolved":false,"context_lines":[{"line_number":715,"context_line":"# Options defined in climate.notification.notifier"},{"line_number":716,"context_line":"#"},{"line_number":717,"context_line":""},{"line_number":718,"context_line":"# Publisher ID for notifications (string value)"},{"line_number":719,"context_line":"#publisher_id\u003dclimate.lease"},{"line_number":720,"context_line":""},{"line_number":721,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":6,"id":"AAAAWH%2F%2Fq3U%3D","line":718,"in_reply_to":"AAAAVn%2F%2B2EA%3D","updated":"2014-03-14 15:38:07.000000000","message":"ok, forget what I\u0027ve said","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"03ac8eaf910e7c8b28ca4114501cbb4470606c7c","unresolved":false,"context_lines":[{"line_number":715,"context_line":"# Options defined in climate.notification.notifier"},{"line_number":716,"context_line":"#"},{"line_number":717,"context_line":""},{"line_number":718,"context_line":"# Publisher ID for notifications (string value)"},{"line_number":719,"context_line":"#publisher_id\u003dclimate.lease"},{"line_number":720,"context_line":""},{"line_number":721,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":6,"id":"AAAAVn%2F%2B2EA%3D","line":718,"in_reply_to":"AAAAVn%2F%2FCQ8%3D","updated":"2014-03-11 19:29:05.000000000","message":"I prefer publisher_id because it\u0027s the notification sender identifier. Namespace could mean that some kind of name hierarchy can be built, which is not the case here.","commit_id":"f133921bb49f1212c4d644a1da9d153a84043e87"}]}
