)]}'
{"nova/notifications/base.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"bafbf6c667a8e95740cedbc6be7bf5552cc5d8d0","unresolved":false,"context_lines":[{"line_number":261,"context_line":"    return binary"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"def _send_versioned_instance_update(context, instance, payload, host, service):"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    state_update \u003d instance_notification.InstanceStateUpdatePayload("},{"line_number":267,"context_line":"        old_state\u003dpayload.get(\u0027old_state\u0027),"}],"source_content_type":"text/x-python","patch_set":27,"id":"3aaa91ec_3d0342ba","line":264,"updated":"2016-06-28 10:41:40.000000000","message":"Not sure I see unit tests for these methods. I think its complicated enough to be worth it.\n\nI know we have functional tests.","commit_id":"7592e737180d314e52a20d986d97ef5a0f22cd56"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3c0f34176f9153c1244cbc9f419887f65e79395c","unresolved":false,"context_lines":[{"line_number":261,"context_line":"    return binary"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"def _send_versioned_instance_update(context, instance, payload, host, service):"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    state_update \u003d instance_notification.InstanceStateUpdatePayload("},{"line_number":267,"context_line":"        old_state\u003dpayload.get(\u0027old_state\u0027),"}],"source_content_type":"text/x-python","patch_set":27,"id":"3aaa91ec_537276e4","line":264,"in_reply_to":"3aaa91ec_3d0342ba","updated":"2016-06-28 15:25:31.000000000","message":"The _verify_notification in https://review.openstack.org/#/c/325923/27/nova/tests/unit/test_notifications.py covers this code path, but I just realized that we need to assert a bit more things.","commit_id":"7592e737180d314e52a20d986d97ef5a0f22cd56"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"bafbf6c667a8e95740cedbc6be7bf5552cc5d8d0","unresolved":false,"context_lines":[{"line_number":284,"context_line":"    if network_info is not None:"},{"line_number":285,"context_line":"        for vif in network_info:"},{"line_number":286,"context_line":"            for ip in vif.fixed_ips():"},{"line_number":287,"context_line":"                ips.append(instance_notification.IpPayload("},{"line_number":288,"context_line":"                    label\u003dvif[\"network\"][\"label\"],"},{"line_number":289,"context_line":"                    mac\u003dvif[\"address\"],"},{"line_number":290,"context_line":"                    meta\u003dvif[\"meta\"],"}],"source_content_type":"text/x-python","patch_set":27,"id":"3aaa91ec_bd7bb27a","line":287,"updated":"2016-06-28 10:41:40.000000000","message":"Nit: Its tempting to add this logic into the object as a class method? although maybe thats unclean.","commit_id":"7592e737180d314e52a20d986d97ef5a0f22cd56"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3c0f34176f9153c1244cbc9f419887f65e79395c","unresolved":false,"context_lines":[{"line_number":284,"context_line":"    if network_info is not None:"},{"line_number":285,"context_line":"        for vif in network_info:"},{"line_number":286,"context_line":"            for ip in vif.fixed_ips():"},{"line_number":287,"context_line":"                ips.append(instance_notification.IpPayload("},{"line_number":288,"context_line":"                    label\u003dvif[\"network\"][\"label\"],"},{"line_number":289,"context_line":"                    mac\u003dvif[\"address\"],"},{"line_number":290,"context_line":"                    meta\u003dvif[\"meta\"],"}],"source_content_type":"text/x-python","patch_set":27,"id":"3aaa91ec_38ab498b","line":287,"in_reply_to":"3aaa91ec_bd7bb27a","updated":"2016-06-28 15:25:31.000000000","message":"Let\u0027s move it to IpPayload.","commit_id":"7592e737180d314e52a20d986d97ef5a0f22cd56"}],"nova/notifications/objects/instance.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"232ff76d67d5ab103b3a2e1b686e10d6ca548b68","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    # Version 1.0: Initial version"},{"line_number":123,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":124,"context_line":"    fields \u003d {"},{"line_number":125,"context_line":"        \u0027state_update\u0027: fields.ObjectField(\u0027InstanceStateUpdatePayload\u0027),"},{"line_number":126,"context_line":"        \u0027audit_period\u0027: fields.ObjectField(\u0027AuditPeriodPayload\u0027),"},{"line_number":127,"context_line":"        \u0027bandwidth\u0027: fields.ListOfObjectsField(\u0027BandwidthPayload\u0027),"},{"line_number":128,"context_line":"        \u0027old_display_name\u0027: fields.StringField(nullable\u003dTrue)"},{"line_number":129,"context_line":"    }"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_87182786","line":127,"range":{"start_line":125,"start_character":0,"end_line":127,"end_character":67},"updated":"2016-06-06 14:39:24.000000000","message":"Should these all be nullable, for when those features are turned off?","commit_id":"1fb7272eabdf7b384277d3e12aa955eb901d1281"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"b3b5a11ce03772d33c561c668c581c2f00c5c198","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    # Version 1.0: Initial version"},{"line_number":123,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":124,"context_line":"    fields \u003d {"},{"line_number":125,"context_line":"        \u0027state_update\u0027: fields.ObjectField(\u0027InstanceStateUpdatePayload\u0027),"},{"line_number":126,"context_line":"        \u0027audit_period\u0027: fields.ObjectField(\u0027AuditPeriodPayload\u0027),"},{"line_number":127,"context_line":"        \u0027bandwidth\u0027: fields.ListOfObjectsField(\u0027BandwidthPayload\u0027),"},{"line_number":128,"context_line":"        \u0027old_display_name\u0027: fields.StringField(nullable\u003dTrue)"},{"line_number":129,"context_line":"    }"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_726d1799","line":127,"range":{"start_line":125,"start_character":0,"end_line":127,"end_character":67},"in_reply_to":"7aa08908_87182786","updated":"2016-06-15 15:50:17.000000000","message":"* state_update: notify_on_state_change conf defines on what status update we trigger the notification on but does not change what part of the notification is filled. Even if we trigger only on vm_state change the task_state is filled in the notification. The null values are coming from the instance object as sometimes the task_state of the instance is empty as no task is going on. \n* audit_period: As far as I see there is no way to turn this off in the config so I changing the fields of the AuditPeriodPayload to no nullable.\n* bandwidth will be an empty list if the virt driver does not support the counters. We don\u0027t have an explicit config flag where this can be turned off. The compute manager just tries to use this feature and if it fails then it remembers it and never update that db table. This leads to an empty list in the notification. I might be able to replace the empty list with a null value if the instance has ports but does not have bandwidth data (meaning the feature is not supported) but I think it is just unnecessary complexity.","commit_id":"1fb7272eabdf7b384277d3e12aa955eb901d1281"}],"nova/tests/functional/notification_sample_tests/test_instance.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"bafbf6c667a8e95740cedbc6be7bf5552cc5d8d0","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        return replacements"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_create_delete_server_with_instance_update(self):"},{"line_number":153,"context_line":"        self.flags(notify_on_state_change\u003d\u0027\"vm_and_task_state\u0027)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        server \u003d self._boot_a_server("},{"line_number":156,"context_line":"                extra_params\u003d{\u0027networks\u0027:"}],"source_content_type":"text/x-python","patch_set":27,"id":"3aaa91ec_5dd44e46","line":153,"range":{"start_line":153,"start_character":43,"end_line":153,"end_character":45},"updated":"2016-06-28 10:41:40.000000000","message":"Is that correct, having the extra \" in there?","commit_id":"7592e737180d314e52a20d986d97ef5a0f22cd56"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3c0f34176f9153c1244cbc9f419887f65e79395c","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        return replacements"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_create_delete_server_with_instance_update(self):"},{"line_number":153,"context_line":"        self.flags(notify_on_state_change\u003d\u0027\"vm_and_task_state\u0027)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        server \u003d self._boot_a_server("},{"line_number":156,"context_line":"                extra_params\u003d{\u0027networks\u0027:"}],"source_content_type":"text/x-python","patch_set":27,"id":"3aaa91ec_b5d617ef","line":153,"range":{"start_line":153,"start_character":43,"end_line":153,"end_character":45},"in_reply_to":"3aaa91ec_5dd44e46","updated":"2016-06-28 15:25:31.000000000","message":"That is strange. Removed the extra quote and then the content of the notification has been changed. It seems that until now  the notifications didn\u0027t have task_state update just vm state update. But is is all better now.","commit_id":"7592e737180d314e52a20d986d97ef5a0f22cd56"}]}
