)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"dfab7836ed2ade18f6ae06b927eaf6be70ee0ea3","unresolved":false,"context_lines":[{"line_number":4320,"context_line":"        LOG.info(_LI(\u0027Unshelving\u0027), instance\u003dinstance)"},{"line_number":4321,"context_line":"        self._notify_about_instance_usage(context, instance, \u0027unshelve.start\u0027)"},{"line_number":4322,"context_line":"        compute_utils.notify_about_instance_action(context, instance,"},{"line_number":4323,"context_line":"                self.host, action\u003dfields.NotificationAction.UNSHELVE,"},{"line_number":4324,"context_line":"                phase\u003dfields.NotificationPhase.START)"},{"line_number":4325,"context_line":""},{"line_number":4326,"context_line":"        instance.task_state \u003d task_states.SPAWNING"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a95cdbc_f594af37","line":4323,"range":{"start_line":4323,"start_character":60,"end_line":4323,"end_character":68},"updated":"2016-10-10 15:30:52.000000000","message":"You have to extend this enum with the \u0027unshelve\u0027 value.","commit_id":"a0f778c685b8aeed3c7df31ba2139239895c5ce7"},{"author":{"_account_id":21111,"name":"STEW TY","email":"punsoca@gmail.com","username":"stewie925"},"change_message_id":"277751aff2717c5ac47639212fb24d19969da914","unresolved":false,"context_lines":[{"line_number":4320,"context_line":"        LOG.info(_LI(\u0027Unshelving\u0027), instance\u003dinstance)"},{"line_number":4321,"context_line":"        self._notify_about_instance_usage(context, instance, \u0027unshelve.start\u0027)"},{"line_number":4322,"context_line":"        compute_utils.notify_about_instance_action(context, instance,"},{"line_number":4323,"context_line":"                self.host, action\u003dfields.NotificationAction.UNSHELVE,"},{"line_number":4324,"context_line":"                phase\u003dfields.NotificationPhase.START)"},{"line_number":4325,"context_line":""},{"line_number":4326,"context_line":"        instance.task_state \u003d task_states.SPAWNING"},{"line_number":4327,"context_line":"        instance.save()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a95cdbc_5a7af0bd","line":4324,"range":{"start_line":4323,"start_character":0,"end_line":4324,"end_character":53},"updated":"2016-10-10 15:27:21.000000000","message":"when I ran the unit test locally it errors at line 4323 - it says that NotificationAction does not have an attribute called UNSHELVE.  \n\n      File \"nova/compute/manager.py\", line 4323, in _unshelve_instance\n        self.host, action\u003dfields.NotificationAction.UNSHELVE,\n    AttributeError: type object \u0027NotificationAction\u0027 has no attribute \u0027UNSHELVE\u0027\n\n\nhere is the partial log trace:  http://paste.openstack.org/show/585211/\n\nThe complete log trace:  http://paste.openstack.org/show/585209/","commit_id":"a0f778c685b8aeed3c7df31ba2139239895c5ce7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c4cfa05a8fb6a5652f0b5c350f94e9ce8811c6f5","unresolved":false,"context_lines":[{"line_number":4358,"context_line":"                                  admin_password\u003dNone,"},{"line_number":4359,"context_line":"                                  network_info\u003dnetwork_info,"},{"line_number":4360,"context_line":"                                  block_device_info\u003dblock_device_info)"},{"line_number":4361,"context_line":"        except Exception:"},{"line_number":4362,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":4363,"context_line":"                LOG.exception(_LE(\u0027Instance failed to spawn\u0027),"},{"line_number":4364,"context_line":"                              instance\u003dinstance)"},{"line_number":4365,"context_line":""},{"line_number":4366,"context_line":"        if image:"},{"line_number":4367,"context_line":"            instance.image_ref \u003d shelved_image_ref"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa6399be_dbde596c","line":4364,"range":{"start_line":4361,"start_character":8,"end_line":4364,"end_character":48},"updated":"2016-10-20 13:51:03.000000000","message":"Hmm, I\u0027m surprised we don\u0027t put the instance into error state if this fails, and send out an unshelve.error notification, but that\u0027s a separate issue.","commit_id":"8962b31b735ec818725c7116e5229ba5463b1b50"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a7621842c1cad06f45795df9a4cc119fbccd6750","unresolved":false,"context_lines":[{"line_number":4358,"context_line":"                                  admin_password\u003dNone,"},{"line_number":4359,"context_line":"                                  network_info\u003dnetwork_info,"},{"line_number":4360,"context_line":"                                  block_device_info\u003dblock_device_info)"},{"line_number":4361,"context_line":"        except Exception:"},{"line_number":4362,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":4363,"context_line":"                LOG.exception(_LE(\u0027Instance failed to spawn\u0027),"},{"line_number":4364,"context_line":"                              instance\u003dinstance)"},{"line_number":4365,"context_line":""},{"line_number":4366,"context_line":"        if image:"},{"line_number":4367,"context_line":"            instance.image_ref \u003d shelved_image_ref"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa6399be_4c328d11","line":4364,"range":{"start_line":4361,"start_character":8,"end_line":4364,"end_character":48},"in_reply_to":"fa6399be_dbde596c","updated":"2016-10-20 15:08:02.000000000","message":"Nevermind, I tested this out. The instance shouldn\u0027t go into ERROR state because it\u0027s not running anyway. There is an instance action fault recorded for the failure here, so we\u0027re good.","commit_id":"8962b31b735ec818725c7116e5229ba5463b1b50"}],"nova/objects/fields.py":[{"author":{"_account_id":21111,"name":"STEW TY","email":"punsoca@gmail.com","username":"stewie925"},"change_message_id":"ebf0a6e54e373acf694184737fcbe713996cca08","unresolved":false,"context_lines":[{"line_number":644,"context_line":""},{"line_number":645,"context_line":"    @classmethod"},{"line_number":646,"context_line":"    def from_index(cls, index):"},{"line_number":647,"context_line":"        \"\"\"Return the Enum value at a given index.\"\"\""},{"line_number":648,"context_line":"        return cls.ALL[index]"},{"line_number":649,"context_line":""},{"line_number":650,"context_line":""},{"line_number":651,"context_line":"class IPV4AndV6Address(IPAddress):"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa6399be_b7b93fef","line":648,"range":{"start_line":647,"start_character":0,"end_line":648,"end_character":29},"updated":"2016-10-11 06:55:06.000000000","message":"unit test failed on line 648 with IndexError:\n\n      File \"nova/objects/fields.py\", line 635, in coerce\n        value \u003d self.from_index(value)\n      File \"nova/objects/fields.py\", line 648, in from_index\n        return cls.ALL[index]\n    IndexError: tuple index out of range","commit_id":"88913ee8a32e0c2d1e41adb5b7dfb6c994c1893a"},{"author":{"_account_id":21111,"name":"STEW TY","email":"punsoca@gmail.com","username":"stewie925"},"change_message_id":"acc2be5066d7b6aff16b37a94cf7285179906539","unresolved":false,"context_lines":[{"line_number":645,"context_line":"    @classmethod"},{"line_number":646,"context_line":"    def from_index(cls, index):"},{"line_number":647,"context_line":"        \"\"\"Return the Enum value at a given index.\"\"\""},{"line_number":648,"context_line":"        return cls.ALL[index]"},{"line_number":649,"context_line":""},{"line_number":650,"context_line":""},{"line_number":651,"context_line":"class IPV4AndV6Address(IPAddress):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_9f442275","line":648,"range":{"start_line":648,"start_character":0,"end_line":648,"end_character":29},"updated":"2016-10-12 00:17:24.000000000","message":"Unfortunately for unit testing (nova.test.unit.compute.test_shelve) it failed at line #648 complaining of \"tuple index out of range\" error.  I think the problem may not be caused by the code here, but rather somewhere in the nova.test.unit.comput.test_shelve program, but I can\u0027t figure out where.  Again your input is appreciated.","commit_id":"83bc7ac08e33f77746726f6cc6b75a127d466d69"}],"nova/tests/functional/notification_sample_tests/test_instance.py":[{"author":{"_account_id":21111,"name":"STEW TY","email":"punsoca@gmail.com","username":"stewie925"},"change_message_id":"a07fa6dbb9e4bc92842d597051f161de8f02e196","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        self.flags(shelved_offload_time \u003d -1)"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027shelve\u0027: {}})"},{"line_number":267,"context_line":"        self._wait_for_state_change(self.admin_api, server,"},{"line_number":268,"context_line":"                                    expected_status\u003d\u0027SHELVED\u0027)"},{"line_number":269,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027unshelve\u0027: {}})"},{"line_number":270,"context_line":"        self._wait_for_state_change(self.api, server, \u0027ACTIVE\u0027)"},{"line_number":271,"context_line":"        self.assertEqual(2, len(fake_notifier.VERSIONED_NOTIFICATIONS))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a95cdbc_067ec9ad","line":268,"range":{"start_line":267,"start_character":0,"end_line":268,"end_character":62},"updated":"2016-10-06 18:44:24.000000000","message":"lines 264-268 basically sets the test instance to \u0027shelved\u0027, \nhowever, line #268 gets the following error indicating that the actual status is ACTIVE:\n\n\u003d\u003d\u003d\nFile \"nova/tests/functional/notification_sample_tests/test_instance.py\", line 268, in _test_unshelve_server\n        expected_status\u003d\u0027SHELVED\u0027)\n\nAssertionError: Wait for state change failed, expected_status\u003dSHELVED, actual_status\u003dACTIVE\n\u003d\u003d\u003d\u003d","commit_id":"a0f778c685b8aeed3c7df31ba2139239895c5ce7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9dfa7b862ee499a54042ad5a3087a35a8a4d1f64","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        self.flags(shelved_offload_time \u003d -1)"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027shelve\u0027: {}})"},{"line_number":267,"context_line":"        self._wait_for_state_change(self.admin_api, server,"},{"line_number":268,"context_line":"                                    expected_status\u003d\u0027SHELVED\u0027)"},{"line_number":269,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027unshelve\u0027: {}})"},{"line_number":270,"context_line":"        self._wait_for_state_change(self.api, server, \u0027ACTIVE\u0027)"},{"line_number":271,"context_line":"        self.assertEqual(2, len(fake_notifier.VERSIONED_NOTIFICATIONS))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a95cdbc_d0b393e7","line":268,"range":{"start_line":267,"start_character":0,"end_line":268,"end_character":62},"in_reply_to":"1a95cdbc_067ec9ad","updated":"2016-10-07 11:22:51.000000000","message":"There is a stack trace in the logs, http://paste.openstack.org/show/584804/ I guess this causing that the instance does not go to shelved state.\n\nI tried to to move the unshelve test right after the shelve test in the action list. I removed the unshelving part of the shelve funciton and also removed the shelve part of the unshelve function. This way the instance goes to shelved state without exception.","commit_id":"a0f778c685b8aeed3c7df31ba2139239895c5ce7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"dfab7836ed2ade18f6ae06b927eaf6be70ee0ea3","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        self.flags(shelved_offload_time \u003d -1)"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027shelve\u0027: {}})"},{"line_number":267,"context_line":"        self._wait_for_state_change(self.admin_api, server,"},{"line_number":268,"context_line":"                                    expected_status\u003d\u0027SHELVED\u0027)"},{"line_number":269,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027unshelve\u0027: {}})"},{"line_number":270,"context_line":"        self._wait_for_state_change(self.api, server, \u0027ACTIVE\u0027)"},{"line_number":271,"context_line":"        self.assertEqual(2, len(fake_notifier.VERSIONED_NOTIFICATIONS))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a95cdbc_15083b27","line":268,"range":{"start_line":267,"start_character":0,"end_line":268,"end_character":62},"in_reply_to":"1a95cdbc_5bb5b17b","updated":"2016-10-10 15:30:52.000000000","message":"It seems that if the instance is simply shelved then the unshelve api call just power it on. The real unshelve code path only run if the instance is in shelve_offloaded state. \n\nThis means that we cannot really use the _test_shelve_server test function to bring the instance to shelved state for us as that is not enough.\n\nSo we have to keep the unshelve action in the shelve function. Then we have to set the shelve_offload_time to 0 in the unshelve function so the shelve api call will bring the instance to the SHELVED_OFFLOADED state and from there we can bring it back to active with the unshelve api call and we will expect the new unshelve notification.\n\nAs we will no put the instance to SHELVED_OFFLOADED state the unshelve.start notification sample needs to be adapted, e.g. the node and host fields will empty and the state will be \u0027shelved_offloaded\u0027.\n\nAlso you had a mistake in the unshelve.end sample. There the status is \u0027active\u0027.","commit_id":"a0f778c685b8aeed3c7df31ba2139239895c5ce7"},{"author":{"_account_id":21111,"name":"STEW TY","email":"punsoca@gmail.com","username":"stewie925"},"change_message_id":"ddd19f835ef1a34592831d13fafadf6b3d51bcb1","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        self.flags(shelved_offload_time \u003d -1)"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027shelve\u0027: {}})"},{"line_number":267,"context_line":"        self._wait_for_state_change(self.admin_api, server,"},{"line_number":268,"context_line":"                                    expected_status\u003d\u0027SHELVED\u0027)"},{"line_number":269,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027unshelve\u0027: {}})"},{"line_number":270,"context_line":"        self._wait_for_state_change(self.api, server, \u0027ACTIVE\u0027)"},{"line_number":271,"context_line":"        self.assertEqual(2, len(fake_notifier.VERSIONED_NOTIFICATIONS))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a95cdbc_5bb5b17b","line":268,"range":{"start_line":267,"start_character":0,"end_line":268,"end_character":62},"in_reply_to":"1a95cdbc_d0b393e7","updated":"2016-10-10 01:29:05.000000000","message":"Hi gibi, thank you for your review.   I made changes to the test_instance.py as you suggested.   As expected, no more issue with the shelving state.  However, it fails with  the following error:\n\n   Difference: u\u0027instance.unshelve.start\u0027 !\u003d u\u0027instance.power_on.start\u0027\n\nI have posted the results in http://paste.openstack.org/show/585120/.","commit_id":"a0f778c685b8aeed3c7df31ba2139239895c5ce7"},{"author":{"_account_id":21111,"name":"STEW TY","email":"punsoca@gmail.com","username":"stewie925"},"change_message_id":"ebf0a6e54e373acf694184737fcbe713996cca08","unresolved":false,"context_lines":[{"line_number":266,"context_line":"            replacements\u003d{"},{"line_number":267,"context_line":"                \u0027reservation_id\u0027: server[\u0027reservation_id\u0027],"},{"line_number":268,"context_line":"                \u0027uuid\u0027: server[\u0027id\u0027]},"},{"line_number":269,"context_line":"            actual\u003dfake_notifier.VERSIONED_NOTIFICATIONS[2])"},{"line_number":270,"context_line":"        self._verify_notification("},{"line_number":271,"context_line":"            \u0027instance-unshelve-end\u0027,"},{"line_number":272,"context_line":"            replacements\u003d{"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa6399be_d786b364","line":269,"range":{"start_line":269,"start_character":0,"end_line":269,"end_character":60},"updated":"2016-10-11 06:55:06.000000000","message":"Issue: With the shelved_offloaded_time set to 0, the actual notification returns event_type\u003dinstance.power_on.start (expected was instance.unshelved.start).","commit_id":"88913ee8a32e0c2d1e41adb5b7dfb6c994c1893a"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"cd1e21535c6d2537108a5604d7e69283cf8ab264","unresolved":false,"context_lines":[{"line_number":236,"context_line":"            actual\u003dfake_notifier.VERSIONED_NOTIFICATIONS[1])"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    def _test_shelve_server(self, server):"},{"line_number":239,"context_line":"        self.flags(shelved_offload_time \u003d -1 )"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027shelve\u0027: {}})"},{"line_number":242,"context_line":"        self._wait_for_state_change(self.api, server,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_b7e82212","line":239,"range":{"start_line":239,"start_character":44,"end_line":239,"end_character":45},"updated":"2016-10-12 07:44:48.000000000","message":"this should not be modified","commit_id":"83bc7ac08e33f77746726f6cc6b75a127d466d69"},{"author":{"_account_id":21111,"name":"STEW TY","email":"punsoca@gmail.com","username":"stewie925"},"change_message_id":"9af5d2ac463407e38a65fe5eaf0b7a1f03d03dbe","unresolved":false,"context_lines":[{"line_number":236,"context_line":"            actual\u003dfake_notifier.VERSIONED_NOTIFICATIONS[1])"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    def _test_shelve_server(self, server):"},{"line_number":239,"context_line":"        self.flags(shelved_offload_time \u003d -1 )"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027shelve\u0027: {}})"},{"line_number":242,"context_line":"        self._wait_for_state_change(self.api, server,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_0bf434f0","line":239,"range":{"start_line":239,"start_character":44,"end_line":239,"end_character":45},"in_reply_to":"fa6399be_b7e82212","updated":"2016-10-12 14:55:40.000000000","message":"will fix in next patch along with the unit test fix.","commit_id":"83bc7ac08e33f77746726f6cc6b75a127d466d69"},{"author":{"_account_id":21111,"name":"STEW TY","email":"punsoca@gmail.com","username":"stewie925"},"change_message_id":"acc2be5066d7b6aff16b37a94cf7285179906539","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        self._wait_for_state_change(self.admin_api, server, \u0027ACTIVE\u0027)"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"        # unshelving logic"},{"line_number":264,"context_line":"    def _test_unshelve_server(self, server):"},{"line_number":265,"context_line":"        # setting the shelved_offload_time to 0 should set the"},{"line_number":266,"context_line":"        # instance status to \u0027SHELVED_OFFLOADED\u0027"},{"line_number":267,"context_line":"        self.flags(shelved_offload_time \u003d 0)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_9f6d0207","line":264,"range":{"start_line":264,"start_character":0,"end_line":264,"end_character":44},"updated":"2016-10-12 00:17:24.000000000","message":"Finally was able to fix the issue in this program to pass the functional test -  I had to reinstate the test_unshelve_server function as I need to do a separate shelve logic with the status \u003d\u0027shelved_offloaded\u0027 scenario (using conf flag shelved_offload_time \u003d 0), so it can correctly trigger the unshelve notification when the unshelve api is called.","commit_id":"83bc7ac08e33f77746726f6cc6b75a127d466d69"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2fd25301ca34be736e5b57df1666505b5da3c794","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], post)"},{"line_number":261,"context_line":"        self._wait_for_state_change(self.admin_api, server, \u0027ACTIVE\u0027)"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"        # unshelving logic"},{"line_number":264,"context_line":"    def _test_unshelve_server(self, server):"},{"line_number":265,"context_line":"        # setting the shelved_offload_time to 0 should set the"},{"line_number":266,"context_line":"        # instance status to \u0027SHELVED_OFFLOADED\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa6399be_91c65966","line":263,"updated":"2016-10-14 10:19:31.000000000","message":"this comment doesn\u0027t add anything, the name of the function indicates this already.","commit_id":"911b25010fbc053bdee4036b8ac34d2ef6a8f760"},{"author":{"_account_id":21111,"name":"STEW TY","email":"punsoca@gmail.com","username":"stewie925"},"change_message_id":"96f6d5a1c175c574cbbdd41b2f7d847ae0e599b1","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], post)"},{"line_number":277,"context_line":"        self._wait_for_state_change(self.admin_api, server, \u0027ACTIVE\u0027)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"    def _test_unshelve_server(self, server):"},{"line_number":280,"context_line":"        # setting the shelved_offload_time to 0 should set the"},{"line_number":281,"context_line":"        # instance status to \u0027SHELVED_OFFLOADED\u0027"},{"line_number":282,"context_line":"        self.flags(shelved_offload_time \u003d 0)"},{"line_number":283,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027shelve\u0027: {}})"},{"line_number":284,"context_line":"        self._wait_for_state_change(self.api, server,"},{"line_number":285,"context_line":"                                    expected_status\u003d\u0027SHELVED_OFFLOADED\u0027)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        post \u003d {\u0027unshelve\u0027: None}"},{"line_number":288,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], post)"},{"line_number":289,"context_line":"        self._wait_for_state_change(self.admin_api, server, \u0027ACTIVE\u0027)"},{"line_number":290,"context_line":"        self.assertEqual(4, len(fake_notifier.VERSIONED_NOTIFICATIONS))"},{"line_number":291,"context_line":"        self._verify_notification("},{"line_number":292,"context_line":"            \u0027instance-unshelve-start\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da6895a0_583734e3","line":289,"range":{"start_line":279,"start_character":1,"end_line":289,"end_character":69},"updated":"2016-10-20 23:58:30.000000000","message":"Hi Matt thank you for your review.  So I commented out lines 279-289, then run the functional test on my local vm and I got the following error:\n\n    Difference: u\u0027instance.unshelve.start\u0027 !\u003d u\u0027instance.power_on.start\u0027\n\nLooks like when the shelve_offload_time is set to -1 and we attempted to change instance state from \"shelved\" to \"unshelved\", the actual event_type is \u0027power_on.start\" instead of \"instance.unshelve.start\".  \n\nPlease see http://paste.openstack.org/show/586640/ for the test results.","commit_id":"8962b31b735ec818725c7116e5229ba5463b1b50"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c4cfa05a8fb6a5652f0b5c350f94e9ce8811c6f5","unresolved":false,"context_lines":[{"line_number":280,"context_line":"        # setting the shelved_offload_time to 0 should set the"},{"line_number":281,"context_line":"        # instance status to \u0027SHELVED_OFFLOADED\u0027"},{"line_number":282,"context_line":"        self.flags(shelved_offload_time \u003d 0)"},{"line_number":283,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027shelve\u0027: {}})"},{"line_number":284,"context_line":"        self._wait_for_state_change(self.api, server,"},{"line_number":285,"context_line":"                                    expected_status\u003d\u0027SHELVED_OFFLOADED\u0027)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        post \u003d {\u0027unshelve\u0027: None}"},{"line_number":288,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], post)"},{"line_number":289,"context_line":"        self._wait_for_state_change(self.admin_api, server, \u0027ACTIVE\u0027)"},{"line_number":290,"context_line":"        self.assertEqual(4, len(fake_notifier.VERSIONED_NOTIFICATIONS))"},{"line_number":291,"context_line":"        self._verify_notification("},{"line_number":292,"context_line":"            \u0027instance-unshelve-start\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa6399be_5b05e977","line":289,"range":{"start_line":283,"start_character":8,"end_line":289,"end_character":69},"updated":"2016-10-20 13:51:03.000000000","message":"This code is all in the test above...and the test above also does an unshelve, so couldn\u0027t we just add the follow notification checks in that test? Maybe rename _test_shelve_unshelve_server to indicate we\u0027re testing both.\n\nOtherwise the only other difference is this test is offloading the shelved server, so the host/node are null in the notification, and they aren\u0027t in the shelve test above. I\u0027m not sure if/why we care about shelved offloaded in this test scenario though since we\u0027re not testing the notifications for shelved offloaded.\n\nI won\u0027t block on this, but it seems we should just merge the tests now and avoid that duplication (and not involve shelved offloaded here).","commit_id":"8962b31b735ec818725c7116e5229ba5463b1b50"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8642ab1a51c11c1180dd4aee9e9c9eb3e2046fb8","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], post)"},{"line_number":277,"context_line":"        self._wait_for_state_change(self.admin_api, server, \u0027ACTIVE\u0027)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"    def _test_unshelve_server(self, server):"},{"line_number":280,"context_line":"        # setting the shelved_offload_time to 0 should set the"},{"line_number":281,"context_line":"        # instance status to \u0027SHELVED_OFFLOADED\u0027"},{"line_number":282,"context_line":"        self.flags(shelved_offload_time \u003d 0)"},{"line_number":283,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027shelve\u0027: {}})"},{"line_number":284,"context_line":"        self._wait_for_state_change(self.api, server,"},{"line_number":285,"context_line":"                                    expected_status\u003d\u0027SHELVED_OFFLOADED\u0027)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        post \u003d {\u0027unshelve\u0027: None}"},{"line_number":288,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], post)"},{"line_number":289,"context_line":"        self._wait_for_state_change(self.admin_api, server, \u0027ACTIVE\u0027)"},{"line_number":290,"context_line":"        self.assertEqual(4, len(fake_notifier.VERSIONED_NOTIFICATIONS))"},{"line_number":291,"context_line":"        self._verify_notification("},{"line_number":292,"context_line":"            \u0027instance-unshelve-start\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da6895a0_f651f90f","line":289,"range":{"start_line":279,"start_character":1,"end_line":289,"end_character":69},"in_reply_to":"da6895a0_583734e3","updated":"2016-10-21 01:25:48.000000000","message":"Ah yes, that makes sense, it\u0027s because of this code in conductor:\n\nhttps://github.com/openstack/nova/blob/master/nova/conductor/manager.py#L579\n\nIf the instance is shelved, it\u0027s on the host, we just need to power it back on. If it\u0027s shelved_offloaded, then we have to unshelve it on the compute, which is actually spawning it from the shelved image on a compute.\n\nThanks for testing this out.","commit_id":"8962b31b735ec818725c7116e5229ba5463b1b50"}],"nova/tests/unit/compute/test_shelve.py":[{"author":{"_account_id":21111,"name":"STEW TY","email":"punsoca@gmail.com","username":"stewie925"},"change_message_id":"ddd19f835ef1a34592831d13fafadf6b3d51bcb1","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                               side_effect\u003dfake_claim), \\"},{"line_number":271,"context_line":"                 mock.patch.object(instance, \u0027save\u0027) as mock_save:"},{"line_number":272,"context_line":"            mock_save.side_effect \u003d check_save"},{"line_number":273,"context_line":"            self.compute.unshelve_instance("},{"line_number":274,"context_line":"                self.context, instance, image\u003dimage,"},{"line_number":275,"context_line":"                filter_properties\u003dfilter_properties,"},{"line_number":276,"context_line":"                node\u003dnode)"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"            mock_notify.assert_has_calls(["},{"line_number":279,"context_line":"                mock.call(self.context, instance, \u0027fake-mini\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a95cdbc_7bdfcd39","line":276,"range":{"start_line":273,"start_character":0,"end_line":276,"end_character":26},"updated":"2016-10-10 01:29:05.000000000","message":"I ran \u0027tox -e py27\u0027 on test_shelve.py, and it errors on line #276 - error detail in http://paste.openstack.org/show/585119/   - appreciate your input!","commit_id":"a0f778c685b8aeed3c7df31ba2139239895c5ce7"},{"author":{"_account_id":21111,"name":"STEW TY","email":"punsoca@gmail.com","username":"stewie925"},"change_message_id":"277751aff2717c5ac47639212fb24d19969da914","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                               side_effect\u003dfake_claim), \\"},{"line_number":271,"context_line":"                 mock.patch.object(instance, \u0027save\u0027) as mock_save:"},{"line_number":272,"context_line":"            mock_save.side_effect \u003d check_save"},{"line_number":273,"context_line":"            self.compute.unshelve_instance("},{"line_number":274,"context_line":"                self.context, instance, image\u003dimage,"},{"line_number":275,"context_line":"                filter_properties\u003dfilter_properties,"},{"line_number":276,"context_line":"                node\u003dnode)"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"            mock_notify.assert_has_calls(["},{"line_number":279,"context_line":"                mock.call(self.context, instance, \u0027fake-mini\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a95cdbc_b55ce719","line":276,"range":{"start_line":273,"start_character":0,"end_line":276,"end_character":26},"in_reply_to":"1a95cdbc_7bdfcd39","updated":"2016-10-10 15:27:21.000000000","message":"Actually the error occurred  in nova/compute/manager.py  line 4323 - please see comment in https://review.openstack.org/#/c/382565/2/nova/compute/manager.py","commit_id":"a0f778c685b8aeed3c7df31ba2139239895c5ce7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"45a2d53dc58592acd1b26f32997b437a17d16686","unresolved":false,"context_lines":[{"line_number":294,"context_line":"        self.assertEqual(self.compute.host, instance.host)"},{"line_number":295,"context_line":"        self.assertFalse(instance.auto_disk_config)"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"    @mock.patch(\u0027nova.utils.get_image_from_system_metadata\u0027)"},{"line_number":298,"context_line":"    def test_unshelve_volume_backed(self, mock_image_meta):"},{"line_number":299,"context_line":"        instance \u003d self._create_fake_instance_obj()"},{"line_number":300,"context_line":"        node \u003d test_compute.NODENAME"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_44e7f6af","line":297,"updated":"2016-10-12 17:11:01.000000000","message":"You need @mock.patch(\u0027nova.compute.utils.notify_about_instance_action\u0027) here also.","commit_id":"83bc7ac08e33f77746726f6cc6b75a127d466d69"},{"author":{"_account_id":21111,"name":"STEW TY","email":"punsoca@gmail.com","username":"stewie925"},"change_message_id":"bcbbac0f089f72b3cf1bed9b29c50bc0dc962f71","unresolved":false,"context_lines":[{"line_number":294,"context_line":"        self.assertEqual(self.compute.host, instance.host)"},{"line_number":295,"context_line":"        self.assertFalse(instance.auto_disk_config)"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"    @mock.patch(\u0027nova.utils.get_image_from_system_metadata\u0027)"},{"line_number":298,"context_line":"    def test_unshelve_volume_backed(self, mock_image_meta):"},{"line_number":299,"context_line":"        instance \u003d self._create_fake_instance_obj()"},{"line_number":300,"context_line":"        node \u003d test_compute.NODENAME"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa6399be_add7d521","line":297,"in_reply_to":"fa6399be_44e7f6af","updated":"2016-10-12 18:05:18.000000000","message":"thank you so much! i tested locally and unit test is successful.","commit_id":"83bc7ac08e33f77746726f6cc6b75a127d466d69"}],"nova/tests/unit/notifications/objects/test_notification.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2fd25301ca34be736e5b57df1666505b5da3c794","unresolved":false,"context_lines":[{"line_number":259,"context_line":"notification_object_data \u003d {"},{"line_number":260,"context_line":"    \u0027AuditPeriodPayload\u0027: \u00271.0-28345f72ca9d805eeb61b2c2385805dd\u0027,"},{"line_number":261,"context_line":"    \u0027BandwidthPayload\u0027: \u00271.0-49278639296f9939ff2c8947b2078a82\u0027,"},{"line_number":262,"context_line":"    \u0027EventType\u0027: \u00271.3-3899ce4de82f8473de52848b7842466c\u0027,"},{"line_number":263,"context_line":"    \u0027ExceptionNotification\u0027: \u00271.0-a73147b93b520ff0061865849d3dfa56\u0027,"},{"line_number":264,"context_line":"    \u0027ExceptionPayload\u0027: \u00271.0-4516ae282a55fe2fd5c754967ee6248b\u0027,"},{"line_number":265,"context_line":"    \u0027FlavorPayload\u0027: \u00271.0-8ad962ab0bafc7270f474c7dda0b7c20\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa6399be_f1bcf5bc","line":262,"updated":"2016-10-14 10:19:31.000000000","message":"I think it is against the rule to just update the hash. We have to bump the version of the EventType as there is now a new possible enum value.","commit_id":"911b25010fbc053bdee4036b8ac34d2ef6a8f760"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"35893b0e35975a32516a00d9beeb90f451971987","unresolved":false,"context_lines":[{"line_number":259,"context_line":"notification_object_data \u003d {"},{"line_number":260,"context_line":"    \u0027AuditPeriodPayload\u0027: \u00271.0-28345f72ca9d805eeb61b2c2385805dd\u0027,"},{"line_number":261,"context_line":"    \u0027BandwidthPayload\u0027: \u00271.0-49278639296f9939ff2c8947b2078a82\u0027,"},{"line_number":262,"context_line":"    \u0027EventType\u0027: \u00271.3-3899ce4de82f8473de52848b7842466c\u0027,"},{"line_number":263,"context_line":"    \u0027ExceptionNotification\u0027: \u00271.0-a73147b93b520ff0061865849d3dfa56\u0027,"},{"line_number":264,"context_line":"    \u0027ExceptionPayload\u0027: \u00271.0-4516ae282a55fe2fd5c754967ee6248b\u0027,"},{"line_number":265,"context_line":"    \u0027FlavorPayload\u0027: \u00271.0-8ad962ab0bafc7270f474c7dda0b7c20\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa6399be_4c2a5b91","line":262,"in_reply_to":"fa6399be_f1bcf5bc","updated":"2016-10-14 15:16:01.000000000","message":"I made a change where I pre-added the needed NotificationAction values so that we avoid merge conflict with each other bumping the version. Please rebase your change top of https://review.openstack.org/#/c/386659/","commit_id":"911b25010fbc053bdee4036b8ac34d2ef6a8f760"}]}
