)]}'
{"ceilometer/alarm/notifier/__init__.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"17a4e7878d4634b64693361795c36d0c37d060c6","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    __metaclass__ \u003d abc.ABCMeta"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    @abc.abstractstaticmethod"},{"line_number":28,"context_line":"    def notify(action, alarm, state, reason):"},{"line_number":29,"context_line":"        \"\"\"Notify that an alarm has been triggered."},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAQn%2F%2FepE%3D","line":27,"updated":"2013-07-30 15:10:11.000000000","message":"You dont\u0027 need to make it static, the implementation others than the LOG one are not static anyway. Just make the one in log static since it is static.","commit_id":"b4f18d6b3c62368a7cbdc48c9adcba5eef566578"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"e79d8faf281d76c8c3cd26b9032a2a10f5e468eb","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    __metaclass__ \u003d abc.ABCMeta"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    @abc.abstractmethod"},{"line_number":28,"context_line":"    def notify(action, alarm, state, reason):"},{"line_number":29,"context_line":"        \"\"\"Notify that an alarm has been triggered."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        :param action: The action that is being attended, as a parsed URL."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAQn%2F%2Fb2E%3D","line":28,"updated":"2013-07-31 08:51:23.000000000","message":"If it\u0027s a method it needs self","commit_id":"aeabf38ac3a8169a2506359de0bdd6d4319a0caa"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"67052e22524d74a822e7f50c0ffbdeb9474b40ca","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    __metaclass__ \u003d abc.ABCMeta"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    @abc.abstractmethod"},{"line_number":28,"context_line":"    def notify(action, alarm, state, reason):"},{"line_number":29,"context_line":"        \"\"\"Notify that an alarm has been triggered."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        :param action: The action that is being attended, as a parsed URL."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAQn%2F%2Fbsk%3D","line":28,"in_reply_to":"AAAAQn%2F%2Fb2E%3D","updated":"2013-07-31 09:40:29.000000000","message":"The problem is that abc.abstractmethod and staticmethod don\u0027t mix well in python 2.x when decorating the same method in the base class.\n\n(As discussed on IRC, in python 3.x this is resolved with the @abc.abstractstaticmethod decorator and/or the ability to apply both decorators freely). \n\nNow I\u0027d be happy to go back to this being non-static (i.e. restore the self args here and in the derived classes, as per my original fix).\n\nBut maybe I misunderstood your original comment on patch set 1. Where you suggesting that the abstract-ness of the notify method should be dropped?","commit_id":"aeabf38ac3a8169a2506359de0bdd6d4319a0caa"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"7cc0c6856ed987cabeab107ea2582ff1cdda26cf","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    __metaclass__ \u003d abc.ABCMeta"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    @abc.abstractmethod"},{"line_number":28,"context_line":"    def notify(action, alarm, state, reason):"},{"line_number":29,"context_line":"        \"\"\"Notify that an alarm has been triggered."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        :param action: The action that is being attended, as a parsed URL."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAQn%2F%2FaT4%3D","line":28,"in_reply_to":"AAAAQn%2F%2FbYA%3D","updated":"2013-07-31 16:05:21.000000000","message":"Fair enough, whatever is needed to get this fix landed.\n\nThe mis-matched method signatures in the base and derived classes seem wrong to me, but maybe that\u0027s just my statically-typed C++/Java background talking.","commit_id":"aeabf38ac3a8169a2506359de0bdd6d4319a0caa"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"16779c76dc7999813291ceb5eaba9e7a102a7004","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    __metaclass__ \u003d abc.ABCMeta"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    @abc.abstractmethod"},{"line_number":28,"context_line":"    def notify(action, alarm, state, reason):"},{"line_number":29,"context_line":"        \"\"\"Notify that an alarm has been triggered."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        :param action: The action that is being attended, as a parsed URL."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAQn%2F%2FbYA%3D","line":28,"in_reply_to":"AAAAQn%2F%2Fbsk%3D","updated":"2013-07-31 11:13:38.000000000","message":"You don\u0027t have to us @abc.abstractmethod AND @staticmethod here.\n\n@abstractmethod just indicates that you must have an implemented method (static or not) in class inheriting from this base class.\n\n@staticmethod just indicates that the method you provide doesn\u0027t require to be bound to the object because it doesn\u0027t use the self argument.\n\nBut since you provide it -- static or not -- it satisfy @abstractmethod.\n\nOTOH if you wanted fo *force* each implementation of this notify() method to be static, in Python 2 you could not. In Python 3, as you taught me yesterday, you could use @abstractstaticmethod which would force the implementation to be a @staticmethod.\n\nSo doing this change is good and enough:\n\ndiff --git a/ceilometer/alarm/notifier/log.py b/ceilometer/alarm/notifier/log.py\nindex ff8934a..754f308 100644\n--- a/ceilometer/alarm/notifier/log.py\n+++ b/ceilometer/alarm/notifier/log.py\n@@ -26,6 +26,7 @@ LOG \u003d log.getLogger(__name__)\n class LogAlarmNotifier(notifier.AlarmNotifier):\n     \"Log alarm notifier.\"\"\"\n \n+    @staticmethod\n     def notify(action, alarm, state, reason):\n         LOG.info(\"Notifying alarm %s in state %s with action %s because %s\",\n                  alarm, state, action, reason)\ndiff --git a/ceilometer/alarm/notifier/rest.py b/ceilometer/alarm/notifier/rest.py\nindex 8f2d575..d2a856f 100644\n--- a/ceilometer/alarm/notifier/rest.py\n+++ b/ceilometer/alarm/notifier/rest.py\n@@ -52,7 +52,8 @@ cfg.CONF.register_opts(REST_NOTIFIER_OPTS, group\u003d\"alarm\")\n class RestAlarmNotifier(notifier.AlarmNotifier):\n     \"\"\"Rest alarm notifier.\"\"\"\n \n-    def notify(self, action, alarm, state, reason):\n+    @staticmethod\n+    def notify(action, alarm, state, reason):\n         LOG.info(\"Notifying alarm %s in state %s with action %s because %s\",\n                  alarm, state, action, reason)\n         body \u003d {\u0027state\u0027: state, \u0027reason\u0027: reason}","commit_id":"aeabf38ac3a8169a2506359de0bdd6d4319a0caa"}],"ceilometer/alarm/notifier/log.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"8acca1ea0e6e0ee92b59c334c0608566a6ebc7b6","unresolved":false,"context_lines":[{"line_number":26,"context_line":"class LogAlarmNotifier(notifier.AlarmNotifier):"},{"line_number":27,"context_line":"    \"Log alarm notifier.\"\"\""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def notify(self, action, alarm, state, reason):"},{"line_number":30,"context_line":"        LOG.info(\"Notifying alarm %s in state %s with action %s because %s\","},{"line_number":31,"context_line":"                 alarm, state, action, reason)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAQn%2F%2FewY%3D","line":29,"updated":"2013-07-30 14:39:59.000000000","message":"I agree it\u0027s bugged, but @staticmethod would be more correct! :)","commit_id":"a8a19d9c6601d3fc3c4f5a2a62e54873c9824390"}]}
