)]}'
{"nova/exception.py":[{"author":{"_account_id":8190,"name":"Drew Thorstensen (thorst)","email":"thorst@us.ibm.com","username":"thorst"},"change_message_id":"0ef3a50b298d8295518b090db3a651d9a9ba1ad8","unresolved":false,"context_lines":[{"line_number":2126,"context_line":""},{"line_number":2127,"context_line":""},{"line_number":2128,"context_line":"class PowerVMAPIFailed(NovaException):"},{"line_number":2129,"context_line":"    msg_fmt \u003d _(\"PowerVM API Failed to complete for instance\u003d%(inst_name)s.\""},{"line_number":2130,"context_line":"                \"%(reason)s\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"da36d5c6_95eee7b2","line":2129,"range":{"start_line":2129,"start_character":74,"end_line":2129,"end_character":75},"updated":"2017-02-27 16:53:56.000000000","message":"Add spaces after period.","commit_id":"3871b94cd6b95a93bb4553e2dd156fed91e9fd56"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c31fbc168ae7603a4f3ebf7fc80ee15034ba0218","unresolved":false,"context_lines":[{"line_number":2126,"context_line":""},{"line_number":2127,"context_line":""},{"line_number":2128,"context_line":"class PowerVMAPIFailed(NovaException):"},{"line_number":2129,"context_line":"    msg_fmt \u003d _(\"PowerVM API Failed to complete for instance\u003d%(inst_name)s.\""},{"line_number":2130,"context_line":"                \"%(reason)s\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"da36d5c6_28395ed9","line":2129,"range":{"start_line":2129,"start_character":74,"end_line":2129,"end_character":75},"in_reply_to":"da36d5c6_95eee7b2","updated":"2017-02-27 17:00:04.000000000","message":"Yup, good catch, done.","commit_id":"3871b94cd6b95a93bb4553e2dd156fed91e9fd56"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":2140,"context_line":""},{"line_number":2141,"context_line":""},{"line_number":2142,"context_line":"class PowerVMAPIFailed(NovaException):"},{"line_number":2143,"context_line":"    msg_fmt \u003d _(\"PowerVM API Failed to complete for instance\u003d%(inst_name)s.  \""},{"line_number":2144,"context_line":"                \"%(reason)s\")"},{"line_number":2145,"context_line":""},{"line_number":2146,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_c973fbb0","line":2143,"range":{"start_line":2143,"start_character":29,"end_line":2143,"end_character":35},"updated":"2017-04-07 19:18:06.000000000","message":"failed","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":2140,"context_line":""},{"line_number":2141,"context_line":""},{"line_number":2142,"context_line":"class PowerVMAPIFailed(NovaException):"},{"line_number":2143,"context_line":"    msg_fmt \u003d _(\"PowerVM API Failed to complete for instance\u003d%(inst_name)s.  \""},{"line_number":2144,"context_line":"                \"%(reason)s\")"},{"line_number":2145,"context_line":""},{"line_number":2146,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_a1641823","line":2143,"range":{"start_line":2143,"start_character":29,"end_line":2143,"end_character":35},"in_reply_to":"bff0334d_c973fbb0","updated":"2017-04-11 21:57:00.000000000","message":"Done","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"}],"nova/tests/unit/virt/powervm/__init__.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":29,"context_line":"                            name\u003du\u0027m1.small\u0027,"},{"line_number":30,"context_line":"                            ephemeral_gb\u003d0,"},{"line_number":31,"context_line":"                            rxtx_factor\u003d1.0,"},{"line_number":32,"context_line":"                            flavorid\u003du\u00271\u0027,"},{"line_number":33,"context_line":"                            vcpus\u003d1)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"TEST_INSTANCE_UUID \u003d uuidutils.generate_uuid(dashed\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_89aa93cf","line":32,"range":{"start_line":32,"start_character":37,"end_line":32,"end_character":41},"updated":"2017-04-07 19:18:06.000000000","message":"This is by default a uuid, but OK.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":29,"context_line":"                            name\u003du\u0027m1.small\u0027,"},{"line_number":30,"context_line":"                            ephemeral_gb\u003d0,"},{"line_number":31,"context_line":"                            rxtx_factor\u003d1.0,"},{"line_number":32,"context_line":"                            flavorid\u003du\u00271\u0027,"},{"line_number":33,"context_line":"                            vcpus\u003d1)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"TEST_INSTANCE_UUID \u003d uuidutils.generate_uuid(dashed\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_33c97bab","line":32,"range":{"start_line":32,"start_character":37,"end_line":32,"end_character":41},"in_reply_to":"bff0334d_89aa93cf","updated":"2017-04-11 21:57:00.000000000","message":"Done","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                            flavorid\u003du\u00271\u0027,"},{"line_number":33,"context_line":"                            vcpus\u003d1)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"TEST_INSTANCE_UUID \u003d uuidutils.generate_uuid(dashed\u003dTrue)"},{"line_number":36,"context_line":"TEST_INSTANCE \u003d {"},{"line_number":37,"context_line":"    \u0027id\u0027: 1,"},{"line_number":38,"context_line":"    \u0027uuid\u0027: TEST_INSTANCE_UUID,"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_e97ebf69","line":35,"range":{"start_line":35,"start_character":21,"end_line":35,"end_character":57},"updated":"2017-04-07 19:18:06.000000000","message":"Just use nova.tests.uuidsentinel.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                            flavorid\u003du\u00271\u0027,"},{"line_number":33,"context_line":"                            vcpus\u003d1)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"TEST_INSTANCE_UUID \u003d uuidutils.generate_uuid(dashed\u003dTrue)"},{"line_number":36,"context_line":"TEST_INSTANCE \u003d {"},{"line_number":37,"context_line":"    \u0027id\u0027: 1,"},{"line_number":38,"context_line":"    \u0027uuid\u0027: TEST_INSTANCE_UUID,"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_13ce77b3","line":35,"range":{"start_line":35,"start_character":21,"end_line":35,"end_character":57},"in_reply_to":"bff0334d_e97ebf69","updated":"2017-04-11 21:57:00.000000000","message":"Done","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                            vcpus\u003d1)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"TEST_INSTANCE_UUID \u003d uuidutils.generate_uuid(dashed\u003dTrue)"},{"line_number":36,"context_line":"TEST_INSTANCE \u003d {"},{"line_number":37,"context_line":"    \u0027id\u0027: 1,"},{"line_number":38,"context_line":"    \u0027uuid\u0027: TEST_INSTANCE_UUID,"},{"line_number":39,"context_line":"    \u0027display_name\u0027: \u0027Fake Instance\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_89461321","line":36,"updated":"2017-04-07 19:18:06.000000000","message":"You should eventually be using real Instance objects for the tests, like you\u0027re using for the Flavor.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                            vcpus\u003d1)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"TEST_INSTANCE_UUID \u003d uuidutils.generate_uuid(dashed\u003dTrue)"},{"line_number":36,"context_line":"TEST_INSTANCE \u003d {"},{"line_number":37,"context_line":"    \u0027id\u0027: 1,"},{"line_number":38,"context_line":"    \u0027uuid\u0027: TEST_INSTANCE_UUID,"},{"line_number":39,"context_line":"    \u0027display_name\u0027: \u0027Fake Instance\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_135c37eb","line":36,"in_reply_to":"bff0334d_89461321","updated":"2017-04-11 21:57:00.000000000","message":"Yeah, we\u0027re using a real instance, but were building it from this dict in the individual test cases, which is silly.  Fixed.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    \u0027display_name\u0027: \u0027Fake Instance\u0027,"},{"line_number":40,"context_line":"    \u0027root_gb\u0027: 10,"},{"line_number":41,"context_line":"    \u0027ephemeral_gb\u0027: 0,"},{"line_number":42,"context_line":"    \u0027instance_type_id\u0027: \u00275\u0027,"},{"line_number":43,"context_line":"    \u0027system_metadata\u0027: {\u0027image_os_distro\u0027: \u0027rhel\u0027},"},{"line_number":44,"context_line":"    \u0027host\u0027: \u0027host1\u0027,"},{"line_number":45,"context_line":"    \u0027flavor\u0027: TEST_FLAVOR,"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_c9f65bfa","line":42,"range":{"start_line":42,"start_character":24,"end_line":42,"end_character":27},"updated":"2017-04-07 19:18:06.000000000","message":"This should be an int, it\u0027s the primary key for the flavor. Since you\u0027re using TEST_FLAVOR it should probably be TEST_FLAVOR.id.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    \u0027display_name\u0027: \u0027Fake Instance\u0027,"},{"line_number":40,"context_line":"    \u0027root_gb\u0027: 10,"},{"line_number":41,"context_line":"    \u0027ephemeral_gb\u0027: 0,"},{"line_number":42,"context_line":"    \u0027instance_type_id\u0027: \u00275\u0027,"},{"line_number":43,"context_line":"    \u0027system_metadata\u0027: {\u0027image_os_distro\u0027: \u0027rhel\u0027},"},{"line_number":44,"context_line":"    \u0027host\u0027: \u0027host1\u0027,"},{"line_number":45,"context_line":"    \u0027flavor\u0027: TEST_FLAVOR,"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_13431715","line":42,"range":{"start_line":42,"start_character":24,"end_line":42,"end_character":27},"in_reply_to":"bff0334d_c9f65bfa","updated":"2017-04-11 21:57:00.000000000","message":"Done","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    \u0027host\u0027: \u0027host1\u0027,"},{"line_number":45,"context_line":"    \u0027flavor\u0027: TEST_FLAVOR,"},{"line_number":46,"context_line":"    \u0027task_state\u0027: None,"},{"line_number":47,"context_line":"    \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":48,"context_line":"    \u0027power_state\u0027: power_state.SHUTDOWN,"},{"line_number":49,"context_line":"}"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"TEST_INST_SPAWNING_UUID \u003d uuidutils.generate_uuid(dashed\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_2938279e","line":48,"range":{"start_line":47,"start_character":4,"end_line":48,"end_character":40},"updated":"2017-04-07 19:18:06.000000000","message":"It\u0027s active but shutdown?","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    \u0027host\u0027: \u0027host1\u0027,"},{"line_number":45,"context_line":"    \u0027flavor\u0027: TEST_FLAVOR,"},{"line_number":46,"context_line":"    \u0027task_state\u0027: None,"},{"line_number":47,"context_line":"    \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":48,"context_line":"    \u0027power_state\u0027: power_state.SHUTDOWN,"},{"line_number":49,"context_line":"}"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"TEST_INST_SPAWNING_UUID \u003d uuidutils.generate_uuid(dashed\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_faba9fbe","line":48,"range":{"start_line":47,"start_character":4,"end_line":48,"end_character":40},"in_reply_to":"bff0334d_2938279e","updated":"2017-04-11 21:57:00.000000000","message":"Shrug.  I don\u0027t think we are (or need to be) testing anything that cares whether these values make sense.  But changed to STOPPED/SHUTDOWN.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":49,"context_line":"}"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"TEST_INST_SPAWNING_UUID \u003d uuidutils.generate_uuid(dashed\u003dTrue)"},{"line_number":52,"context_line":"TEST_INST_SPAWNING \u003d dict(TEST_INSTANCE, task_state\u003dtask_states.SPAWNING,"},{"line_number":53,"context_line":"                          uuid\u003dTEST_INST_SPAWNING_UUID)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_c95d3bea","line":52,"range":{"start_line":52,"start_character":41,"end_line":52,"end_character":72},"updated":"2017-04-07 19:18:06.000000000","message":"It wouldn\u0027t be active/spawning at the same time, it would be building/spawning.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":49,"context_line":"}"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"TEST_INST_SPAWNING_UUID \u003d uuidutils.generate_uuid(dashed\u003dTrue)"},{"line_number":52,"context_line":"TEST_INST_SPAWNING \u003d dict(TEST_INSTANCE, task_state\u003dtask_states.SPAWNING,"},{"line_number":53,"context_line":"                          uuid\u003dTEST_INST_SPAWNING_UUID)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_9ad273d0","line":52,"range":{"start_line":52,"start_character":41,"end_line":52,"end_character":72},"in_reply_to":"bff0334d_c95d3bea","updated":"2017-04-11 21:57:00.000000000","message":"Don\u0027t actually need TEST_INST_SPAWNING (yet).  Removed.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"}],"nova/tests/unit/virt/powervm/test_vm.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4f5d01c9676fde5790017fb9c00d5ee1cd87b85c","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    @mock.patch(\u0027nova.virt.powervm.vm.VMBuilder\u0027, autospec\u003dTrue)"},{"line_number":209,"context_line":"    @mock.patch(\u0027pypowervm.utils.validation.LPARWrapperValidator\u0027,"},{"line_number":210,"context_line":"                autospec\u003dTrue)"},{"line_number":211,"context_line":"    # @mock.patch(\u0027pypowervm.utils.lpar_builder.LPARBuilder\u0027, autospec\u003dTrue)"},{"line_number":212,"context_line":"    def test_crt_lpar(self, mock_vld, mock_vmbldr):"},{"line_number":213,"context_line":"        instance \u003d objects.Instance(**powervm.TEST_INSTANCE)"},{"line_number":214,"context_line":"        mock_bldr \u003d mock.Mock(spec\u003dlpar_bld.LPARBuilder)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a1ced50_aab879e6","line":211,"range":{"start_line":211,"start_character":0,"end_line":211,"end_character":76},"updated":"2017-03-20 21:35:57.000000000","message":"Gaaaah!","commit_id":"d084ea8da7a4100a0303df4abfa727283472693d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ef1544927ee4ce3c1b96a5441e43a03c54967889","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        self.assertNotEqual(inst_info1, inst_info2)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    @mock.patch(\u0027pypowervm.wrappers.logical_partition.LPAR\u0027, autospec\u003dTrue)"},{"line_number":135,"context_line":"    def test_get_lpars(self, mock_lpar):"},{"line_number":136,"context_line":"        inst1 \u003d mock.Mock()"},{"line_number":137,"context_line":"        inst1.configure_mock(name\u003d\u0027inst1\u0027)"},{"line_number":138,"context_line":"        inst2 \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":10,"id":"ffe62b97_53e0bf96","line":135,"range":{"start_line":135,"start_character":8,"end_line":135,"end_character":22},"updated":"2017-03-27 13:00:53.000000000","message":"This should maybe be called test_get_lpar_names.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        self.assertNotEqual(inst_info1, inst_info2)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    @mock.patch(\u0027pypowervm.wrappers.logical_partition.LPAR\u0027, autospec\u003dTrue)"},{"line_number":135,"context_line":"    def test_get_lpars(self, mock_lpar):"},{"line_number":136,"context_line":"        inst1 \u003d mock.Mock()"},{"line_number":137,"context_line":"        inst1.configure_mock(name\u003d\u0027inst1\u0027)"},{"line_number":138,"context_line":"        inst2 \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_9aa03344","line":135,"range":{"start_line":135,"start_character":8,"end_line":135,"end_character":22},"in_reply_to":"ffe62b97_53e0bf96","updated":"2017-04-11 21:57:00.000000000","message":"Done","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a4dfbbf55361297388d9c3eafad0c494894ed0a2","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.resp \u003d mock.MagicMock()"},{"line_number":42,"context_line":"        self.resp.feed \u003d mock.MagicMock(entries\u003dmock_entries)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        self.get_pvm_uuid \u003d self.useFixture(fixtures.MockPatch("},{"line_number":45,"context_line":"            \u0027nova.virt.powervm.vm.get_pvm_uuid\u0027)).mock"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.inst \u003d powervm.TEST_INSTANCE"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7ffa3b31_b4d9e657","line":45,"range":{"start_line":44,"start_character":28,"end_line":45,"end_character":54},"updated":"2017-04-20 21:11:42.000000000","message":"I\u0027ve never seen this done with a fixture like this. You could have also just done the mock start/stop patch stuff, but meh.","commit_id":"6df654592a9ebc3d3c8915b1e67281a86bb122e9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"754096b7a566d8f835005c6fe35ad99436357728","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.resp \u003d mock.MagicMock()"},{"line_number":42,"context_line":"        self.resp.feed \u003d mock.MagicMock(entries\u003dmock_entries)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        self.get_pvm_uuid \u003d self.useFixture(fixtures.MockPatch("},{"line_number":45,"context_line":"            \u0027nova.virt.powervm.vm.get_pvm_uuid\u0027)).mock"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.inst \u003d powervm.TEST_INSTANCE"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7ffa3b31_345ef643","line":45,"range":{"start_line":44,"start_character":28,"end_line":45,"end_character":54},"in_reply_to":"7ffa3b31_b4d9e657","updated":"2017-04-20 21:21:32.000000000","message":"Yeah, useFixture(fixtures.MockPatch()) is \"shorthand\" for .start()/.addCleanup(.stop).  It may not actually be fewer characters, or even fewer lines, but it\u0027s fewer statements ;-)","commit_id":"6df654592a9ebc3d3c8915b1e67281a86bb122e9"}],"nova/virt/powervm/driver.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ccd19e3fd47b4e702e93f60b2ae198ec724a5c59","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def spawn(self, context, instance, image_meta, injected_files,"},{"line_number":127,"context_line":"              admin_password, network_info\u003dNone, block_device_info\u003dNone,"},{"line_number":128,"context_line":"              flavor\u003dNone):"},{"line_number":129,"context_line":"        \"\"\"Create a new instance/VM/domain on the virtualization platform."},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        Once this successfully completes, the instance should be"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a1ff146_1309f3dd","line":128,"range":{"start_line":128,"start_character":14,"end_line":128,"end_character":25},"updated":"2017-03-15 21:32:19.000000000","message":"No longer in the method signature.  See below.","commit_id":"631d743a4f2cd01b96dab84a84007fee83158f20"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ccd19e3fd47b4e702e93f60b2ae198ec724a5c59","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        :param flavor: The flavor for the instance to be spawned."},{"line_number":151,"context_line":"        \"\"\""},{"line_number":152,"context_line":"        self._log_operation(\u0027spawn\u0027, instance)"},{"line_number":153,"context_line":"        if not flavor:"},{"line_number":154,"context_line":"            admin_ctx \u003d ctx.get_admin_context(read_deleted\u003d\u0027yes\u0027)"},{"line_number":155,"context_line":"            flavor \u003d flavor_obj.Flavor.get_by_id(admin_ctx,"},{"line_number":156,"context_line":"                                                 instance.instance_type_id)"},{"line_number":157,"context_line":"        # TODO(efried): Use TaskFlow"},{"line_number":158,"context_line":"        vm.crt_lpar(self.adapter, self.host_wrapper, instance, flavor)"},{"line_number":159,"context_line":"        # TODO(thorst, efried) Plug the VIFs"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a1ff146_3310af01","line":156,"range":{"start_line":153,"start_character":0,"end_line":156,"end_character":75},"updated":"2017-03-15 21:32:19.000000000","message":"Not necessary - just use instance.flavor","commit_id":"631d743a4f2cd01b96dab84a84007fee83158f20"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0d9c70c83a7f05467a95dd5d6b3e8b20020e1cf3","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                        instance\u003dinstance)"},{"line_number":184,"context_line":"            return"},{"line_number":185,"context_line":"        except Exception as e:"},{"line_number":186,"context_line":"                LOG.exception(e)"},{"line_number":187,"context_line":"                # Convert to a Nova exception"},{"line_number":188,"context_line":"                raise exc.InstanceTerminationFailure(reason\u003dsix.text_type(e))"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a1ced50_3a6f492c","line":188,"range":{"start_line":186,"start_character":0,"end_line":188,"end_character":77},"updated":"2017-03-21 18:39:14.000000000","message":"indent","commit_id":"fe462f543212bd762ba5882239d7304cbe6f5468"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import six"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from nova import exception as exc"},{"line_number":25,"context_line":"from nova.i18n import _LI, _LW"},{"line_number":26,"context_line":"from nova.virt import driver"},{"line_number":27,"context_line":"from nova.virt.powervm import host"},{"line_number":28,"context_line":"from nova.virt.powervm import vm"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_e90fdfde","line":25,"range":{"start_line":25,"start_character":27,"end_line":25,"end_character":30},"updated":"2017-04-07 19:18:06.000000000","message":"We don\u0027t have to use these anymore.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import six"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from nova import exception as exc"},{"line_number":25,"context_line":"from nova.i18n import _LI, _LW"},{"line_number":26,"context_line":"from nova.virt import driver"},{"line_number":27,"context_line":"from nova.virt.powervm import host"},{"line_number":28,"context_line":"from nova.virt.powervm import vm"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_dac35bec","line":25,"range":{"start_line":25,"start_character":27,"end_line":25,"end_character":30},"in_reply_to":"bff0334d_e90fdfde","updated":"2017-04-11 21:57:00.000000000","message":"Done","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        self._log_operation(\u0027destroy\u0027, instance)"},{"line_number":172,"context_line":"        try:"},{"line_number":173,"context_line":"            # TODO(efried): Use TaskFlow"},{"line_number":174,"context_line":"            vm.power_off(self.adapter, instance, force_immediate\u003ddestroy_disks)"},{"line_number":175,"context_line":"            # TODO(thorst, efried) Add unplug vifs task"},{"line_number":176,"context_line":"            # TODO(thorst, efried) Add config drive tasks"},{"line_number":177,"context_line":"            # TODO(thorst, efried) Add volume disconnect tasks"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_2f002701","line":174,"updated":"2017-04-07 19:18:06.000000000","message":"If you fail to power off can you still attempt to delete?","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":8190,"name":"Drew Thorstensen (thorst)","email":"thorst@us.ibm.com","username":"thorst"},"change_message_id":"e1e289cd6577472ac339e5db15739fbcc0ec95fd","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        self._log_operation(\u0027destroy\u0027, instance)"},{"line_number":172,"context_line":"        try:"},{"line_number":173,"context_line":"            # TODO(efried): Use TaskFlow"},{"line_number":174,"context_line":"            vm.power_off(self.adapter, instance, force_immediate\u003ddestroy_disks)"},{"line_number":175,"context_line":"            # TODO(thorst, efried) Add unplug vifs task"},{"line_number":176,"context_line":"            # TODO(thorst, efried) Add config drive tasks"},{"line_number":177,"context_line":"            # TODO(thorst, efried) Add volume disconnect tasks"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_331f3b5c","line":174,"in_reply_to":"bff0334d_2f002701","updated":"2017-04-10 20:08:06.000000000","message":"No.  But in this scenario it should \u0027force\u0027 off (since its being destroyed).  Which shouldn\u0027t fail...but if for some reason it does, we can\u0027t delete.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            # TODO(thorst, efried) Add LPAR id based scsi map clean up task"},{"line_number":180,"context_line":"            vm.dlt_lpar(self.adapter, vm.get_pvm_uuid(instance))"},{"line_number":181,"context_line":"        except exc.InstanceNotFound:"},{"line_number":182,"context_line":"            LOG.warning(_LW(\u0027VM was not found during destroy operation.\u0027),"},{"line_number":183,"context_line":"                        instance\u003dinstance)"},{"line_number":184,"context_line":"            return"},{"line_number":185,"context_line":"        except Exception as e:"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_acfa0572","line":182,"updated":"2017-04-07 19:18:06.000000000","message":"Don\u0027t need this at warning, info is fine.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            # TODO(thorst, efried) Add LPAR id based scsi map clean up task"},{"line_number":180,"context_line":"            vm.dlt_lpar(self.adapter, vm.get_pvm_uuid(instance))"},{"line_number":181,"context_line":"        except exc.InstanceNotFound:"},{"line_number":182,"context_line":"            LOG.warning(_LW(\u0027VM was not found during destroy operation.\u0027),"},{"line_number":183,"context_line":"                        instance\u003dinstance)"},{"line_number":184,"context_line":"            return"},{"line_number":185,"context_line":"        except Exception as e:"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_1aa54347","line":182,"in_reply_to":"bff0334d_acfa0572","updated":"2017-04-11 21:57:00.000000000","message":"Done","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        :cpu_time_ns:     (int) the CPU time used in nanoseconds"},{"line_number":78,"context_line":"        :id:              a unique ID for the instance"},{"line_number":79,"context_line":"        \"\"\""},{"line_number":80,"context_line":"        return vm.InstanceInfo(self.adapter, vm.get_pvm_uuid(instance))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def list_instances(self):"},{"line_number":83,"context_line":"        \"\"\"Return the names of all the instances known to the virt host."}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_0fb88ee2","line":80,"range":{"start_line":80,"start_character":45,"end_line":80,"end_character":70},"updated":"2017-04-20 16:41:54.000000000","message":"I think I\u0027d prefer just passing instance directly here, as we do in other places like vm.create_lpar and vm.power_on, and let vm.InstanceInfo make the get_pvm_uuid call.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        :cpu_time_ns:     (int) the CPU time used in nanoseconds"},{"line_number":78,"context_line":"        :id:              a unique ID for the instance"},{"line_number":79,"context_line":"        \"\"\""},{"line_number":80,"context_line":"        return vm.InstanceInfo(self.adapter, vm.get_pvm_uuid(instance))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def list_instances(self):"},{"line_number":83,"context_line":"        \"\"\"Return the names of all the instances known to the virt host."}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_c63728ff","line":80,"range":{"start_line":80,"start_character":45,"end_line":80,"end_character":70},"in_reply_to":"7ffa3b31_0fb88ee2","updated":"2017-04-20 20:18:27.000000000","message":"Yeah, I like this.  Done.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            # TODO(thorst, efried) Add volume disconnect tasks"},{"line_number":180,"context_line":"            # TODO(thorst, efried) Add disk disconnect/destroy tasks"},{"line_number":181,"context_line":"            # TODO(thorst, efried) Add LPAR id based scsi map clean up task"},{"line_number":182,"context_line":"            vm.delete_lpar(self.adapter, vm.get_pvm_uuid(instance))"},{"line_number":183,"context_line":"        except exc.InstanceNotFound:"},{"line_number":184,"context_line":"            LOG.info(\u0027VM was not found during destroy operation.\u0027,"},{"line_number":185,"context_line":"                     instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_f228a9e2","line":182,"range":{"start_line":182,"start_character":41,"end_line":182,"end_character":66},"updated":"2017-04-20 16:41:54.000000000","message":"same comment as above, I think the conversion of the ID can happen in vm.py","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            # TODO(thorst, efried) Add volume disconnect tasks"},{"line_number":180,"context_line":"            # TODO(thorst, efried) Add disk disconnect/destroy tasks"},{"line_number":181,"context_line":"            # TODO(thorst, efried) Add LPAR id based scsi map clean up task"},{"line_number":182,"context_line":"            vm.delete_lpar(self.adapter, vm.get_pvm_uuid(instance))"},{"line_number":183,"context_line":"        except exc.InstanceNotFound:"},{"line_number":184,"context_line":"            LOG.info(\u0027VM was not found during destroy operation.\u0027,"},{"line_number":185,"context_line":"                     instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_863da0de","line":182,"range":{"start_line":182,"start_character":41,"end_line":182,"end_character":66},"in_reply_to":"7ffa3b31_f228a9e2","updated":"2017-04-20 20:18:27.000000000","message":"Done","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            LOG.info(\u0027VM was not found during destroy operation.\u0027,"},{"line_number":185,"context_line":"                     instance\u003dinstance)"},{"line_number":186,"context_line":"            return"},{"line_number":187,"context_line":"        except Exception as e:"},{"line_number":188,"context_line":"            LOG.exception(e)"},{"line_number":189,"context_line":"            # Convert to a Nova exception"},{"line_number":190,"context_line":"            raise exc.InstanceTerminationFailure(reason\u003dsix.text_type(e))"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_af475a4c","line":187,"updated":"2017-04-20 16:41:54.000000000","message":"this line and the next have the same issues mriedem was pointing out elsewhere","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            LOG.info(\u0027VM was not found during destroy operation.\u0027,"},{"line_number":185,"context_line":"                     instance\u003dinstance)"},{"line_number":186,"context_line":"            return"},{"line_number":187,"context_line":"        except Exception as e:"},{"line_number":188,"context_line":"            LOG.exception(e)"},{"line_number":189,"context_line":"            # Convert to a Nova exception"},{"line_number":190,"context_line":"            raise exc.InstanceTerminationFailure(reason\u003dsix.text_type(e))"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_662614d1","line":187,"in_reply_to":"7ffa3b31_af475a4c","updated":"2017-04-20 20:18:27.000000000","message":"Fixed in PS13.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"7680cd34927fff54fa91a1d2bf57f65faab8940f","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            # TODO(thorst, efried) Add LPAR id based scsi map clean up task"},{"line_number":183,"context_line":"            vm.delete_lpar(self.adapter, vm.get_pvm_uuid(instance))"},{"line_number":184,"context_line":"        except exc.InstanceNotFound:"},{"line_number":185,"context_line":"            LOG.info(\u0027VM was not found during destroy operation.\u0027,"},{"line_number":186,"context_line":"                     instance\u003dinstance)"},{"line_number":187,"context_line":"            return"},{"line_number":188,"context_line":"        except pvm_exc.Error as e:"}],"source_content_type":"text/x-python","patch_set":13,"id":"7ffa3b31_26336cf8","line":185,"updated":"2017-04-20 19:26:28.000000000","message":"nit: debug is probably better","commit_id":"c0cd4474f3f272c9ce1f687c8fcf5c56a6ba7a61"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5aa73c8ebbbadfa55d976f7fabfa9cbdd0a65e0e","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            # TODO(thorst, efried) Add LPAR id based scsi map clean up task"},{"line_number":183,"context_line":"            vm.delete_lpar(self.adapter, vm.get_pvm_uuid(instance))"},{"line_number":184,"context_line":"        except exc.InstanceNotFound:"},{"line_number":185,"context_line":"            LOG.info(\u0027VM was not found during destroy operation.\u0027,"},{"line_number":186,"context_line":"                     instance\u003dinstance)"},{"line_number":187,"context_line":"            return"},{"line_number":188,"context_line":"        except pvm_exc.Error as e:"}],"source_content_type":"text/x-python","patch_set":13,"id":"7ffa3b31_69d14723","line":185,"in_reply_to":"7ffa3b31_26336cf8","updated":"2017-04-20 20:23:23.000000000","message":"Done","commit_id":"c0cd4474f3f272c9ce1f687c8fcf5c56a6ba7a61"}],"nova/virt/powervm/vm.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from nova.compute import power_state"},{"line_number":31,"context_line":"from nova import conf"},{"line_number":32,"context_line":"from nova import exception as exc"},{"line_number":33,"context_line":"from nova.i18n import _LI, _LE, _LW"},{"line_number":34,"context_line":"from nova.virt import hardware"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_695aaf4f","line":33,"range":{"start_line":33,"start_character":0,"end_line":33,"end_character":35},"updated":"2017-04-07 19:18:06.000000000","message":"Don\u0027t need to translate log messages.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from nova.compute import power_state"},{"line_number":31,"context_line":"from nova import conf"},{"line_number":32,"context_line":"from nova import exception as exc"},{"line_number":33,"context_line":"from nova.i18n import _LI, _LE, _LW"},{"line_number":34,"context_line":"from nova.virt import hardware"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_da68fbf5","line":33,"range":{"start_line":33,"start_character":0,"end_line":33,"end_character":35},"in_reply_to":"bff0334d_695aaf4f","updated":"2017-04-11 21:57:00.000000000","message":"Done","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    :param instance: nova.objects.instance.Instance."},{"line_number":85,"context_line":"    :return: The PowerVM UUID for the LPAR corresponding to the instance."},{"line_number":86,"context_line":"    \"\"\""},{"line_number":87,"context_line":"    return pvm_uuid.convert_uuid_to_pvm(instance.uuid).upper()"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"def get_instance_wrapper(adapter, instance, xag\u003dNone):"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_ec6dad04","line":87,"range":{"start_line":87,"start_character":20,"end_line":87,"end_character":39},"updated":"2017-04-07 19:18:06.000000000","message":"Is this just a hash function?","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    :param instance: nova.objects.instance.Instance."},{"line_number":85,"context_line":"    :return: The PowerVM UUID for the LPAR corresponding to the instance."},{"line_number":86,"context_line":"    \"\"\""},{"line_number":87,"context_line":"    return pvm_uuid.convert_uuid_to_pvm(instance.uuid).upper()"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"def get_instance_wrapper(adapter, instance, xag\u003dNone):"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_9d238da7","line":87,"range":{"start_line":87,"start_character":20,"end_line":87,"end_character":39},"in_reply_to":"bff0334d_ec6dad04","updated":"2017-04-11 21:57:00.000000000","message":"No.  The PowerVM platform and OpenStack use different UUID variants (don\u0027t ask me to name them).  In PowerVM, the first bit has to be zero.  We create the LPAR on the platform using the instance UUID given to us by nova - but we have to zero that bit if it\u0027s set.  (For reasons I can\u0027t explain, an LPAR UUID also has to be presented to the PowerVM REST API in uppercase - though that of most of the other objects does not.)\n\nHere\u0027s the convert function FYI: https://github.com/powervm/pypowervm/blob/develop/pypowervm/utils/uuid.py#L24","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    :param adapter: The adapter for the pypowervm API"},{"line_number":94,"context_line":"    :param instance: The nova instance."},{"line_number":95,"context_line":"    :param xag: The pypowervm XAG to be used on the read request."},{"line_number":96,"context_line":"    :return: The pypowervm logical_partition wrapper."},{"line_number":97,"context_line":"    \"\"\""},{"line_number":98,"context_line":"    pvm_inst_uuid \u003d get_pvm_uuid(instance)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_cca2e94b","line":95,"range":{"start_line":95,"start_character":30,"end_line":95,"end_character":33},"updated":"2017-04-07 19:18:06.000000000","message":"wtf is a xag?","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    :param adapter: The adapter for the pypowervm API"},{"line_number":94,"context_line":"    :param instance: The nova instance."},{"line_number":95,"context_line":"    :param xag: The pypowervm XAG to be used on the read request."},{"line_number":96,"context_line":"    :return: The pypowervm logical_partition wrapper."},{"line_number":97,"context_line":"    \"\"\""},{"line_number":98,"context_line":"    pvm_inst_uuid \u003d get_pvm_uuid(instance)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_7d6c49cd","line":95,"range":{"start_line":95,"start_character":30,"end_line":95,"end_character":33},"in_reply_to":"bff0334d_c18cbcd8","updated":"2017-04-11 21:57:00.000000000","message":"Turns out we don\u0027t need it (yet), so removing.  When we bring it back, I\u0027ll enhance this docstring some.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":8190,"name":"Drew Thorstensen (thorst)","email":"thorst@us.ibm.com","username":"thorst"},"change_message_id":"e1e289cd6577472ac339e5db15739fbcc0ec95fd","unresolved":false,"context_lines":[{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    :param adapter: The adapter for the pypowervm API"},{"line_number":94,"context_line":"    :param instance: The nova instance."},{"line_number":95,"context_line":"    :param xag: The pypowervm XAG to be used on the read request."},{"line_number":96,"context_line":"    :return: The pypowervm logical_partition wrapper."},{"line_number":97,"context_line":"    \"\"\""},{"line_number":98,"context_line":"    pvm_inst_uuid \u003d get_pvm_uuid(instance)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_c18cbcd8","line":95,"range":{"start_line":95,"start_character":30,"end_line":95,"end_character":33},"in_reply_to":"bff0334d_cca2e94b","updated":"2017-04-10 20:08:06.000000000","message":"I know rite?\n\nBasically tells the server \u0027extended attributes\u0027 you want back.  More extended attributes means a slower API response.  Defaults to no \u0027extended\u0027 attributes.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    pvm_inst_uuid \u003d get_pvm_uuid(instance)"},{"line_number":99,"context_line":"    try:"},{"line_number":100,"context_line":"        return pvm_lpar.LPAR.get(adapter, uuid\u003dpvm_inst_uuid, xag\u003dxag)"},{"line_number":101,"context_line":"    except pvm_exc.Error as he:"},{"line_number":102,"context_line":"        LOG.exception(he)"},{"line_number":103,"context_line":"        if he.response is not None and he.response.status \u003d\u003d 404:"},{"line_number":104,"context_line":"            raise exc.InstanceNotFound(instance_id\u003dpvm_inst_uuid)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_2c327511","line":101,"range":{"start_line":101,"start_character":19,"end_line":101,"end_character":24},"updated":"2017-04-07 19:18:06.000000000","message":"Should this be Error or HttpError? Do all non-HttpError\u0027s have a response attribute?","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    pvm_inst_uuid \u003d get_pvm_uuid(instance)"},{"line_number":99,"context_line":"    try:"},{"line_number":100,"context_line":"        return pvm_lpar.LPAR.get(adapter, uuid\u003dpvm_inst_uuid, xag\u003dxag)"},{"line_number":101,"context_line":"    except pvm_exc.Error as he:"},{"line_number":102,"context_line":"        LOG.exception(he)"},{"line_number":103,"context_line":"        if he.response is not None and he.response.status \u003d\u003d 404:"},{"line_number":104,"context_line":"            raise exc.InstanceNotFound(instance_id\u003dpvm_inst_uuid)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_1de09d25","line":101,"range":{"start_line":101,"start_character":19,"end_line":101,"end_character":24},"in_reply_to":"bff0334d_2c327511","updated":"2017-04-11 21:57:00.000000000","message":"Yeah, the base Error [1] is where the response attribute is set.  We trap the broader version so we can log it below.\n\n[1] https://github.com/powervm/pypowervm/blob/develop/pypowervm/exceptions.py#L33","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        # Get the current state and see if we can start the VM"},{"line_number":120,"context_line":"        if entry.state in POWERVM_STARTABLE_STATE:"},{"line_number":121,"context_line":"            # Now start the lpar"},{"line_number":122,"context_line":"            power.power_on(entry, None)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"def power_off(adapter, instance, force_immediate\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_8f0e1330","line":122,"updated":"2017-04-07 19:18:06.000000000","message":"No error handling here in case it fails?","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        # Get the current state and see if we can start the VM"},{"line_number":120,"context_line":"        if entry.state in POWERVM_STARTABLE_STATE:"},{"line_number":121,"context_line":"            # Now start the lpar"},{"line_number":122,"context_line":"            power.power_on(entry, None)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"def power_off(adapter, instance, force_immediate\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_bd3f7185","line":122,"in_reply_to":"bff0334d_8f0e1330","updated":"2017-04-11 21:57:00.000000000","message":"Yup, good catch.  It\u0027s even in the docstring.  Fixed.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                      {\u0027inst\u0027: instance.name})"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"def dlt_lpar(adapter, lpar_uuid):"},{"line_number":159,"context_line":"    \"\"\"Delete an LPAR."},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    :param adapter: The adapter for the pypowervm API."}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_0950c331","line":158,"range":{"start_line":158,"start_character":4,"end_line":158,"end_character":7},"updated":"2017-04-07 19:18:06.000000000","message":"delete","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                      {\u0027inst\u0027: instance.name})"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"def dlt_lpar(adapter, lpar_uuid):"},{"line_number":159,"context_line":"    \"\"\"Delete an LPAR."},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    :param adapter: The adapter for the pypowervm API."}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_3d6c819a","line":158,"range":{"start_line":158,"start_character":4,"end_line":158,"end_character":7},"in_reply_to":"bff0334d_0950c331","updated":"2017-04-11 21:57:00.000000000","message":"Done","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        return resp"},{"line_number":174,"context_line":"    except pvm_exc.HttpError as e:"},{"line_number":175,"context_line":"        if e.response and e.response.status \u003d\u003d 404:"},{"line_number":176,"context_line":"            LOG.warning(_LW(\u0027Virtual Machine not found LPAR_ID: %s\u0027),"},{"line_number":177,"context_line":"                        lpar_uuid)"},{"line_number":178,"context_line":"        else:"},{"line_number":179,"context_line":"            LOG.error(_LE(\u0027HttpError deleting virtual machine. LPARID: %s\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_e9147f50","line":176,"updated":"2017-04-07 19:18:06.000000000","message":"This doesn\u0027t need to be a warning, you raced with another delete, just log as info.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            LOG.warning(_LW(\u0027Virtual Machine not found LPAR_ID: %s\u0027),"},{"line_number":177,"context_line":"                        lpar_uuid)"},{"line_number":178,"context_line":"        else:"},{"line_number":179,"context_line":"            LOG.error(_LE(\u0027HttpError deleting virtual machine. LPARID: %s\u0027),"},{"line_number":180,"context_line":"                      lpar_uuid)"},{"line_number":181,"context_line":"            raise"},{"line_number":182,"context_line":"    except pvm_exc.Error:"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_c9177b51","line":179,"updated":"2017-04-07 19:18:06.000000000","message":"Log the actual error message too.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            LOG.warning(_LW(\u0027Virtual Machine not found LPAR_ID: %s\u0027),"},{"line_number":177,"context_line":"                        lpar_uuid)"},{"line_number":178,"context_line":"        else:"},{"line_number":179,"context_line":"            LOG.error(_LE(\u0027HttpError deleting virtual machine. LPARID: %s\u0027),"},{"line_number":180,"context_line":"                      lpar_uuid)"},{"line_number":181,"context_line":"            raise"},{"line_number":182,"context_line":"    except pvm_exc.Error:"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_9d294d38","line":179,"in_reply_to":"bff0334d_61b5f07d","updated":"2017-04-11 21:57:00.000000000","message":"Right, the exception is logged by the caller (driver.py:182).  Do you think it should happen here instead?","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":8190,"name":"Drew Thorstensen (thorst)","email":"thorst@us.ibm.com","username":"thorst"},"change_message_id":"e1e289cd6577472ac339e5db15739fbcc0ec95fd","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            LOG.warning(_LW(\u0027Virtual Machine not found LPAR_ID: %s\u0027),"},{"line_number":177,"context_line":"                        lpar_uuid)"},{"line_number":178,"context_line":"        else:"},{"line_number":179,"context_line":"            LOG.error(_LE(\u0027HttpError deleting virtual machine. LPARID: %s\u0027),"},{"line_number":180,"context_line":"                      lpar_uuid)"},{"line_number":181,"context_line":"            raise"},{"line_number":182,"context_line":"    except pvm_exc.Error:"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_61b5f07d","line":179,"in_reply_to":"bff0334d_c9177b51","updated":"2017-04-10 20:08:06.000000000","message":"This was probably my doing in that the error message usually gets logged again as its raised up, leading to duplicate logs of the error message when something goes wrong.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            raise"},{"line_number":182,"context_line":"    except pvm_exc.Error:"},{"line_number":183,"context_line":"        # Attempting to close vterm did not help so raise exception"},{"line_number":184,"context_line":"        LOG.error(_LE(\u0027Virtual machine delete failed: LPARID\u003d%s\u0027), lpar_uuid)"},{"line_number":185,"context_line":"        raise"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_49036b10","line":184,"updated":"2017-04-07 19:18:06.000000000","message":"Log the actual error message.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            raise"},{"line_number":182,"context_line":"    except pvm_exc.Error:"},{"line_number":183,"context_line":"        # Attempting to close vterm did not help so raise exception"},{"line_number":184,"context_line":"        LOG.error(_LE(\u0027Virtual machine delete failed: LPARID\u003d%s\u0027), lpar_uuid)"},{"line_number":185,"context_line":"        raise"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_7d24495e","line":184,"in_reply_to":"bff0334d_49036b10","updated":"2017-04-11 21:57:00.000000000","message":"ditto","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        raise"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"def crt_lpar(adapter, host_w, instance):"},{"line_number":189,"context_line":"    \"\"\"Create an LPAR based on the host based on the instance."},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    :param adapter: The adapter for the pypowervm API."}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_a989d7ca","line":188,"range":{"start_line":188,"start_character":4,"end_line":188,"end_character":7},"updated":"2017-04-07 19:18:06.000000000","message":"This isn\u0027t AS400 or AIX, you can use more than 8 characters you know. How about calling this create_lpar?","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        raise"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"def crt_lpar(adapter, host_w, instance):"},{"line_number":189,"context_line":"    \"\"\"Create an LPAR based on the host based on the instance."},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    :param adapter: The adapter for the pypowervm API."}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_3d1a4116","line":188,"range":{"start_line":188,"start_character":4,"end_line":188,"end_character":7},"in_reply_to":"bff0334d_41baec6d","updated":"2017-04-11 21:57:00.000000000","message":"Done","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":8190,"name":"Drew Thorstensen (thorst)","email":"thorst@us.ibm.com","username":"thorst"},"change_message_id":"e1e289cd6577472ac339e5db15739fbcc0ec95fd","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        raise"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"def crt_lpar(adapter, host_w, instance):"},{"line_number":189,"context_line":"    \"\"\"Create an LPAR based on the host based on the instance."},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    :param adapter: The adapter for the pypowervm API."}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_41baec6d","line":188,"range":{"start_line":188,"start_character":4,"end_line":188,"end_character":7},"in_reply_to":"bff0334d_a989d7ca","updated":"2017-04-10 20:08:06.000000000","message":":-)","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    except pvm_exc.HttpError as he:"},{"line_number":209,"context_line":"        # Raise the API exception"},{"line_number":210,"context_line":"        LOG.exception(he)"},{"line_number":211,"context_line":"        raise exc.PowerVMAPIFailed(inst_name\u003dinstance.name, reason\u003dhe)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"def _translate_vm_state(pvm_state):"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_294dc799","line":211,"updated":"2017-04-07 19:18:06.000000000","message":"This is going to trigger a reschedule right? Are we actually going to pick another host where this might work?","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":8190,"name":"Drew Thorstensen (thorst)","email":"thorst@us.ibm.com","username":"thorst"},"change_message_id":"e1e289cd6577472ac339e5db15739fbcc0ec95fd","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    except pvm_exc.HttpError as he:"},{"line_number":209,"context_line":"        # Raise the API exception"},{"line_number":210,"context_line":"        LOG.exception(he)"},{"line_number":211,"context_line":"        raise exc.PowerVMAPIFailed(inst_name\u003dinstance.name, reason\u003dhe)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"def _translate_vm_state(pvm_state):"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_413d4cdb","line":211,"in_reply_to":"bff0334d_294dc799","updated":"2017-04-10 20:08:06.000000000","message":"If they have the overcommit ratios wrong it could run out of resources.  But I suspect that\u0027s a scheduler concern.\n\nI agree, this could probably just be terminal.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    except pvm_exc.HttpError as he:"},{"line_number":209,"context_line":"        # Raise the API exception"},{"line_number":210,"context_line":"        LOG.exception(he)"},{"line_number":211,"context_line":"        raise exc.PowerVMAPIFailed(inst_name\u003dinstance.name, reason\u003dhe)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"def _translate_vm_state(pvm_state):"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_5d250508","line":211,"in_reply_to":"bff0334d_413d4cdb","updated":"2017-04-11 21:57:00.000000000","message":"The API failure could have any number of causes.  Some of those causes might be transient (e.g. the notorious VIOS_BUSY).  Many will be host-specific (e.g. the notorious VIOS_BUSY).  So we _should_ try to reschedule, shouldn\u0027t we?","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":215,"context_line":"    \"\"\"Find the current state of the lpar."},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    :return: The appropriate integer state value from power_state, converted"},{"line_number":218,"context_line":"             from the PowerVM stat."},{"line_number":219,"context_line":"    \"\"\""},{"line_number":220,"context_line":"    if pvm_state is None:"},{"line_number":221,"context_line":"        return power_state.NOSTATE"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_09f4435a","line":218,"range":{"start_line":218,"start_character":30,"end_line":218,"end_character":34},"updated":"2017-04-07 19:18:06.000000000","message":"state","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":215,"context_line":"    \"\"\"Find the current state of the lpar."},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    :return: The appropriate integer state value from power_state, converted"},{"line_number":218,"context_line":"             from the PowerVM stat."},{"line_number":219,"context_line":"    \"\"\""},{"line_number":220,"context_line":"    if pvm_state is None:"},{"line_number":221,"context_line":"        return power_state.NOSTATE"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_9ddeed3b","line":218,"range":{"start_line":218,"start_character":30,"end_line":218,"end_character":34},"in_reply_to":"bff0334d_09f4435a","updated":"2017-04-11 21:57:00.000000000","message":"Done","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":240,"context_line":"    kwds \u003d dict(root_id\u003dlpar_uuid, suffix_type\u003d\u0027quick\u0027, suffix_parm\u003dqprop)"},{"line_number":241,"context_line":"    if not log_errors:"},{"line_number":242,"context_line":"        # Remove the log helper from the list of helpers"},{"line_number":243,"context_line":"        helpers \u003d adapter.helpers"},{"line_number":244,"context_line":"        try:"},{"line_number":245,"context_line":"            helpers.remove(pvm_log.log_helper)"},{"line_number":246,"context_line":"        except ValueError:"},{"line_number":247,"context_line":"            # It\u0027s not an error if we didn\u0027t find it."},{"line_number":248,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_8f3cd3bf","line":245,"range":{"start_line":243,"start_character":8,"end_line":245,"end_character":26},"updated":"2017-04-07 19:18:06.000000000","message":"Is it wise to be modifying the helpers on the adapter globally? In other words, you\u0027re mutating the state of this adapter thing but maybe another operation using this wants to log errors, but now they can\u0027t.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":240,"context_line":"    kwds \u003d dict(root_id\u003dlpar_uuid, suffix_type\u003d\u0027quick\u0027, suffix_parm\u003dqprop)"},{"line_number":241,"context_line":"    if not log_errors:"},{"line_number":242,"context_line":"        # Remove the log helper from the list of helpers"},{"line_number":243,"context_line":"        helpers \u003d adapter.helpers"},{"line_number":244,"context_line":"        try:"},{"line_number":245,"context_line":"            helpers.remove(pvm_log.log_helper)"},{"line_number":246,"context_line":"        except ValueError:"},{"line_number":247,"context_line":"            # It\u0027s not an error if we didn\u0027t find it."},{"line_number":248,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_ddcc7536","line":245,"range":{"start_line":243,"start_character":8,"end_line":245,"end_character":26},"in_reply_to":"bff0334d_53051f10","updated":"2017-04-11 21:57:00.000000000","message":"Done","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":8190,"name":"Drew Thorstensen (thorst)","email":"thorst@us.ibm.com","username":"thorst"},"change_message_id":"e1e289cd6577472ac339e5db15739fbcc0ec95fd","unresolved":false,"context_lines":[{"line_number":240,"context_line":"    kwds \u003d dict(root_id\u003dlpar_uuid, suffix_type\u003d\u0027quick\u0027, suffix_parm\u003dqprop)"},{"line_number":241,"context_line":"    if not log_errors:"},{"line_number":242,"context_line":"        # Remove the log helper from the list of helpers"},{"line_number":243,"context_line":"        helpers \u003d adapter.helpers"},{"line_number":244,"context_line":"        try:"},{"line_number":245,"context_line":"            helpers.remove(pvm_log.log_helper)"},{"line_number":246,"context_line":"        except ValueError:"},{"line_number":247,"context_line":"            # It\u0027s not an error if we didn\u0027t find it."},{"line_number":248,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_53051f10","line":245,"range":{"start_line":243,"start_character":8,"end_line":245,"end_character":26},"in_reply_to":"bff0334d_8f3cd3bf","updated":"2017-04-10 20:08:06.000000000","message":"I never liked this part of the api.\n\nadapters.helpers returns a copy of the helpers.  I think a comment to show this silliness is a good idea.  But that\u0027s why it\u0027s passed into the kwds...","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":273,"context_line":""},{"line_number":274,"context_line":"        :param inst: the VM instance"},{"line_number":275,"context_line":"        \"\"\""},{"line_number":276,"context_line":"        attrs \u003d {"},{"line_number":277,"context_line":"            lpar_bldr.NAME: pvm_u.sanitize_partition_name_for_api(inst.name),"},{"line_number":278,"context_line":"            lpar_bldr.UUID: pvm_uuid.convert_uuid_to_pvm(inst.uuid),"},{"line_number":279,"context_line":"            lpar_bldr.MEM: inst.flavor.memory_mb,"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_29638744","line":276,"updated":"2017-04-07 19:18:06.000000000","message":"No disk?","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":273,"context_line":""},{"line_number":274,"context_line":"        :param inst: the VM instance"},{"line_number":275,"context_line":"        \"\"\""},{"line_number":276,"context_line":"        attrs \u003d {"},{"line_number":277,"context_line":"            lpar_bldr.NAME: pvm_u.sanitize_partition_name_for_api(inst.name),"},{"line_number":278,"context_line":"            lpar_bldr.UUID: pvm_uuid.convert_uuid_to_pvm(inst.uuid),"},{"line_number":279,"context_line":"            lpar_bldr.MEM: inst.flavor.memory_mb,"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_3d9121f2","line":276,"in_reply_to":"bff0334d_29638744","updated":"2017-04-11 21:57:00.000000000","message":"Nope, disks are not \"part\" of the LPAR, which is just a shell with CPU and memory.  They\u0027re created separately and mapped to the (previously-created) LPAR.  E.g. see the change set supporting SSP disks: https://review.openstack.org/#/c/443189/18/nova/virt/powervm/driver.py@185","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        :param inst: the VM instance"},{"line_number":275,"context_line":"        \"\"\""},{"line_number":276,"context_line":"        attrs \u003d {"},{"line_number":277,"context_line":"            lpar_bldr.NAME: pvm_u.sanitize_partition_name_for_api(inst.name),"},{"line_number":278,"context_line":"            lpar_bldr.UUID: pvm_uuid.convert_uuid_to_pvm(inst.uuid),"},{"line_number":279,"context_line":"            lpar_bldr.MEM: inst.flavor.memory_mb,"},{"line_number":280,"context_line":"            lpar_bldr.VCPU: inst.flavor.vcpus}"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_e9835fcb","line":277,"range":{"start_line":277,"start_character":66,"end_line":277,"end_character":75},"updated":"2017-04-07 19:18:06.000000000","message":"Just making sure but you realize this is the non-display name that doesn\u0027t change right?","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        :param inst: the VM instance"},{"line_number":275,"context_line":"        \"\"\""},{"line_number":276,"context_line":"        attrs \u003d {"},{"line_number":277,"context_line":"            lpar_bldr.NAME: pvm_u.sanitize_partition_name_for_api(inst.name),"},{"line_number":278,"context_line":"            lpar_bldr.UUID: pvm_uuid.convert_uuid_to_pvm(inst.uuid),"},{"line_number":279,"context_line":"            lpar_bldr.MEM: inst.flavor.memory_mb,"},{"line_number":280,"context_line":"            lpar_bldr.VCPU: inst.flavor.vcpus}"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_9db94d7a","line":277,"range":{"start_line":277,"start_character":66,"end_line":277,"end_character":75},"in_reply_to":"bff0334d_e9835fcb","updated":"2017-04-11 21:57:00.000000000","message":"Yeah, I\u0027m pretty sure that\u0027s what we want.  We need to be able to map something immutable to the PowerVM LPAR name later on.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        \"\"\""},{"line_number":276,"context_line":"        attrs \u003d {"},{"line_number":277,"context_line":"            lpar_bldr.NAME: pvm_u.sanitize_partition_name_for_api(inst.name),"},{"line_number":278,"context_line":"            lpar_bldr.UUID: pvm_uuid.convert_uuid_to_pvm(inst.uuid),"},{"line_number":279,"context_line":"            lpar_bldr.MEM: inst.flavor.memory_mb,"},{"line_number":280,"context_line":"            lpar_bldr.VCPU: inst.flavor.vcpus}"},{"line_number":281,"context_line":"        # TODO(efried): Loop through the extra specs and process powervm keys"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_8c72a1e2","line":278,"range":{"start_line":278,"start_character":28,"end_line":278,"end_character":56},"updated":"2017-04-07 19:18:06.000000000","message":"You have a utility function for this above.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        \"\"\""},{"line_number":276,"context_line":"        attrs \u003d {"},{"line_number":277,"context_line":"            lpar_bldr.NAME: pvm_u.sanitize_partition_name_for_api(inst.name),"},{"line_number":278,"context_line":"            lpar_bldr.UUID: pvm_uuid.convert_uuid_to_pvm(inst.uuid),"},{"line_number":279,"context_line":"            lpar_bldr.MEM: inst.flavor.memory_mb,"},{"line_number":280,"context_line":"            lpar_bldr.VCPU: inst.flavor.vcpus}"},{"line_number":281,"context_line":"        # TODO(efried): Loop through the extra specs and process powervm keys"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_dd1fd569","line":278,"range":{"start_line":278,"start_character":28,"end_line":278,"end_character":56},"in_reply_to":"bff0334d_8c72a1e2","updated":"2017-04-11 21:57:00.000000000","message":"Good catch.  In fact, this seems to belie my earlier assertion that it needs to be uppercase.  Perhaps PUTs accept lowercase, but GETs and/or POSTs need uppercase?  Not gonna think about it too hard.  Fixed.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c678b1c41b6bd8e677f36d688380ad2fef49bb2","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        if self._state is not None:"},{"line_number":306,"context_line":"            return self._state"},{"line_number":307,"context_line":"        # otherwise, fetch the value now"},{"line_number":308,"context_line":"        pvm_state \u003d get_vm_qp(self._adapter, self._uuid, \u0027PartitionState\u0027)"},{"line_number":309,"context_line":"        self._state \u003d _translate_vm_state(pvm_state)"},{"line_number":310,"context_line":"        return self._state"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_a9cc376a","line":308,"range":{"start_line":308,"start_character":57,"end_line":308,"end_character":73},"updated":"2017-04-07 19:18:06.000000000","message":"Might not be bad to define constants.","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"25cf4e9ff54ea2e2e12c57652f309abacfff2dc6","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        if self._state is not None:"},{"line_number":306,"context_line":"            return self._state"},{"line_number":307,"context_line":"        # otherwise, fetch the value now"},{"line_number":308,"context_line":"        pvm_state \u003d get_vm_qp(self._adapter, self._uuid, \u0027PartitionState\u0027)"},{"line_number":309,"context_line":"        self._state \u003d _translate_vm_state(pvm_state)"},{"line_number":310,"context_line":"        return self._state"}],"source_content_type":"text/x-python","patch_set":10,"id":"bff0334d_202fb888","line":308,"range":{"start_line":308,"start_character":57,"end_line":308,"end_character":73},"in_reply_to":"bff0334d_a9cc376a","updated":"2017-04-11 21:57:00.000000000","message":"Done.  (Would\u0027ve been neat to use the const from pypowervm, but alas, it\u0027s private.)","commit_id":"9dcd65b687f96b155614c24fb015e573b56c8cf5"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":31,"context_line":"from nova import conf"},{"line_number":32,"context_line":"from nova import exception as exc"},{"line_number":33,"context_line":"from nova.virt import hardware"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":36,"context_line":"CONF \u003d conf.CONF"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_afc2ba32","line":34,"updated":"2017-04-20 16:41:54.000000000","message":"need 2 blank lines after the last import, see https://docs.openstack.org/developer/hacking/#import-order-template (and I think also pep8)","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":31,"context_line":"from nova import conf"},{"line_number":32,"context_line":"from nova import exception as exc"},{"line_number":33,"context_line":"from nova.virt import hardware"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":36,"context_line":"CONF \u003d conf.CONF"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_a37bee78","line":34,"in_reply_to":"7ffa3b31_afc2ba32","updated":"2017-04-20 20:18:27.000000000","message":"Done.  (pep8 only cares about two blanks before a global class/method def.)","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":36,"context_line":"CONF \u003d conf.CONF"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"POWERVM_STARTABLE_STATE \u003d (pvm_bp.LPARState.NOT_ACTIVATED, )"},{"line_number":39,"context_line":"POWERVM_STOPABLE_STATE \u003d ("},{"line_number":40,"context_line":"    pvm_bp.LPARState.RUNNING, pvm_bp.LPARState.STARTING,"},{"line_number":41,"context_line":"    pvm_bp.LPARState.OPEN_FIRMWARE, pvm_bp.LPARState.SHUTTING_DOWN,"},{"line_number":42,"context_line":"    pvm_bp.LPARState.ERROR, pvm_bp.LPARState.RESUMING,"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_b219017b","line":39,"range":{"start_line":39,"start_character":0,"end_line":39,"end_character":22},"updated":"2017-04-20 16:41:54.000000000","message":"spelling nit: s/STOPABLE/STOPPABLE/","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":36,"context_line":"CONF \u003d conf.CONF"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"POWERVM_STARTABLE_STATE \u003d (pvm_bp.LPARState.NOT_ACTIVATED, )"},{"line_number":39,"context_line":"POWERVM_STOPABLE_STATE \u003d ("},{"line_number":40,"context_line":"    pvm_bp.LPARState.RUNNING, pvm_bp.LPARState.STARTING,"},{"line_number":41,"context_line":"    pvm_bp.LPARState.OPEN_FIRMWARE, pvm_bp.LPARState.SHUTTING_DOWN,"},{"line_number":42,"context_line":"    pvm_bp.LPARState.ERROR, pvm_bp.LPARState.RESUMING,"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_8380f247","line":39,"range":{"start_line":39,"start_character":0,"end_line":39,"end_character":22},"in_reply_to":"7ffa3b31_b219017b","updated":"2017-04-20 20:18:27.000000000","message":"Done.  Also made these suckers private.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    return [x.name for x in pvm_lpar.LPAR.search(adp, is_mgmt_partition\u003dFalse)]"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"def get_pvm_uuid(instance):"},{"line_number":76,"context_line":"    \"\"\"Get the corresponding PowerVM VM uuid of an instance uuid."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    Maps a OpenStack instance uuid to a PowerVM uuid.  The UUID between the"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_72ea590f","line":75,"range":{"start_line":75,"start_character":4,"end_line":75,"end_character":16},"updated":"2017-04-20 16:41:54.000000000","message":"I think we can prepend an underscore to this method name so it\u0027s not public, once we make the change I mentioned in the other file.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    return [x.name for x in pvm_lpar.LPAR.search(adp, is_mgmt_partition\u003dFalse)]"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"def get_pvm_uuid(instance):"},{"line_number":76,"context_line":"    \"\"\"Get the corresponding PowerVM VM uuid of an instance uuid."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    Maps a OpenStack instance uuid to a PowerVM uuid.  The UUID between the"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_a3f08efe","line":75,"range":{"start_line":75,"start_character":4,"end_line":75,"end_character":16},"in_reply_to":"7ffa3b31_72ea590f","updated":"2017-04-20 20:18:27.000000000","message":"Well, if you look at the OOT driver code, this gets used from lots of places that wouldn\u0027t be as easy to hide (because the resulting LPAR UUID gets passed into pypowervm methods).  I could make it private now, but as we port that code over, it would have to be made public again.  So I\u0027d like to leave it.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    :param instance: nova.objects.instance.Instance."},{"line_number":84,"context_line":"    :return: The PowerVM UUID for the LPAR corresponding to the instance."},{"line_number":85,"context_line":"    \"\"\""},{"line_number":86,"context_line":"    return pvm_uuid.convert_uuid_to_pvm(instance.uuid).upper()"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def get_instance_wrapper(adapter, instance):"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_b2bc6106","line":86,"updated":"2017-04-20 16:41:54.000000000","message":"if this is just one line, and in some places we need upper() and some places we may not, should we just do this inline where it\u0027s needed and get rid of this utility method?","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    :param instance: nova.objects.instance.Instance."},{"line_number":84,"context_line":"    :return: The PowerVM UUID for the LPAR corresponding to the instance."},{"line_number":85,"context_line":"    \"\"\""},{"line_number":86,"context_line":"    return pvm_uuid.convert_uuid_to_pvm(instance.uuid).upper()"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def get_instance_wrapper(adapter, instance):"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_83dfd238","line":86,"in_reply_to":"7ffa3b31_b2bc6106","updated":"2017-04-20 20:18:27.000000000","message":"We always need upper().\n\nI\u0027ve considered changing it to inline pretty much every time I\u0027ve looked at this.  But I\u0027ve always concluded that I\u0027d rather a) hide it as much as possible for the sake of reviewers and maintainability, and b) save the extra 20c per call (a quarter of a pep8-compliant line).","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    return pvm_uuid.convert_uuid_to_pvm(instance.uuid).upper()"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def get_instance_wrapper(adapter, instance):"},{"line_number":90,"context_line":"    \"\"\"Get the LPAR wrapper for a given Nova instance."},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    :param adapter: The adapter for the pypowervm API"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_6f2f123f","line":89,"range":{"start_line":89,"start_character":4,"end_line":89,"end_character":24},"updated":"2017-04-20 16:41:54.000000000","message":"does this need to be public, or should we prepend an underscore and make it _get_instance_wrapper?","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    return pvm_uuid.convert_uuid_to_pvm(instance.uuid).upper()"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def get_instance_wrapper(adapter, instance):"},{"line_number":90,"context_line":"    \"\"\"Get the LPAR wrapper for a given Nova instance."},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    :param adapter: The adapter for the pypowervm API"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_23eebeec","line":89,"range":{"start_line":89,"start_character":4,"end_line":89,"end_character":24},"in_reply_to":"7ffa3b31_6f2f123f","updated":"2017-04-20 20:18:27.000000000","message":"Same answer as for get_pvm_uuid.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    try:"},{"line_number":98,"context_line":"        return pvm_lpar.LPAR.get(adapter, uuid\u003dpvm_inst_uuid)"},{"line_number":99,"context_line":"    except pvm_exc.Error as e:"},{"line_number":100,"context_line":"        LOG.exception(e)"},{"line_number":101,"context_line":"        if e.response is not None and e.response.status \u003d\u003d 404:"},{"line_number":102,"context_line":"            raise exc.InstanceNotFound(instance_id\u003dpvm_inst_uuid)"},{"line_number":103,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_722ff93e","line":100,"updated":"2017-04-20 16:41:54.000000000","message":"another example of what Sean mentioned about misusing LOG.exception, but more importantly I don\u0027t think you need/want to log the full stacktrace in the 404 case... maybe in the else statement below, or maybe not even there since it re-raises and you could probably expect whoever catches it later to log it.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    try:"},{"line_number":98,"context_line":"        return pvm_lpar.LPAR.get(adapter, uuid\u003dpvm_inst_uuid)"},{"line_number":99,"context_line":"    except pvm_exc.Error as e:"},{"line_number":100,"context_line":"        LOG.exception(e)"},{"line_number":101,"context_line":"        if e.response is not None and e.response.status \u003d\u003d 404:"},{"line_number":102,"context_line":"            raise exc.InstanceNotFound(instance_id\u003dpvm_inst_uuid)"},{"line_number":103,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_e3bd76d8","line":100,"in_reply_to":"7ffa3b31_722ff93e","updated":"2017-04-20 20:18:27.000000000","message":"Fixed in PS13.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        if e.response is not None and e.response.status \u003d\u003d 404:"},{"line_number":102,"context_line":"            raise exc.InstanceNotFound(instance_id\u003dpvm_inst_uuid)"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            raise"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"def power_on(adapter, instance):"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_f2cc296b","line":104,"range":{"start_line":104,"start_character":12,"end_line":104,"end_character":17},"updated":"2017-04-20 16:41:54.000000000","message":"don\u0027t we need to use oslo_utils.excutils.save_and_reraise_exception?","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        if e.response is not None and e.response.status \u003d\u003d 404:"},{"line_number":102,"context_line":"            raise exc.InstanceNotFound(instance_id\u003dpvm_inst_uuid)"},{"line_number":103,"context_line":"        else:"},{"line_number":104,"context_line":"            raise"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"def power_on(adapter, instance):"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_03a742a9","line":104,"range":{"start_line":104,"start_character":12,"end_line":104,"end_character":17},"in_reply_to":"7ffa3b31_f2cc296b","updated":"2017-04-20 20:18:27.000000000","message":"\"need\"?  Probably not.  In this case, I think it would be more trouble than it\u0027s worth.  We need it if the intervening steps might clear the exception context.  I feel pretty good about LOG.exception, the various attr accesses, and the \u003d\u003d not doing that.  @thorst, thoughts?\n\n[Later] Per IRC, okay, gonna do this throughout.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"0cb42bc5aadc67f585648e61bfa3619c6304f414","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        if entry.state in POWERVM_STARTABLE_STATE:"},{"line_number":119,"context_line":"            # Now start the lpar"},{"line_number":120,"context_line":"            try:"},{"line_number":121,"context_line":"                power.power_on(entry, None)"},{"line_number":122,"context_line":"            except Exception as e:"},{"line_number":123,"context_line":"                LOG.exception(e)"},{"line_number":124,"context_line":"                raise exc.InstancePowerOnFailure(reason\u003dsix.text_type(e))"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_39e4bcdf","line":121,"updated":"2017-04-20 15:02:28.000000000","message":"is this a synchronous call?","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"52e0e8717a7b9eb19b06cf916ee14fd1c363733b","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        if entry.state in POWERVM_STARTABLE_STATE:"},{"line_number":119,"context_line":"            # Now start the lpar"},{"line_number":120,"context_line":"            try:"},{"line_number":121,"context_line":"                power.power_on(entry, None)"},{"line_number":122,"context_line":"            except Exception as e:"},{"line_number":123,"context_line":"                LOG.exception(e)"},{"line_number":124,"context_line":"                raise exc.InstancePowerOnFailure(reason\u003dsix.text_type(e))"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_bcb55a34","line":121,"in_reply_to":"7ffa3b31_39e4bcdf","updated":"2017-04-20 15:27:29.000000000","message":"Yes, in the sense that it returns only when (if) PHYP thinks the VM is active.  Does _not_ mean the VM booted all the way up yet.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f8909c970ac35b08b242d45d136ae1de6d8a35f5","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            # Now start the lpar"},{"line_number":120,"context_line":"            try:"},{"line_number":121,"context_line":"                power.power_on(entry, None)"},{"line_number":122,"context_line":"            except Exception as e:"},{"line_number":123,"context_line":"                LOG.exception(e)"},{"line_number":124,"context_line":"                raise exc.InstancePowerOnFailure(reason\u003dsix.text_type(e))"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_7c00f201","line":122,"range":{"start_line":122,"start_character":19,"end_line":122,"end_character":28},"updated":"2017-04-20 15:13:17.000000000","message":"Can we use something not as broad as Exception, like a base exception type from the pypowervm library maybe? Like pvm_exc.Error?","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a49ce37d8de863a0137bbcae3deddf1ea35c216e","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            # Now start the lpar"},{"line_number":120,"context_line":"            try:"},{"line_number":121,"context_line":"                power.power_on(entry, None)"},{"line_number":122,"context_line":"            except Exception as e:"},{"line_number":123,"context_line":"                LOG.exception(e)"},{"line_number":124,"context_line":"                raise exc.InstancePowerOnFailure(reason\u003dsix.text_type(e))"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_8f7a5eb7","line":122,"range":{"start_line":122,"start_character":19,"end_line":122,"end_character":28},"in_reply_to":"7ffa3b31_5c52d63c","updated":"2017-04-20 16:09:34.000000000","message":"Done","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"52e0e8717a7b9eb19b06cf916ee14fd1c363733b","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            # Now start the lpar"},{"line_number":120,"context_line":"            try:"},{"line_number":121,"context_line":"                power.power_on(entry, None)"},{"line_number":122,"context_line":"            except Exception as e:"},{"line_number":123,"context_line":"                LOG.exception(e)"},{"line_number":124,"context_line":"                raise exc.InstancePowerOnFailure(reason\u003dsix.text_type(e))"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_fccc026b","line":122,"range":{"start_line":122,"start_character":19,"end_line":122,"end_character":28},"in_reply_to":"7ffa3b31_7c00f201","updated":"2017-04-20 15:27:29.000000000","message":"That *should* be possible.  Will look into it.  I mean, I think we were trying to account for unhandled horribleness like ValueError as well as known API errors - but since those are definitely bugs, they should arguably raise in a way not as \"graceful\" as InstancePowerOnFailure.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"abaafa54b5a4fa40387511091058544fc755b178","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            # Now start the lpar"},{"line_number":120,"context_line":"            try:"},{"line_number":121,"context_line":"                power.power_on(entry, None)"},{"line_number":122,"context_line":"            except Exception as e:"},{"line_number":123,"context_line":"                LOG.exception(e)"},{"line_number":124,"context_line":"                raise exc.InstancePowerOnFailure(reason\u003dsix.text_type(e))"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_5c52d63c","line":122,"range":{"start_line":122,"start_character":19,"end_line":122,"end_character":28},"in_reply_to":"7ffa3b31_fccc026b","updated":"2017-04-20 15:29:44.000000000","message":"Right, exactly, we don\u0027t want to mask ValueError or AttributeError.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14ecae74e10f664db740d6000bd17bfdb514134f","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                force_flag \u003d (power.Force.TRUE if force_immediate"},{"line_number":150,"context_line":"                              else power.Force.ON_FAILURE)"},{"line_number":151,"context_line":"                power.power_off(entry, None, force_immediate\u003dforce_flag)"},{"line_number":152,"context_line":"            except Exception as e:"},{"line_number":153,"context_line":"                LOG.exception(e)"},{"line_number":154,"context_line":"                raise exc.InstancePowerOffFailure(reason\u003dsix.text_type(e))"},{"line_number":155,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_fcaf62e0","line":152,"updated":"2017-04-20 15:14:21.000000000","message":"Same here.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a49ce37d8de863a0137bbcae3deddf1ea35c216e","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                force_flag \u003d (power.Force.TRUE if force_immediate"},{"line_number":150,"context_line":"                              else power.Force.ON_FAILURE)"},{"line_number":151,"context_line":"                power.power_off(entry, None, force_immediate\u003dforce_flag)"},{"line_number":152,"context_line":"            except Exception as e:"},{"line_number":153,"context_line":"                LOG.exception(e)"},{"line_number":154,"context_line":"                raise exc.InstancePowerOffFailure(reason\u003dsix.text_type(e))"},{"line_number":155,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_6f4dd298","line":152,"in_reply_to":"7ffa3b31_fcaf62e0","updated":"2017-04-20 16:09:34.000000000","message":"Done","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"8a3397b904f8e67865bc47ed471b96ccdbdfb678","unresolved":false,"context_lines":[{"line_number":150,"context_line":"                              else power.Force.ON_FAILURE)"},{"line_number":151,"context_line":"                power.power_off(entry, None, force_immediate\u003dforce_flag)"},{"line_number":152,"context_line":"            except Exception as e:"},{"line_number":153,"context_line":"                LOG.exception(e)"},{"line_number":154,"context_line":"                raise exc.InstancePowerOffFailure(reason\u003dsix.text_type(e))"},{"line_number":155,"context_line":"        else:"},{"line_number":156,"context_line":"            LOG.debug(\"Power off not required for instance %(inst)s.\","}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_7cd47220","line":153,"range":{"start_line":153,"start_character":16,"end_line":153,"end_character":32},"updated":"2017-04-20 15:19:10.000000000","message":"LOG.exception is meant to be used with a descriptive string:\n\nLOG.exception(\"This kind of thing happened\"), it automatically *also* logs the exception with full stack trace.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a49ce37d8de863a0137bbcae3deddf1ea35c216e","unresolved":false,"context_lines":[{"line_number":150,"context_line":"                              else power.Force.ON_FAILURE)"},{"line_number":151,"context_line":"                power.power_off(entry, None, force_immediate\u003dforce_flag)"},{"line_number":152,"context_line":"            except Exception as e:"},{"line_number":153,"context_line":"                LOG.exception(e)"},{"line_number":154,"context_line":"                raise exc.InstancePowerOffFailure(reason\u003dsix.text_type(e))"},{"line_number":155,"context_line":"        else:"},{"line_number":156,"context_line":"            LOG.debug(\"Power off not required for instance %(inst)s.\","}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_4f52163d","line":153,"range":{"start_line":153,"start_character":16,"end_line":153,"end_character":32},"in_reply_to":"7ffa3b31_1c37ae4f","updated":"2017-04-20 16:09:34.000000000","message":"Done","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"52e0e8717a7b9eb19b06cf916ee14fd1c363733b","unresolved":false,"context_lines":[{"line_number":150,"context_line":"                              else power.Force.ON_FAILURE)"},{"line_number":151,"context_line":"                power.power_off(entry, None, force_immediate\u003dforce_flag)"},{"line_number":152,"context_line":"            except Exception as e:"},{"line_number":153,"context_line":"                LOG.exception(e)"},{"line_number":154,"context_line":"                raise exc.InstancePowerOffFailure(reason\u003dsix.text_type(e))"},{"line_number":155,"context_line":"        else:"},{"line_number":156,"context_line":"            LOG.debug(\"Power off not required for instance %(inst)s.\","}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_1c37ae4f","line":153,"range":{"start_line":153,"start_character":16,"end_line":153,"end_character":32},"in_reply_to":"7ffa3b31_5cbe56b4","updated":"2017-04-20 15:27:29.000000000","message":"Ah, got it, will fix.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"682f2241d22b084a294fe4218c9d59ed870a296e","unresolved":false,"context_lines":[{"line_number":150,"context_line":"                              else power.Force.ON_FAILURE)"},{"line_number":151,"context_line":"                power.power_off(entry, None, force_immediate\u003dforce_flag)"},{"line_number":152,"context_line":"            except Exception as e:"},{"line_number":153,"context_line":"                LOG.exception(e)"},{"line_number":154,"context_line":"                raise exc.InstancePowerOffFailure(reason\u003dsix.text_type(e))"},{"line_number":155,"context_line":"        else:"},{"line_number":156,"context_line":"            LOG.debug(\"Power off not required for instance %(inst)s.\","}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_5cbe56b4","line":153,"range":{"start_line":153,"start_character":16,"end_line":153,"end_character":32},"in_reply_to":"7ffa3b31_7cd47220","updated":"2017-04-20 15:22:13.000000000","message":"So...\n\nLOG.exception(\"Unable to power off instance\", instance\u003dinstance)","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        if e.response and e.response.status \u003d\u003d 404:"},{"line_number":178,"context_line":"            LOG.info(\u0027Virtual Machine not found LPAR_ID: %s\u0027, lpar_uuid)"},{"line_number":179,"context_line":"        else:"},{"line_number":180,"context_line":"            LOG.error(\u0027HttpError deleting virtual machine. LPARID: %s\u0027,"},{"line_number":181,"context_line":"                      lpar_uuid)"},{"line_number":182,"context_line":"            raise"},{"line_number":183,"context_line":"    except pvm_exc.Error:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_6d527a3d","line":180,"updated":"2017-04-20 16:41:54.000000000","message":"I\u0027m not sure the log message really helps anyone. You\u0027re reraising the exception, so presumably that will result in a more useful log message from whatever handles that later.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        if e.response and e.response.status \u003d\u003d 404:"},{"line_number":178,"context_line":"            LOG.info(\u0027Virtual Machine not found LPAR_ID: %s\u0027, lpar_uuid)"},{"line_number":179,"context_line":"        else:"},{"line_number":180,"context_line":"            LOG.error(\u0027HttpError deleting virtual machine. LPARID: %s\u0027,"},{"line_number":181,"context_line":"                      lpar_uuid)"},{"line_number":182,"context_line":"            raise"},{"line_number":183,"context_line":"    except pvm_exc.Error:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_c3315a5c","line":180,"in_reply_to":"7ffa3b31_6d527a3d","updated":"2017-04-20 20:18:27.000000000","message":"The HttpErrors can be kind of esoteric, and it wouldn\u0027t necessarily be obvious from reading it that it was related to delete.  If we could be guaranteed that the stack trace would be recorded somewhere up the chain, it would be fine.  And that\u0027s in fact what happens.  But it makes me feel ooky to make that assumption from here.\n\nThat said, I\u0027m going to see whether we can change the method signature to take the instance rather than the lpar_uuid, so we can put that in the logs instead of the LPAR UUID.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        else:"},{"line_number":180,"context_line":"            LOG.error(\u0027HttpError deleting virtual machine. LPARID: %s\u0027,"},{"line_number":181,"context_line":"                      lpar_uuid)"},{"line_number":182,"context_line":"            raise"},{"line_number":183,"context_line":"    except pvm_exc.Error:"},{"line_number":184,"context_line":"        # Attempting to close vterm did not help so raise exception"},{"line_number":185,"context_line":"        LOG.error(\u0027Virtual machine delete failed: LPARID\u003d%s\u0027, lpar_uuid)"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_ada52249","line":182,"range":{"start_line":182,"start_character":12,"end_line":182,"end_character":17},"updated":"2017-04-20 16:41:54.000000000","message":"don\u0027t we need to use oslo_utils.excutils.save_and_reraise_exception?","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        else:"},{"line_number":180,"context_line":"            LOG.error(\u0027HttpError deleting virtual machine. LPARID: %s\u0027,"},{"line_number":181,"context_line":"                      lpar_uuid)"},{"line_number":182,"context_line":"            raise"},{"line_number":183,"context_line":"    except pvm_exc.Error:"},{"line_number":184,"context_line":"        # Attempting to close vterm did not help so raise exception"},{"line_number":185,"context_line":"        LOG.error(\u0027Virtual machine delete failed: LPARID\u003d%s\u0027, lpar_uuid)"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_63cde664","line":182,"range":{"start_line":182,"start_character":12,"end_line":182,"end_character":17},"in_reply_to":"7ffa3b31_ada52249","updated":"2017-04-20 20:18:27.000000000","message":"Same answer as above.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":208,"context_line":"        raise exc.BuildAbortException(instance_uuid\u003dinstance.uuid, reason\u003de)"},{"line_number":209,"context_line":"    except pvm_exc.HttpError as he:"},{"line_number":210,"context_line":"        # Raise the API exception"},{"line_number":211,"context_line":"        LOG.exception(he)"},{"line_number":212,"context_line":"        raise exc.PowerVMAPIFailed(inst_name\u003dinstance.name, reason\u003dhe)"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_0d2656cf","line":211,"updated":"2017-04-20 16:41:54.000000000","message":"another example of what Sean pointed out about LOG.exception usage.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":208,"context_line":"        raise exc.BuildAbortException(instance_uuid\u003dinstance.uuid, reason\u003de)"},{"line_number":209,"context_line":"    except pvm_exc.HttpError as he:"},{"line_number":210,"context_line":"        # Raise the API exception"},{"line_number":211,"context_line":"        LOG.exception(he)"},{"line_number":212,"context_line":"        raise exc.PowerVMAPIFailed(inst_name\u003dinstance.name, reason\u003dhe)"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_c6f60864","line":211,"in_reply_to":"7ffa3b31_0d2656cf","updated":"2017-04-20 20:18:27.000000000","message":"Fixed in PS13","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        return power_state.NOSTATE"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"def get_vm_qp(adapter, lpar_uuid, qprop\u003dNone, log_errors\u003dTrue):"},{"line_number":230,"context_line":"    \"\"\"Returns one or all quick properties of an LPAR."},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    :param adapter: The pypowervm adapter."}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_280b4024","line":229,"range":{"start_line":229,"start_character":4,"end_line":229,"end_character":13},"updated":"2017-04-20 16:41:54.000000000","message":"I think this can be private, i.e. prepend the method name with an underscore, right?","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        return power_state.NOSTATE"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"def get_vm_qp(adapter, lpar_uuid, qprop\u003dNone, log_errors\u003dTrue):"},{"line_number":230,"context_line":"    \"\"\"Returns one or all quick properties of an LPAR."},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    :param adapter: The pypowervm adapter."}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_a6e77cac","line":229,"range":{"start_line":229,"start_character":4,"end_line":229,"end_character":13},"in_reply_to":"7ffa3b31_280b4024","updated":"2017-04-20 20:18:27.000000000","message":"Same answer as above.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":253,"context_line":"    try:"},{"line_number":254,"context_line":"        resp \u003d adapter.read(pvm_lpar.LPAR.schema_type, **kwds)"},{"line_number":255,"context_line":"    except pvm_exc.HttpError as e:"},{"line_number":256,"context_line":"        # 404 error indicates the LPAR has been deleted"},{"line_number":257,"context_line":"        if e.response and e.response.status \u003d\u003d 404:"},{"line_number":258,"context_line":"            raise exc.InstanceNotFound(instance_id\u003dlpar_uuid)"},{"line_number":259,"context_line":"        raise"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_c8e3bc33","line":256,"updated":"2017-04-20 16:41:54.000000000","message":"it would be nice if there was a specific childclass of HttpError for 404s, and you could just expect that and not have to do this kind of check and reraise all over the place.","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":253,"context_line":"    try:"},{"line_number":254,"context_line":"        resp \u003d adapter.read(pvm_lpar.LPAR.schema_type, **kwds)"},{"line_number":255,"context_line":"    except pvm_exc.HttpError as e:"},{"line_number":256,"context_line":"        # 404 error indicates the LPAR has been deleted"},{"line_number":257,"context_line":"        if e.response and e.response.status \u003d\u003d 404:"},{"line_number":258,"context_line":"            raise exc.InstanceNotFound(instance_id\u003dlpar_uuid)"},{"line_number":259,"context_line":"        raise"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_c66968f9","line":256,"in_reply_to":"7ffa3b31_c8e3bc33","updated":"2017-04-20 20:18:27.000000000","message":"That\u0027s a good idea.  Per IRC, please open a launchpad bug under pypowervm and we\u0027ll see if we can make it happen before RC1.\n\n[Later] https://bugs.launchpad.net/pypowervm/+bug/1685016","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"5f6c9e406ccd73f5b3007fda763c7f99e28d56b1","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        # 404 error indicates the LPAR has been deleted"},{"line_number":257,"context_line":"        if e.response and e.response.status \u003d\u003d 404:"},{"line_number":258,"context_line":"            raise exc.InstanceNotFound(instance_id\u003dlpar_uuid)"},{"line_number":259,"context_line":"        raise"},{"line_number":260,"context_line":"    return jsonutils.loads(resp.body)"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_8885b45c","line":259,"range":{"start_line":259,"start_character":8,"end_line":259,"end_character":13},"updated":"2017-04-20 16:41:54.000000000","message":"another place I think you need to use oslo_utils.excutils.save_and_reraise_exception","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4637e0cc8283c6f4b31fb2ef9a76c2e00cb0bd2","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        # 404 error indicates the LPAR has been deleted"},{"line_number":257,"context_line":"        if e.response and e.response.status \u003d\u003d 404:"},{"line_number":258,"context_line":"            raise exc.InstanceNotFound(instance_id\u003dlpar_uuid)"},{"line_number":259,"context_line":"        raise"},{"line_number":260,"context_line":"    return jsonutils.loads(resp.body)"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7ffa3b31_467558ca","line":259,"range":{"start_line":259,"start_character":8,"end_line":259,"end_character":13},"in_reply_to":"7ffa3b31_8885b45c","updated":"2017-04-20 20:18:27.000000000","message":"rgr","commit_id":"c316f6238d636041c540169c67bbdc48e4068d53"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a4dfbbf55361297388d9c3eafad0c494894ed0a2","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            LOG.exception(\"Failed to retrieve LPAR associated with instance.\","},{"line_number":104,"context_line":"                          instance\u003dinstance)"},{"line_number":105,"context_line":"            if e.response is not None and e.response.status \u003d\u003d 404:"},{"line_number":106,"context_line":"                sare.reraise \u003d False"},{"line_number":107,"context_line":"                raise exc.InstanceNotFound(instance_id\u003dpvm_inst_uuid)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7ffa3b31_14753a32","line":106,"range":{"start_line":106,"start_character":16,"end_line":106,"end_character":36},"updated":"2017-04-20 21:11:42.000000000","message":"I\u0027m not sure you need to do this as I think save_and_reraise_exception drops the saved exception if a new one is raised.\n\nhttps://docs.openstack.org/developer/oslo.utils/api/excutils.html#oslo_utils.excutils.save_and_reraise_exception\n\n\"If another exception occurs, the saved exception is logged and the new exception is re-raised.\"\n\n\"If another exception occurs and reraise flag is False, the saved exception will not be logged.\"\n\nSo I guess setting this to False will not log the original exception, which is I guess OK here.","commit_id":"6df654592a9ebc3d3c8915b1e67281a86bb122e9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"754096b7a566d8f835005c6fe35ad99436357728","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            LOG.exception(\"Failed to retrieve LPAR associated with instance.\","},{"line_number":104,"context_line":"                          instance\u003dinstance)"},{"line_number":105,"context_line":"            if e.response is not None and e.response.status \u003d\u003d 404:"},{"line_number":106,"context_line":"                sare.reraise \u003d False"},{"line_number":107,"context_line":"                raise exc.InstanceNotFound(instance_id\u003dpvm_inst_uuid)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7ffa3b31_14a9ba22","line":106,"range":{"start_line":106,"start_character":16,"end_line":106,"end_character":36},"in_reply_to":"7ffa3b31_14753a32","updated":"2017-04-20 21:21:32.000000000","message":"Yeah, we get the stack trace with the LOG.exception above, in a (hopefully) cleaner \u0026 more readable way.","commit_id":"6df654592a9ebc3d3c8915b1e67281a86bb122e9"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"86d360b1aa12f48f26b9b31290f2ddb86a43667a","unresolved":false,"context_lines":[{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    def __init__(self, adapter, instance):"},{"line_number":313,"context_line":"        self._adapter \u003d adapter"},{"line_number":314,"context_line":"        self._uuid \u003d get_pvm_uuid(instance)"},{"line_number":315,"context_line":"        self.id \u003d self._uuid"},{"line_number":316,"context_line":"        self._state \u003d None"},{"line_number":317,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7ffa3b31_0929a399","line":314,"updated":"2017-04-20 20:45:31.000000000","message":"I\u0027m guessing you mean _uuid and id (next line) to be different (one instance.uuid, one from get_pvm_uuid) else why have both?","commit_id":"6df654592a9ebc3d3c8915b1e67281a86bb122e9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"991a5af978b7d61cdd14d311e1bcaab8c51aa13b","unresolved":false,"context_lines":[{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    def __init__(self, adapter, instance):"},{"line_number":313,"context_line":"        self._adapter \u003d adapter"},{"line_number":314,"context_line":"        self._uuid \u003d get_pvm_uuid(instance)"},{"line_number":315,"context_line":"        self.id \u003d self._uuid"},{"line_number":316,"context_line":"        self._state \u003d None"},{"line_number":317,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7ffa3b31_1452dade","line":314,"in_reply_to":"7ffa3b31_0929a399","updated":"2017-04-20 20:59:10.000000000","message":"I looked into this a little bit.\n\nInstanceInfo.id isn\u0027t used anywhere, as far as I can see.\n\nOf all the existing drivers in tree, only libvirt even sets it; and from what I can tell, it sets it to an internal value, not the instance.uuid/.id.  (After all, if the caller needs that, they just use instance.uuid/.id.)\n\nThat said, there\u0027s no reason for us to have two separate attributes holding the same datum.  We could easily consolidate.","commit_id":"6df654592a9ebc3d3c8915b1e67281a86bb122e9"}]}
