)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"bb9eefd2dcee24c1260752a2b6dde2834b425e58","unresolved":false,"context_lines":[{"line_number":10,"context_line":"spec that is not yet merged."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Implements blueprint nova-support-instance-power-update"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I2b292050cc3ce5ef625659f5a1fe56bb76072496"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"bfb3d3c7_619aee6e","line":13,"updated":"2019-05-23 13:38:19.000000000","message":"add ironic side story-board issue number","commit_id":"d45cd33a28a8f6feddf4c7dbb96c47711ce7bf77"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"51c796128e4282fa8f7ea0c157b4dafb97915f6d","unresolved":false,"context_lines":[{"line_number":12,"context_line":"its database. This way nova will not be able to enforce"},{"line_number":13,"context_line":"an incorrect power state on the physical instance during"},{"line_number":14,"context_line":"the periodic \"sync_power_states\" task."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Implements blueprint nova-support-instance-power-update"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I2b292050cc3ce5ef625659f5a1fe56bb76072496"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9fb8cfa7_67fdd76c","line":15,"updated":"2019-06-12 09:30:58.000000000","message":"add the ironic task id","commit_id":"f22275e5feca544d244f5be17803f4a05bddfe77"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":10,"context_line":"through which ironic will convey all (power_off and power_on)"},{"line_number":11,"context_line":"power state changes (running -\u003e shutdown or shutdown -\u003e running"},{"line_number":12,"context_line":"will be the only ones handled by nova and the rest will be ignored)"},{"line_number":13,"context_line":"on a physical instance to nova using which nova will update"},{"line_number":14,"context_line":"its database. This way nova will not be able to enforce"},{"line_number":15,"context_line":"an incorrect power state on the physical instance during"},{"line_number":16,"context_line":"the periodic \"sync_power_states\" task."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7faddb67_edd05d56","line":13,"range":{"start_line":13,"start_character":31,"end_line":13,"end_character":47},"updated":"2019-07-23 16:17:38.000000000","message":"wording needs some help here","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":10,"context_line":"through which ironic will convey all (power_off and power_on)"},{"line_number":11,"context_line":"power state changes (running -\u003e shutdown or shutdown -\u003e running"},{"line_number":12,"context_line":"will be the only ones handled by nova and the rest will be ignored)"},{"line_number":13,"context_line":"on a physical instance to nova using which nova will update"},{"line_number":14,"context_line":"its database. This way nova will not be able to enforce"},{"line_number":15,"context_line":"an incorrect power state on the physical instance during"},{"line_number":16,"context_line":"the periodic \"sync_power_states\" task."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7faddb67_f62b417f","line":13,"range":{"start_line":13,"start_character":31,"end_line":13,"end_character":47},"in_reply_to":"7faddb67_edd05d56","updated":"2019-07-24 11:24:34.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"956ea230247671030252c1589adcdeda2334668f","unresolved":false,"context_lines":[{"line_number":18,"context_line":"Implements blueprint nova-support-instance-power-update"},{"line_number":19,"context_line":"Story: 2004969"},{"line_number":20,"context_line":"Task: 29423"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: I2b292050cc3ce5ef625659f5a1fe56bb76072496"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7faddb67_f00354bd","line":21,"updated":"2019-07-23 16:33:29.000000000","message":"Why doesn\u0027t this depend on the Ironic change?\n\nhttps://review.opendev.org/664842\n\nThat way we can make sure we don\u0027t land this in nova if the ironic change doesn\u0027t land, and also make sure the tag values used in nova are what finally show up in ironic (POWER_OFF and POWER_ON).\n\nThat way we could also make sure that we\u0027re hitting this code in the ironic dsvm CI job that we run on the nova change.\n\n(later)\n\nNevermind, I guess the ironic change depends on the python-novaclient change which depends on this.\n\nDo we at least have a CI run anywhere with all of the pieces combined? That might require some zuul trickery on the ironic side before the python-novaclient change is released and in upper-constraints (ironic\u0027s zuul.yaml would need to add python-novaclient to required-projects before the change is released for zuul to pick up the dependency from source).","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":18,"context_line":"Implements blueprint nova-support-instance-power-update"},{"line_number":19,"context_line":"Story: 2004969"},{"line_number":20,"context_line":"Task: 29423"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: I2b292050cc3ce5ef625659f5a1fe56bb76072496"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7faddb67_4c1881d2","line":21,"in_reply_to":"7faddb67_a1c57e5d","updated":"2019-07-25 15:19:21.000000000","message":"\u003e I did it for you here:\n \u003e \n \u003e https://review.opendev.org/#/c/672327/\n \u003e \n \u003e That at least exposed the nova pieces in ironic not really working\n \u003e as you\u0027d expect I think, but it\u0027s kind of tricky to test this and\n \u003e confirm how it\u0027s working in CI since it\u0027s asynchronous and\n \u003e potentially racy.\n\nthanks Matt! I\u0027ll see if I can improve it to test what we want. :) yea agreed with it being tricky.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b3ff6478f4c51043e79104a2fda2f98cb55e059e","unresolved":false,"context_lines":[{"line_number":18,"context_line":"Implements blueprint nova-support-instance-power-update"},{"line_number":19,"context_line":"Story: 2004969"},{"line_number":20,"context_line":"Task: 29423"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: I2b292050cc3ce5ef625659f5a1fe56bb76072496"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7faddb67_a1c57e5d","line":21,"in_reply_to":"7faddb67_bb3e14d8","updated":"2019-07-24 13:25:55.000000000","message":"\u003e I am afraid I don\u0027t have much knowledge on how to introduce a CI\n \u003e job with all these pieces together. But as discussed in the ironic\n \u003e patch, let me first remove the dependency on the novaclient if that\n \u003e is the commonly agreed way forward. Maybe then I can hack something\n \u003e into the existing ironic-tempest job ? (http://logs.openstack.org/11/645611/7/check/ironic-tempest-ipa-wholedisk-bios-agent_ipmitool-tinyipa/9ac8a59/testr_results.html.gz)\n \u003e although again I am not sure if that is the right place.\n\nI did it for you here:\n\nhttps://review.opendev.org/#/c/672327/\n\nThat at least exposed the nova pieces in ironic not really working as you\u0027d expect I think, but it\u0027s kind of tricky to test this and confirm how it\u0027s working in CI since it\u0027s asynchronous and potentially racy.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":18,"context_line":"Implements blueprint nova-support-instance-power-update"},{"line_number":19,"context_line":"Story: 2004969"},{"line_number":20,"context_line":"Task: 29423"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: I2b292050cc3ce5ef625659f5a1fe56bb76072496"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7faddb67_bb3e14d8","line":21,"in_reply_to":"7faddb67_f00354bd","updated":"2019-07-24 11:24:34.000000000","message":"\u003e (later)\n \u003e \n \u003e Nevermind, I guess the ironic change depends on the\n \u003e python-novaclient change which depends on this.\\\n\nyep.\n\n \u003e \n \u003e Do we at least have a CI run anywhere with all of the pieces\n \u003e combined? That might require some zuul trickery on the ironic side\n \u003e before the python-novaclient change is released and in\n \u003e upper-constraints (ironic\u0027s zuul.yaml would need to add\n \u003e python-novaclient to required-projects before the change is\n \u003e released for zuul to pick up the dependency from source).\n\n\nI am afraid I don\u0027t have much knowledge on how to introduce a CI job with all these pieces together. But as discussed in the ironic patch, let me first remove the dependency on the novaclient if that is the commonly agreed way forward. Maybe then I can hack something into the existing ironic-tempest job ? (http://logs.openstack.org/11/645611/7/check/ironic-tempest-ipa-wholedisk-bios-agent_ipmitool-tinyipa/9ac8a59/testr_results.html.gz) although again I am not sure if that is the right place.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"}],"api-ref/source/parameters.yaml":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e31317cfa045027dca817dc7274eab432457520d","unresolved":false,"context_lines":[{"line_number":2564,"context_line":"  type: string"},{"line_number":2565,"context_line":"event_name:"},{"line_number":2566,"context_line":"  description: |"},{"line_number":2567,"context_line":"    The event name. A valid value is ``network-changed``, ``network-vif-plugged``,"},{"line_number":2568,"context_line":"    ``network-vif-unplugged``, ``network-vif-deleted``, ``volume-extended`` or"},{"line_number":2569,"context_line":"    ``power-update``. The event name ``volume-extended`` is added since"},{"line_number":2570,"context_line":"    microversion ``2.51`` and ``power-update`` is added since microversion ``2.75``."}],"source_content_type":"text/x-yaml","patch_set":7,"id":"7faddb67_32b6e58c","line":2567,"updated":"2019-07-22 18:21:38.000000000","message":"nit: long line","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":2564,"context_line":"  type: string"},{"line_number":2565,"context_line":"event_name:"},{"line_number":2566,"context_line":"  description: |"},{"line_number":2567,"context_line":"    The event name. A valid value is ``network-changed``, ``network-vif-plugged``,"},{"line_number":2568,"context_line":"    ``network-vif-unplugged``, ``network-vif-deleted``, ``volume-extended`` or"},{"line_number":2569,"context_line":"    ``power-update``. The event name ``volume-extended`` is added since"},{"line_number":2570,"context_line":"    microversion ``2.51`` and ``power-update`` is added since microversion ``2.75``."}],"source_content_type":"text/x-yaml","patch_set":7,"id":"7faddb67_d674059f","line":2567,"in_reply_to":"7faddb67_32b6e58c","updated":"2019-07-24 11:24:34.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":2564,"context_line":"  type: string"},{"line_number":2565,"context_line":"event_name:"},{"line_number":2566,"context_line":"  description: |"},{"line_number":2567,"context_line":"    The event name. A valid value is ``network-changed``, ``network-vif-plugged``,"},{"line_number":2568,"context_line":"    ``network-vif-unplugged``, ``network-vif-deleted``, ``volume-extended`` or"},{"line_number":2569,"context_line":"    ``power-update``. The event name ``volume-extended`` is added since"},{"line_number":2570,"context_line":"    microversion ``2.51`` and ``power-update`` is added since microversion ``2.75``."}],"source_content_type":"text/x-yaml","patch_set":7,"id":"7faddb67_cd44811e","line":2567,"in_reply_to":"7faddb67_32b6e58c","updated":"2019-07-23 16:17:38.000000000","message":"nit: this could be done separately but we\u0027re getting to the point where I feel this should be a bullet list rather than prose. That way we can also more clearly call out the required minimum microversion for volume-extended and power-update.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":2564,"context_line":"  type: string"},{"line_number":2565,"context_line":"event_name:"},{"line_number":2566,"context_line":"  description: |"},{"line_number":2567,"context_line":"    The event name. A valid value is ``network-changed``, ``network-vif-plugged``,"},{"line_number":2568,"context_line":"    ``network-vif-unplugged``, ``network-vif-deleted``, ``volume-extended`` or"},{"line_number":2569,"context_line":"    ``power-update``. The event name ``volume-extended`` is added since"},{"line_number":2570,"context_line":"    microversion ``2.51`` and ``power-update`` is added since microversion ``2.75``."}],"source_content_type":"text/x-yaml","patch_set":7,"id":"7faddb67_f6790193","line":2567,"in_reply_to":"7faddb67_cd44811e","updated":"2019-07-24 11:24:34.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e31317cfa045027dca817dc7274eab432457520d","unresolved":false,"context_lines":[{"line_number":2567,"context_line":"    The event name. A valid value is ``network-changed``, ``network-vif-plugged``,"},{"line_number":2568,"context_line":"    ``network-vif-unplugged``, ``network-vif-deleted``, ``volume-extended`` or"},{"line_number":2569,"context_line":"    ``power-update``. The event name ``volume-extended`` is added since"},{"line_number":2570,"context_line":"    microversion ``2.51`` and ``power-update`` is added since microversion ``2.75``."},{"line_number":2571,"context_line":"  in: body"},{"line_number":2572,"context_line":"  required: true"},{"line_number":2573,"context_line":"  type: string"}],"source_content_type":"text/x-yaml","patch_set":7,"id":"7faddb67_92c1d9e7","line":2570,"updated":"2019-07-22 18:21:38.000000000","message":"nit: long line","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":2567,"context_line":"    The event name. A valid value is ``network-changed``, ``network-vif-plugged``,"},{"line_number":2568,"context_line":"    ``network-vif-unplugged``, ``network-vif-deleted``, ``volume-extended`` or"},{"line_number":2569,"context_line":"    ``power-update``. The event name ``volume-extended`` is added since"},{"line_number":2570,"context_line":"    microversion ``2.51`` and ``power-update`` is added since microversion ``2.75``."},{"line_number":2571,"context_line":"  in: body"},{"line_number":2572,"context_line":"  required: true"},{"line_number":2573,"context_line":"  type: string"}],"source_content_type":"text/x-yaml","patch_set":7,"id":"7faddb67_966e8dc7","line":2570,"in_reply_to":"7faddb67_92c1d9e7","updated":"2019-07-24 11:24:34.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4228adbb289cb1e85993d02646666e5a3cb2f693","unresolved":false,"context_lines":[{"line_number":2601,"context_line":"  type: string"},{"line_number":2602,"context_line":"event_tag:"},{"line_number":2603,"context_line":"  description: |"},{"line_number":2604,"context_line":"    A string value that identifies the event."},{"line_number":2605,"context_line":"  in: body"},{"line_number":2606,"context_line":"  required: false"},{"line_number":2607,"context_line":"  type: string"}],"source_content_type":"text/x-yaml","patch_set":7,"id":"7faddb67_509a686e","line":2604,"updated":"2019-07-23 16:39:18.000000000","message":"Either here or in the event name description above (probably here is better?) we should call out that for the power-update event the tag must be POWER_ON or POWER_OFF.\n\nA bit old, but for volume-extended the tag must be the volume id.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":2601,"context_line":"  type: string"},{"line_number":2602,"context_line":"event_tag:"},{"line_number":2603,"context_line":"  description: |"},{"line_number":2604,"context_line":"    A string value that identifies the event."},{"line_number":2605,"context_line":"  in: body"},{"line_number":2606,"context_line":"  required: false"},{"line_number":2607,"context_line":"  type: string"}],"source_content_type":"text/x-yaml","patch_set":7,"id":"7faddb67_3646b951","line":2604,"in_reply_to":"7faddb67_509a686e","updated":"2019-07-24 11:24:34.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"acff7ab05e9fd8d9b6a7b51404f8088b1ac59196","unresolved":false,"context_lines":[{"line_number":2565,"context_line":"  required: true"},{"line_number":2566,"context_line":"  type: string"},{"line_number":2567,"context_line":"event_name:"},{"line_number":2568,"context_line":"  description: |"},{"line_number":2569,"context_line":"    The event name. A valid value is:"},{"line_number":2570,"context_line":""},{"line_number":2571,"context_line":"    - ``network-changed``"},{"line_number":2572,"context_line":"    - ``network-vif-plugged``"},{"line_number":2573,"context_line":"    - ``network-vif-unplugged``"},{"line_number":2574,"context_line":"    - ``network-vif-deleted``"},{"line_number":2575,"context_line":"    - ``volume-extended`` (added since microversion ``2.51``)"},{"line_number":2576,"context_line":"    - ``power-update`` (added since microversion ``2.75``)"},{"line_number":2577,"context_line":""},{"line_number":2578,"context_line":"  in: body"},{"line_number":2579,"context_line":"  required: true"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"7faddb67_d13dc82c","line":2576,"range":{"start_line":2568,"start_character":3,"end_line":2576,"end_character":58},"updated":"2019-07-26 12:36:47.000000000","message":"yep this is nicer to read thanks for reformating","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"79018867b9c4d3e968f7710450e2f1602bc84846","unresolved":false,"context_lines":[{"line_number":2612,"context_line":""},{"line_number":2613,"context_line":"    - For the ``power-update`` event the tag must be either be ``POWER_ON``"},{"line_number":2614,"context_line":"      or ``POWER_OFF``."},{"line_number":2615,"context_line":"    - For the ``volume-extended`` event the tag must be the ``volume-id``."},{"line_number":2616,"context_line":""},{"line_number":2617,"context_line":"  in: body"},{"line_number":2618,"context_line":"  required: false"}],"source_content_type":"text/x-yaml","patch_set":10,"id":"7faddb67_023554db","line":2615,"range":{"start_line":2615,"start_character":4,"end_line":2615,"end_character":74},"updated":"2019-08-12 15:09:43.000000000","message":"This looks unrelated.\n\n[Later] Looks like Matt called for it in PS7","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":2593,"context_line":"    - ``network-vif-plugged``"},{"line_number":2594,"context_line":"    - ``network-vif-unplugged``"},{"line_number":2595,"context_line":"    - ``network-vif-deleted``"},{"line_number":2596,"context_line":"    - ``volume-extended`` (added since microversion ``2.51``)"},{"line_number":2597,"context_line":"    - ``power-update`` (added since microversion ``2.76``)"},{"line_number":2598,"context_line":""},{"line_number":2599,"context_line":"  in: body"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"7faddb67_479a68c5","line":2596,"range":{"start_line":2596,"start_character":27,"end_line":2596,"end_character":32},"updated":"2019-08-13 14:30:42.000000000","message":"nit: I\u0027d remove this word","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":2593,"context_line":"    - ``network-vif-plugged``"},{"line_number":2594,"context_line":"    - ``network-vif-unplugged``"},{"line_number":2595,"context_line":"    - ``network-vif-deleted``"},{"line_number":2596,"context_line":"    - ``volume-extended`` (added since microversion ``2.51``)"},{"line_number":2597,"context_line":"    - ``power-update`` (added since microversion ``2.76``)"},{"line_number":2598,"context_line":""},{"line_number":2599,"context_line":"  in: body"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"7faddb67_3558a854","line":2596,"range":{"start_line":2596,"start_character":27,"end_line":2596,"end_character":32},"in_reply_to":"7faddb67_479a68c5","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":2594,"context_line":"    - ``network-vif-unplugged``"},{"line_number":2595,"context_line":"    - ``network-vif-deleted``"},{"line_number":2596,"context_line":"    - ``volume-extended`` (added since microversion ``2.51``)"},{"line_number":2597,"context_line":"    - ``power-update`` (added since microversion ``2.76``)"},{"line_number":2598,"context_line":""},{"line_number":2599,"context_line":"  in: body"},{"line_number":2600,"context_line":"  required: true"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"7faddb67_679d24ba","line":2597,"range":{"start_line":2597,"start_character":24,"end_line":2597,"end_character":29},"updated":"2019-08-13 14:30:42.000000000","message":"same","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":2594,"context_line":"    - ``network-vif-unplugged``"},{"line_number":2595,"context_line":"    - ``network-vif-deleted``"},{"line_number":2596,"context_line":"    - ``volume-extended`` (added since microversion ``2.51``)"},{"line_number":2597,"context_line":"    - ``power-update`` (added since microversion ``2.76``)"},{"line_number":2598,"context_line":""},{"line_number":2599,"context_line":"  in: body"},{"line_number":2600,"context_line":"  required: true"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"7faddb67_5553e439","line":2597,"range":{"start_line":2597,"start_character":24,"end_line":2597,"end_character":29},"in_reply_to":"7faddb67_679d24ba","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":2629,"context_line":"  type: string"},{"line_number":2630,"context_line":"event_tag:"},{"line_number":2631,"context_line":"  description: |"},{"line_number":2632,"context_line":"    A string value that identifies the event:"},{"line_number":2633,"context_line":""},{"line_number":2634,"context_line":"    - For the ``power-update`` event the tag must be either be ``POWER_ON``"},{"line_number":2635,"context_line":"      or ``POWER_OFF``."}],"source_content_type":"text/x-yaml","patch_set":11,"id":"7faddb67_c7965895","line":2632,"range":{"start_line":2632,"start_character":44,"end_line":2632,"end_character":45},"updated":"2019-08-13 14:30:42.000000000","message":"nit: this makes it sound like these are the only possible uses for this but neutron passes the port id along with the network-changed event:\n\nI023b5b1ccb248e68189f62ba0ff75d41093c1f60\n\nI\u0027m not sure how to better word this though. Maybe it would be better to say something like, \"A string value that identifies the event, such as:\" or \"A string value that identifies the event. Certain types of events require specific tags:\".","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":2629,"context_line":"  type: string"},{"line_number":2630,"context_line":"event_tag:"},{"line_number":2631,"context_line":"  description: |"},{"line_number":2632,"context_line":"    A string value that identifies the event:"},{"line_number":2633,"context_line":""},{"line_number":2634,"context_line":"    - For the ``power-update`` event the tag must be either be ``POWER_ON``"},{"line_number":2635,"context_line":"      or ``POWER_OFF``."}],"source_content_type":"text/x-yaml","patch_set":11,"id":"7faddb67_151c8c75","line":2632,"range":{"start_line":2632,"start_character":44,"end_line":2632,"end_character":45},"in_reply_to":"7faddb67_c7965895","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":2633,"context_line":""},{"line_number":2634,"context_line":"    - For the ``power-update`` event the tag must be either be ``POWER_ON``"},{"line_number":2635,"context_line":"      or ``POWER_OFF``."},{"line_number":2636,"context_line":"    - For the ``volume-extended`` event the tag must be the ``volume-id``."},{"line_number":2637,"context_line":""},{"line_number":2638,"context_line":"  in: body"},{"line_number":2639,"context_line":"  required: false"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"7faddb67_e791149c","line":2636,"range":{"start_line":2636,"start_character":60,"end_line":2636,"end_character":73},"updated":"2019-08-13 14:30:42.000000000","message":"nit: this could just be \"volume id\" without `` and volume-id makes it sound like a variable.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":2633,"context_line":""},{"line_number":2634,"context_line":"    - For the ``power-update`` event the tag must be either be ``POWER_ON``"},{"line_number":2635,"context_line":"      or ``POWER_OFF``."},{"line_number":2636,"context_line":"    - For the ``volume-extended`` event the tag must be the ``volume-id``."},{"line_number":2637,"context_line":""},{"line_number":2638,"context_line":"  in: body"},{"line_number":2639,"context_line":"  required: false"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"7faddb67_95071c1e","line":2636,"range":{"start_line":2636,"start_character":60,"end_line":2636,"end_character":73},"in_reply_to":"7faddb67_e791149c","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":2634,"context_line":""},{"line_number":2635,"context_line":"    - For the ``power-update`` event the tag must be either be ``POWER_ON``"},{"line_number":2636,"context_line":"      or ``POWER_OFF``."},{"line_number":2637,"context_line":"    - For the ``volume-extended`` event the tag must be the \"volume-id\"."},{"line_number":2638,"context_line":""},{"line_number":2639,"context_line":"  in: body"},{"line_number":2640,"context_line":"  required: false"}],"source_content_type":"text/x-yaml","patch_set":13,"id":"7faddb67_f870aba6","line":2637,"range":{"start_line":2637,"start_character":60,"end_line":2637,"end_character":71},"updated":"2019-08-15 15:18:06.000000000","message":"I didn\u0027t mean to literally quote this. I just mean this could say:\n\n\"For the ``volume-extended`` event the tag must be the volume id.\"\n\nvolume-id sounds like a variable, which it\u0027s not. It\u0027s literally just the id field of the volume resource in the block storage API.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":2634,"context_line":""},{"line_number":2635,"context_line":"    - For the ``power-update`` event the tag must be either be ``POWER_ON``"},{"line_number":2636,"context_line":"      or ``POWER_OFF``."},{"line_number":2637,"context_line":"    - For the ``volume-extended`` event the tag must be the \"volume-id\"."},{"line_number":2638,"context_line":""},{"line_number":2639,"context_line":"  in: body"},{"line_number":2640,"context_line":"  required: false"}],"source_content_type":"text/x-yaml","patch_set":13,"id":"7faddb67_58c1bf2e","line":2637,"range":{"start_line":2637,"start_character":60,"end_line":2637,"end_character":71},"in_reply_to":"7faddb67_f870aba6","updated":"2019-08-15 16:05:59.000000000","message":"\u003e I didn\u0027t mean to literally quote this. I just mean this could say:\n \u003e \n \u003e \"For the ``volume-extended`` event the tag must be the volume id.\"\n \u003e \n\nah wokay :)\n\n \u003e volume-id sounds like a variable, which it\u0027s not. It\u0027s literally\n \u003e just the id field of the volume resource in the block storage API.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f41cbaf0e97c0f4a7a67b7969d5bdcba34f7b43","unresolved":false,"context_lines":[{"line_number":2634,"context_line":""},{"line_number":2635,"context_line":"    - For the ``power-update`` event the tag must be either be ``POWER_ON``"},{"line_number":2636,"context_line":"      or ``POWER_OFF``."},{"line_number":2637,"context_line":"    - For the ``volume-extended`` event the tag must be the volume-id."},{"line_number":2638,"context_line":""},{"line_number":2639,"context_line":"  in: body"},{"line_number":2640,"context_line":"  required: false"}],"source_content_type":"text/x-yaml","patch_set":14,"id":"7faddb67_be38dbd2","line":2637,"range":{"start_line":2637,"start_character":66,"end_line":2637,"end_character":67},"updated":"2019-08-15 16:34:38.000000000","message":"Remove the dash. :)","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d8941968c81c292abacca4cf574fb819c57f6b5","unresolved":false,"context_lines":[{"line_number":2634,"context_line":""},{"line_number":2635,"context_line":"    - For the ``power-update`` event the tag must be either be ``POWER_ON``"},{"line_number":2636,"context_line":"      or ``POWER_OFF``."},{"line_number":2637,"context_line":"    - For the ``volume-extended`` event the tag must be the volume-id."},{"line_number":2638,"context_line":""},{"line_number":2639,"context_line":"  in: body"},{"line_number":2640,"context_line":"  required: false"}],"source_content_type":"text/x-yaml","patch_set":14,"id":"7faddb67_3ebdcbb6","line":2637,"range":{"start_line":2637,"start_character":66,"end_line":2637,"end_character":67},"in_reply_to":"7faddb67_be38dbd2","updated":"2019-08-15 17:05:09.000000000","message":"Done","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"}],"nova/api/openstack/common.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":41,"context_line":"QUOTAS \u003d quota.QUOTAS"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"POWER_ON \u003d \u0027POWER_ON\u0027"},{"line_number":45,"context_line":"POWER_OFF \u003d \u0027POWER_OFF\u0027"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"_STATE_MAP \u003d {"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_0740f006","line":44,"updated":"2019-08-13 14:30:42.000000000","message":"I\u0027m not sure about putting these constants in here since they get re-used down in the compute manager and virt driver. Would nova.compute.power_state have been better? That\u0027s already shared between all of these modules/layers. Or nova.objects.external_event?\n\nAlso, a comment to go with these constants would have been nice, e.g. \"Possible tag values for power-update external event.\"","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":41,"context_line":"QUOTAS \u003d quota.QUOTAS"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"POWER_ON \u003d \u0027POWER_ON\u0027"},{"line_number":45,"context_line":"POWER_OFF \u003d \u0027POWER_OFF\u0027"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"_STATE_MAP \u003d {"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_a720eb9c","line":44,"in_reply_to":"7faddb67_0740f006","updated":"2019-08-14 12:54:15.000000000","message":"\u003e I\u0027m not sure about putting these constants in here since they get\n \u003e re-used down in the compute manager and virt driver. Would\n \u003e nova.compute.power_state have been better? That\u0027s already shared\n \u003e between all of these modules/layers. Or nova.objects.external_event?\n \u003e \n \u003e Also, a comment to go with these constants would have been nice,\n \u003e e.g. \"Possible tag values for power-update external event.\"\n\nProbably putting them in nova.objects.external_events makes sense in terms of the context for which they are being used. Plus putting it in nova.compute.power_state might make it confusing with the normal power_states we have in nova.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"}],"nova/api/openstack/compute/server_external_events.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @staticmethod"},{"line_number":38,"context_line":"    def _is_event_tag_present_when_required(event):"},{"line_number":39,"context_line":"        we_need_tag \u003d [\u0027volume-extended\u0027, \u0027power-update\u0027]"},{"line_number":40,"context_line":"        if event.name in we_need_tag and event.tag is None:"},{"line_number":41,"context_line":"            return False"},{"line_number":42,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_4d5091d5","line":39,"updated":"2019-07-23 16:17:38.000000000","message":"nit: this could be a module-level constant:\n\nTAG_REQUIRED \u003d (\u0027volume-extended\u0027, \u0027power-update\u0027)","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @staticmethod"},{"line_number":38,"context_line":"    def _is_event_tag_present_when_required(event):"},{"line_number":39,"context_line":"        we_need_tag \u003d [\u0027volume-extended\u0027, \u0027power-update\u0027]"},{"line_number":40,"context_line":"        if event.name in we_need_tag and event.tag is None:"},{"line_number":41,"context_line":"            return False"},{"line_number":42,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_d6bac5df","line":39,"in_reply_to":"7faddb67_4d5091d5","updated":"2019-07-24 11:24:34.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"}],"nova/compute/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":247,"context_line":"    return image_meta"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"def _is_valid_vm_task_power_states(instance, tag):"},{"line_number":251,"context_line":"    if ((tag \u003d\u003d \"POWER_ON\" and instance.task_state is None and"},{"line_number":252,"context_line":"            instance.vm_state \u003d\u003d vm_states.STOPPED and"},{"line_number":253,"context_line":"            instance.power_state \u003d\u003d power_state.SHUTDOWN) or"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_0de139d1","line":250,"updated":"2019-07-23 16:17:38.000000000","message":"Should have a docstring for this method and specifically call out it\u0027s tightly coupled nature to the power-update server external event.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":247,"context_line":"    return image_meta"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"def _is_valid_vm_task_power_states(instance, tag):"},{"line_number":251,"context_line":"    if ((tag \u003d\u003d \"POWER_ON\" and instance.task_state is None and"},{"line_number":252,"context_line":"            instance.vm_state \u003d\u003d vm_states.STOPPED and"},{"line_number":253,"context_line":"            instance.power_state \u003d\u003d power_state.SHUTDOWN) or"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_f6bb41c1","line":250,"in_reply_to":"7faddb67_0de139d1","updated":"2019-07-24 11:24:34.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":4772,"context_line":""},{"line_number":4773,"context_line":"        do_volume_snapshot_delete(self, context, bdm.instance)"},{"line_number":4774,"context_line":""},{"line_number":4775,"context_line":"    def _handle_power_update_external_event(self, context, instance, tag):"},{"line_number":4776,"context_line":"        \"\"\"Power update of an instance prompted by an external event.\"\"\""},{"line_number":4777,"context_line":"        LOG.debug(\"Trying to %(state)s instance\","},{"line_number":4778,"context_line":"                  {\u0027state\u0027: tag}, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_edba9ddf","line":4775,"range":{"start_line":4775,"start_character":50,"end_line":4775,"end_character":72},"updated":"2019-07-23 16:17:38.000000000","message":"Please document the parameters in the docstring. Particularly the tag and what the return value means.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":4772,"context_line":""},{"line_number":4773,"context_line":"        do_volume_snapshot_delete(self, context, bdm.instance)"},{"line_number":4774,"context_line":""},{"line_number":4775,"context_line":"    def _handle_power_update_external_event(self, context, instance, tag):"},{"line_number":4776,"context_line":"        \"\"\"Power update of an instance prompted by an external event.\"\"\""},{"line_number":4777,"context_line":"        LOG.debug(\"Trying to %(state)s instance\","},{"line_number":4778,"context_line":"                  {\u0027state\u0027: tag}, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_f6e021cf","line":4775,"range":{"start_line":4775,"start_character":50,"end_line":4775,"end_character":72},"in_reply_to":"7faddb67_108e302e","updated":"2019-07-24 11:24:34.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4228adbb289cb1e85993d02646666e5a3cb2f693","unresolved":false,"context_lines":[{"line_number":4772,"context_line":""},{"line_number":4773,"context_line":"        do_volume_snapshot_delete(self, context, bdm.instance)"},{"line_number":4774,"context_line":""},{"line_number":4775,"context_line":"    def _handle_power_update_external_event(self, context, instance, tag):"},{"line_number":4776,"context_line":"        \"\"\"Power update of an instance prompted by an external event.\"\"\""},{"line_number":4777,"context_line":"        LOG.debug(\"Trying to %(state)s instance\","},{"line_number":4778,"context_line":"                  {\u0027state\u0027: tag}, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_108e302e","line":4775,"range":{"start_line":4775,"start_character":50,"end_line":4775,"end_character":72},"in_reply_to":"7faddb67_edba9ddf","updated":"2019-07-23 16:39:18.000000000","message":"\u003e what the return value means\n\nSorry I was thinking of _is_valid_vm_task_power_states.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":4776,"context_line":"        \"\"\"Power update of an instance prompted by an external event.\"\"\""},{"line_number":4777,"context_line":"        LOG.debug(\"Trying to %(state)s instance\","},{"line_number":4778,"context_line":"                  {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4779,"context_line":"        if tag \u003d\u003d \"POWER_ON\":"},{"line_number":4780,"context_line":"            instance.task_state \u003d task_states.POWERING_ON"},{"line_number":4781,"context_line":"            instance.save(expected_task_state\u003d[None])"},{"line_number":4782,"context_line":"            self._record_action_start("}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_cd9c815f","line":4779,"updated":"2019-07-23 16:17:38.000000000","message":"So these state values are defined in ironic, right? It would probably be good to mention that in the API reference description of the power-update event that a tag is expected and these are the valid values.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":4776,"context_line":"        \"\"\"Power update of an instance prompted by an external event.\"\"\""},{"line_number":4777,"context_line":"        LOG.debug(\"Trying to %(state)s instance\","},{"line_number":4778,"context_line":"                  {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4779,"context_line":"        if tag \u003d\u003d \"POWER_ON\":"},{"line_number":4780,"context_line":"            instance.task_state \u003d task_states.POWERING_ON"},{"line_number":4781,"context_line":"            instance.save(expected_task_state\u003d[None])"},{"line_number":4782,"context_line":"            self._record_action_start("}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_d89e7353","line":4779,"in_reply_to":"7faddb67_cd9c815f","updated":"2019-07-24 11:24:34.000000000","message":"\u003e So these state values are defined in ironic, right?\n\ncorrect.\n\n \u003e It would\n \u003e probably be good to mention that in the API reference description\n \u003e of the power-update event that a tag is expected and these are the\n \u003e valid values.\n\nack.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":4782,"context_line":"            self._record_action_start("},{"line_number":4783,"context_line":"                context, instance, instance_actions.START)"},{"line_number":4784,"context_line":"        else:"},{"line_number":4785,"context_line":"            # It\u0027s POWER_OFF"},{"line_number":4786,"context_line":"            instance.task_state \u003d task_states.POWERING_OFF"},{"line_number":4787,"context_line":"            instance.save(expected_task_state\u003d[None])"},{"line_number":4788,"context_line":"            self._record_action_start("}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_edb61ddd","line":4785,"updated":"2019-07-23 16:17:38.000000000","message":"Hmm, what if it\u0027s not? What if someone screwed up? Should we check the value and if it\u0027s not what we expect log an error and just continue to stop the instance? I guess we shouldn\u0027t get this far in that case because _is_valid_vm_task_power_states would return False.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":4782,"context_line":"            self._record_action_start("},{"line_number":4783,"context_line":"                context, instance, instance_actions.START)"},{"line_number":4784,"context_line":"        else:"},{"line_number":4785,"context_line":"            # It\u0027s POWER_OFF"},{"line_number":4786,"context_line":"            instance.task_state \u003d task_states.POWERING_OFF"},{"line_number":4787,"context_line":"            instance.save(expected_task_state\u003d[None])"},{"line_number":4788,"context_line":"            self._record_action_start("}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_f80c8f95","line":4785,"in_reply_to":"7faddb67_edb61ddd","updated":"2019-07-24 11:24:34.000000000","message":"\u003e I guess we shouldn\u0027t get this far in\n \u003e that case because _is_valid_vm_task_power_states would return\n \u003e False.\n\nyeah, the checking is pretty strict because we have so many different ironic and nova power/task/vm states. So I picked only the healthy ones to work to be sure the updates work fine.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":4784,"context_line":"        else:"},{"line_number":4785,"context_line":"            # It\u0027s POWER_OFF"},{"line_number":4786,"context_line":"            instance.task_state \u003d task_states.POWERING_OFF"},{"line_number":4787,"context_line":"            instance.save(expected_task_state\u003d[None])"},{"line_number":4788,"context_line":"            self._record_action_start("},{"line_number":4789,"context_line":"                context, instance, instance_actions.STOP)"},{"line_number":4790,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_cd87a10f","line":4787,"updated":"2019-07-23 16:17:38.000000000","message":"The stop() method in the API here also sets instance.progress to 0, we should probably mirror that right, since it seems you\u0027re mirroring the stop/start method logic in this block. I\u0027m not sure if that progress value is really updated anywhere later, but we should be consistent.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":4784,"context_line":"        else:"},{"line_number":4785,"context_line":"            # It\u0027s POWER_OFF"},{"line_number":4786,"context_line":"            instance.task_state \u003d task_states.POWERING_OFF"},{"line_number":4787,"context_line":"            instance.save(expected_task_state\u003d[None])"},{"line_number":4788,"context_line":"            self._record_action_start("},{"line_number":4789,"context_line":"                context, instance, instance_actions.STOP)"},{"line_number":4790,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_98723b11","line":4787,"in_reply_to":"7faddb67_cd87a10f","updated":"2019-07-24 11:24:34.000000000","message":"\u003e The stop() method in the API here also sets instance.progress to 0,\n \u003e we should probably mirror that right, since it seems you\u0027re\n \u003e mirroring the stop/start method logic in this block. I\u0027m not sure\n \u003e if that progress value is really updated anywhere later, but we\n \u003e should be consistent.\n\noh good point. I forgot to take \"progress\" part into consideration for stop instance.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":4829,"context_line":"            elif event.name \u003d\u003d \u0027power-update\u0027:"},{"line_number":4830,"context_line":"                host \u003d hosts_by_instance[event.instance_uuid][0]"},{"line_number":4831,"context_line":"                cell_context \u003d cell_contexts_by_host[host]"},{"line_number":4832,"context_line":"                instance \u003d [inst for inst in instances_by_host[host]"},{"line_number":4833,"context_line":"                            if inst.uuid \u003d\u003d event.instance_uuid]"},{"line_number":4834,"context_line":"                if not _is_valid_vm_task_power_states(instance[0], event.tag):"},{"line_number":4835,"context_line":"                    LOG.debug(\u0027The power-update %(tag)s event for %(uuid)s is \u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_4dfe51af","line":4832,"updated":"2019-07-23 16:17:38.000000000","message":"nit: if you weren\u0027t using list comprehension you could break the loop once you find the instance you\u0027re looking for.\n\nAlternatively, couldn\u0027t we just do:\n\nfor inst in instances:\n   if inst.uuid \u003d\u003d event.instance_uuid:\n      instance \u003d inst\n      break\n\nOr at the top of this function just create a dict, keyed by instance uuid, to the instance object.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":4829,"context_line":"            elif event.name \u003d\u003d \u0027power-update\u0027:"},{"line_number":4830,"context_line":"                host \u003d hosts_by_instance[event.instance_uuid][0]"},{"line_number":4831,"context_line":"                cell_context \u003d cell_contexts_by_host[host]"},{"line_number":4832,"context_line":"                instance \u003d [inst for inst in instances_by_host[host]"},{"line_number":4833,"context_line":"                            if inst.uuid \u003d\u003d event.instance_uuid]"},{"line_number":4834,"context_line":"                if not _is_valid_vm_task_power_states(instance[0], event.tag):"},{"line_number":4835,"context_line":"                    LOG.debug(\u0027The power-update %(tag)s event for %(uuid)s is \u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_78e3bfa5","line":4832,"in_reply_to":"7faddb67_4dfe51af","updated":"2019-07-24 11:24:34.000000000","message":"\u003e nit: if you weren\u0027t using list comprehension you could break the\n \u003e loop once you find the instance you\u0027re looking for.\n \u003e \n \u003e Alternatively, couldn\u0027t we just do:\n \u003e \n \u003e for inst in instances:\n \u003e if inst.uuid \u003d\u003d event.instance_uuid:\n \u003e instance \u003d inst\n \u003e break\n \u003e \n \u003e Or at the top of this function just create a dict, keyed by\n \u003e instance uuid, to the instance object.\n\noh yea performance would be better I guess.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":4832,"context_line":"                instance \u003d [inst for inst in instances_by_host[host]"},{"line_number":4833,"context_line":"                            if inst.uuid \u003d\u003d event.instance_uuid]"},{"line_number":4834,"context_line":"                if not _is_valid_vm_task_power_states(instance[0], event.tag):"},{"line_number":4835,"context_line":"                    LOG.debug(\u0027The power-update %(tag)s event for %(uuid)s is \u0027"},{"line_number":4836,"context_line":"                              \u0027a no-op since the instance is in vm_state \u0027"},{"line_number":4837,"context_line":"                              \u0027%(vm_state)s, task_state %(task_state)s and \u0027"},{"line_number":4838,"context_line":"                              \u0027power_state %(power_state)s.\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_0d0a9989","line":4835,"range":{"start_line":4835,"start_character":62,"end_line":4835,"end_character":65},"updated":"2019-07-23 16:17:38.000000000","message":"for instance","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":4832,"context_line":"                instance \u003d [inst for inst in instances_by_host[host]"},{"line_number":4833,"context_line":"                            if inst.uuid \u003d\u003d event.instance_uuid]"},{"line_number":4834,"context_line":"                if not _is_valid_vm_task_power_states(instance[0], event.tag):"},{"line_number":4835,"context_line":"                    LOG.debug(\u0027The power-update %(tag)s event for %(uuid)s is \u0027"},{"line_number":4836,"context_line":"                              \u0027a no-op since the instance is in vm_state \u0027"},{"line_number":4837,"context_line":"                              \u0027%(vm_state)s, task_state %(task_state)s and \u0027"},{"line_number":4838,"context_line":"                              \u0027power_state %(power_state)s.\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_183f2bd7","line":4835,"range":{"start_line":4835,"start_character":62,"end_line":4835,"end_character":65},"in_reply_to":"7faddb67_0d0a9989","updated":"2019-07-24 11:24:34.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":4853,"context_line":"            # TODO(salv-orlando): Handle exceptions raised by the rpc api layer"},{"line_number":4854,"context_line":"            # in order to ensure that a failure in processing events on a host"},{"line_number":4855,"context_line":"            # will not prevent processing events on other hosts"},{"line_number":4856,"context_line":"            self.compute_rpcapi.external_instance_event("},{"line_number":4857,"context_line":"                cell_context, instances_by_host[host], events_by_host[host],"},{"line_number":4858,"context_line":"                host\u003dhost)"},{"line_number":4859,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_2df2f59b","line":4856,"updated":"2019-07-23 16:17:38.000000000","message":"Note to self, and not that we handled this for volume-extended, but older computes won\u0027t understand how to handle the power-update event. If we really cared we\u0027d check the compute service version to make sure it can handle the behavior change, but like I said we didn\u0027t do that for volume-extended either so I guess I don\u0027t want to enforce that now, and this is essentially best effort to fix a latent bug, right?","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4a9cb6fbe729b4d209c461f13a38c9c94fa8e1b2","unresolved":false,"context_lines":[{"line_number":4853,"context_line":"            # TODO(salv-orlando): Handle exceptions raised by the rpc api layer"},{"line_number":4854,"context_line":"            # in order to ensure that a failure in processing events on a host"},{"line_number":4855,"context_line":"            # will not prevent processing events on other hosts"},{"line_number":4856,"context_line":"            self.compute_rpcapi.external_instance_event("},{"line_number":4857,"context_line":"                cell_context, instances_by_host[host], events_by_host[host],"},{"line_number":4858,"context_line":"                host\u003dhost)"},{"line_number":4859,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_b80cd742","line":4856,"in_reply_to":"7faddb67_2df2f59b","updated":"2019-07-24 11:24:34.000000000","message":"\u003e Note to self, and not that we handled this for volume-extended, but\n \u003e older computes won\u0027t understand how to handle the power-update\n \u003e event. If we really cared we\u0027d check the compute service version to\n \u003e make sure it can handle the behavior change, but like I said we\n \u003e didn\u0027t do that for volume-extended either so I guess I don\u0027t want\n \u003e to enforce that now, and this is essentially best effort to fix a\n \u003e latent bug, right?\n\nhmm, good point about version checks.. but like you said since we haven\u0027t done it in the past, I guess we stick to the same behaviour?","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"0d7fdd81ac739d30e5c263a3e7bcab0e7c3eae3e","unresolved":false,"context_lines":[{"line_number":4823,"context_line":"                        break"},{"line_number":4824,"context_line":"                if not _is_valid_vm_task_power_states(instance, event.tag):"},{"line_number":4825,"context_line":"                    LOG.debug(\u0027The power-update %(tag)s event for instance \u0027"},{"line_number":4826,"context_line":"                              \u0027%(uuid)s is a no-op since the instance is in \u0027"},{"line_number":4827,"context_line":"                              \u0027vm_state %(vm_state)s, task_state \u0027"},{"line_number":4828,"context_line":"                              \u0027%(task_state)s and power_state \u0027"},{"line_number":4829,"context_line":"                              \u0027%(power_state)s.\u0027,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_1b5db3e8","line":4826,"range":{"start_line":4826,"start_character":45,"end_line":4826,"end_character":50},"updated":"2019-07-27 05:39:53.000000000","message":"nit:Can it be detailed here? Looks confusing.","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"785017ff6e79a78c3e76f329a7971a4800c9a241","unresolved":false,"context_lines":[{"line_number":4823,"context_line":"                        break"},{"line_number":4824,"context_line":"                if not _is_valid_vm_task_power_states(instance, event.tag):"},{"line_number":4825,"context_line":"                    LOG.debug(\u0027The power-update %(tag)s event for instance \u0027"},{"line_number":4826,"context_line":"                              \u0027%(uuid)s is a no-op since the instance is in \u0027"},{"line_number":4827,"context_line":"                              \u0027vm_state %(vm_state)s, task_state \u0027"},{"line_number":4828,"context_line":"                              \u0027%(task_state)s and power_state \u0027"},{"line_number":4829,"context_line":"                              \u0027%(power_state)s.\u0027,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_8d307eea","line":4826,"range":{"start_line":4826,"start_character":45,"end_line":4826,"end_character":50},"in_reply_to":"7faddb67_1b5db3e8","updated":"2019-07-29 07:14:03.000000000","message":"\u003e nit:Can it be detailed here? Looks confusing.\n\nI think operators in general know what a \"no-op\" is. If this goes for a respin I will correct this to no-operation if you are keen.","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"acff7ab05e9fd8d9b6a7b51404f8088b1ac59196","unresolved":false,"context_lines":[{"line_number":4831,"context_line":"                               \u0027vm_state\u0027: instance.vm_state,"},{"line_number":4832,"context_line":"                               \u0027task_state\u0027: instance.task_state,"},{"line_number":4833,"context_line":"                               \u0027power_state\u0027: instance.power_state})"},{"line_number":4834,"context_line":"                    continue"},{"line_number":4835,"context_line":"                self._handle_power_update_external_event("},{"line_number":4836,"context_line":"                    cell_context, instance, event.tag)"},{"line_number":4837,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_914e70bf","line":4834,"range":{"start_line":4834,"start_character":14,"end_line":4834,"end_character":28},"updated":"2019-07-26 12:36:47.000000000","message":"nit: i would prefer you uesed else here.\n\ncontinue requires you to read the content of the if\nand is an to determine if self._handel_power_update_external_event is called \nwhere as with else you know its only calle dwhen it is valid.\n\ni would also reverse the order of the branches\n\ne.g. if  _is_valid_vm_task_power_states(instance, event.tag):\n\nelse:\n    LOG ...","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"f4d5eeaf68589d1cbb42e023ab4d39ec09a5d23c","unresolved":false,"context_lines":[{"line_number":4831,"context_line":"                               \u0027vm_state\u0027: instance.vm_state,"},{"line_number":4832,"context_line":"                               \u0027task_state\u0027: instance.task_state,"},{"line_number":4833,"context_line":"                               \u0027power_state\u0027: instance.power_state})"},{"line_number":4834,"context_line":"                    continue"},{"line_number":4835,"context_line":"                self._handle_power_update_external_event("},{"line_number":4836,"context_line":"                    cell_context, instance, event.tag)"},{"line_number":4837,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_6802d0b6","line":4834,"range":{"start_line":4834,"start_character":14,"end_line":4834,"end_character":28},"in_reply_to":"7faddb67_914e70bf","updated":"2019-07-29 09:02:21.000000000","message":"\u003e nit: i would prefer you uesed else here.\n \u003e \n \u003e continue requires you to read the content of the if\n \u003e and is an to determine if self._handel_power_update_external_event\n \u003e is called\n\nhmm the continue is to actually make that particular event skip the for loop on L4838 and continue to the next entry in the for loop at L4806.","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"0d7fdd81ac739d30e5c263a3e7bcab0e7c3eae3e","unresolved":false,"context_lines":[{"line_number":4831,"context_line":"                               \u0027vm_state\u0027: instance.vm_state,"},{"line_number":4832,"context_line":"                               \u0027task_state\u0027: instance.task_state,"},{"line_number":4833,"context_line":"                               \u0027power_state\u0027: instance.power_state})"},{"line_number":4834,"context_line":"                    continue"},{"line_number":4835,"context_line":"                self._handle_power_update_external_event("},{"line_number":4836,"context_line":"                    cell_context, instance, event.tag)"},{"line_number":4837,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_db45db16","line":4834,"range":{"start_line":4834,"start_character":14,"end_line":4834,"end_character":28},"in_reply_to":"7faddb67_914e70bf","updated":"2019-07-27 05:39:53.000000000","message":"Agree sean, the continue can be instead of:\nif _is_valid_vm_task_power_states(instance, event.tag):\n   self._handle_power_update_external_event(\n                    cell_context, instance, event.tag)\nelse:\n   LOG.debug(...)","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"785017ff6e79a78c3e76f329a7971a4800c9a241","unresolved":false,"context_lines":[{"line_number":4831,"context_line":"                               \u0027vm_state\u0027: instance.vm_state,"},{"line_number":4832,"context_line":"                               \u0027task_state\u0027: instance.task_state,"},{"line_number":4833,"context_line":"                               \u0027power_state\u0027: instance.power_state})"},{"line_number":4834,"context_line":"                    continue"},{"line_number":4835,"context_line":"                self._handle_power_update_external_event("},{"line_number":4836,"context_line":"                    cell_context, instance, event.tag)"},{"line_number":4837,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_2d4dca71","line":4834,"range":{"start_line":4834,"start_character":14,"end_line":4834,"end_character":28},"in_reply_to":"7faddb67_914e70bf","updated":"2019-07-29 07:14:03.000000000","message":"again if I respin I can correct this to make it more readable.","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"79018867b9c4d3e968f7710450e2f1602bc84846","unresolved":false,"context_lines":[{"line_number":248,"context_line":"    return image_meta"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"def _is_valid_vm_task_power_states(instance, tag):"},{"line_number":252,"context_line":"    \"\"\"Check if the current state of the instance allows it to be"},{"line_number":253,"context_line":"    a candidate for the power-update event."},{"line_number":254,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_a2fb2045","line":251,"range":{"start_line":251,"start_character":4,"end_line":251,"end_character":34},"updated":"2019-08-12 15:09:43.000000000","message":"This logic could/should just be folded into _handle_power_update_external_event.","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"88f1e2bb65ab5367f58704adf7b72b5e3da89487","unresolved":false,"context_lines":[{"line_number":257,"context_line":"    :returns Boolean: True if the instance can be subjected to the"},{"line_number":258,"context_line":"                      power-update event."},{"line_number":259,"context_line":"    \"\"\""},{"line_number":260,"context_line":"    if ((tag \u003d\u003d common.POWER_UPDATE_EVENT_VALID_TAGS[0] and"},{"line_number":261,"context_line":"            instance.task_state is None and"},{"line_number":262,"context_line":"            instance.vm_state \u003d\u003d vm_states.STOPPED and"},{"line_number":263,"context_line":"            instance.power_state \u003d\u003d power_state.SHUTDOWN) or"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_e2a03894","line":260,"range":{"start_line":260,"start_character":9,"end_line":260,"end_character":55},"updated":"2019-08-12 14:48:59.000000000","message":"I would prefer that we define the tags symbolically and then chuck them in a list if we need that too. So this would become:\n\n if tag \u003d\u003d common.POWER_ON\n\nand then in common you can do this:\n\n common.POWER_UPDATE_EVENT_VALID_TAGS \u003d [POWER_ON, POWER_OFF]\n\nOtherwise this is hard to read/validate in place.","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"79018867b9c4d3e968f7710450e2f1602bc84846","unresolved":false,"context_lines":[{"line_number":257,"context_line":"    :returns Boolean: True if the instance can be subjected to the"},{"line_number":258,"context_line":"                      power-update event."},{"line_number":259,"context_line":"    \"\"\""},{"line_number":260,"context_line":"    if ((tag \u003d\u003d common.POWER_UPDATE_EVENT_VALID_TAGS[0] and"},{"line_number":261,"context_line":"            instance.task_state is None and"},{"line_number":262,"context_line":"            instance.vm_state \u003d\u003d vm_states.STOPPED and"},{"line_number":263,"context_line":"            instance.power_state \u003d\u003d power_state.SHUTDOWN) or"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_220df0e7","line":260,"range":{"start_line":260,"start_character":52,"end_line":260,"end_character":55},"updated":"2019-08-12 15:09:43.000000000","message":"This numeric index is pretty weird. If you\u0027re going to use it like this, POWER_UPDATE_EVENT_VALID_TAGS should be an enum instead.\n\n(If you wanted to overengineer a bit, it could be a dict, keyed by the tag, whose values dictate the corresponding vm_state, power_state, task_state, and instance_action :)","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"01e6706c208ba0cce225c5450e6fc4412adfe0ac","unresolved":false,"context_lines":[{"line_number":257,"context_line":"    :returns Boolean: True if the instance can be subjected to the"},{"line_number":258,"context_line":"                      power-update event."},{"line_number":259,"context_line":"    \"\"\""},{"line_number":260,"context_line":"    if ((tag \u003d\u003d common.POWER_UPDATE_EVENT_VALID_TAGS[0] and"},{"line_number":261,"context_line":"            instance.task_state is None and"},{"line_number":262,"context_line":"            instance.vm_state \u003d\u003d vm_states.STOPPED and"},{"line_number":263,"context_line":"            instance.power_state \u003d\u003d power_state.SHUTDOWN) or"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_45b91677","line":260,"range":{"start_line":260,"start_character":52,"end_line":260,"end_character":55},"in_reply_to":"7faddb67_220df0e7","updated":"2019-08-12 16:24:08.000000000","message":"\u003e This numeric index is pretty weird. If you\u0027re going to use it like\n \u003e this, POWER_UPDATE_EVENT_VALID_TAGS should be an enum instead.\n \u003e \n \u003e (If you wanted to overengineer a bit, it could be a dict, keyed by\n \u003e the tag, whose values dictate the corresponding vm_state,\n \u003e power_state, task_state, and instance_action :)\n\nuh-oh I can do that in a FUP, as of now I just made them global string values in common.","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"56e23bcf6689cb33c55ec448199ff4f5eb616df1","unresolved":false,"context_lines":[{"line_number":257,"context_line":"    :returns Boolean: True if the instance can be subjected to the"},{"line_number":258,"context_line":"                      power-update event."},{"line_number":259,"context_line":"    \"\"\""},{"line_number":260,"context_line":"    if ((tag \u003d\u003d common.POWER_UPDATE_EVENT_VALID_TAGS[0] and"},{"line_number":261,"context_line":"            instance.task_state is None and"},{"line_number":262,"context_line":"            instance.vm_state \u003d\u003d vm_states.STOPPED and"},{"line_number":263,"context_line":"            instance.power_state \u003d\u003d power_state.SHUTDOWN) or"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_31153c4a","line":260,"range":{"start_line":260,"start_character":52,"end_line":260,"end_character":55},"in_reply_to":"7faddb67_45b91677","updated":"2019-08-12 18:36:27.000000000","message":"No, global strings as you\u0027ve done is just fine. No need to overengineer :)","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"e2f0a7c3bfcfcf2f01217211f572201fec7e350f","unresolved":false,"context_lines":[{"line_number":257,"context_line":"    :returns Boolean: True if the instance can be subjected to the"},{"line_number":258,"context_line":"                      power-update event."},{"line_number":259,"context_line":"    \"\"\""},{"line_number":260,"context_line":"    if ((tag \u003d\u003d common.POWER_UPDATE_EVENT_VALID_TAGS[0] and"},{"line_number":261,"context_line":"            instance.task_state is None and"},{"line_number":262,"context_line":"            instance.vm_state \u003d\u003d vm_states.STOPPED and"},{"line_number":263,"context_line":"            instance.power_state \u003d\u003d power_state.SHUTDOWN) or"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_c2009c05","line":260,"range":{"start_line":260,"start_character":9,"end_line":260,"end_character":55},"in_reply_to":"7faddb67_e2a03894","updated":"2019-08-12 15:25:51.000000000","message":"\u003e I would prefer that we define the tags symbolically and then chuck\n \u003e them in a list if we need that too.\n\nI guess we don\u0027t need a list, so I can just define them in common directly.\n\n \u003e So this would become:\n \u003e \n \u003e if tag \u003d\u003d common.POWER_ON\n \u003e \n \u003e and then in common you can do this:\n \u003e \n \u003e common.POWER_UPDATE_EVENT_VALID_TAGS \u003d [POWER_ON, POWER_OFF]\n \u003e \n \u003e Otherwise this is hard to read/validate in place.","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"79018867b9c4d3e968f7710450e2f1602bc84846","unresolved":false,"context_lines":[{"line_number":4754,"context_line":""},{"line_number":4755,"context_line":"        do_volume_snapshot_delete(self, context, bdm.instance)"},{"line_number":4756,"context_line":""},{"line_number":4757,"context_line":"    def _handle_power_update_external_event(self, context, instance, tag):"},{"line_number":4758,"context_line":"        \"\"\"Power update of an instance prompted by an external event."},{"line_number":4759,"context_line":"        :param context: The API request context."},{"line_number":4760,"context_line":"        :param instance: The nova instance object."}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_457fd665","line":4757,"range":{"start_line":4757,"start_character":8,"end_line":4757,"end_character":43},"updated":"2019-08-12 15:09:43.000000000","message":"So if you take my suggestion above \u0026 below, this method would look like:\n\n if tag \u003d\u003d POWER_ON:\n     # Logic from _validate:\n     if other_things_make_sense:\n         # Do the action/notify\n         LOG.debug(\u0027Trying to POWER_ON instance\u0027)\n         instance.stuff\n         _record_action\n         return True\n elif tag \u003d\u003d POWER_OFF:\n     likewise\n     return True\n LOG.debug(\u0027Power update is a no-op...\u0027)\n return False\n\nAnd then L4824-37 would be\n\n if not _handle_power_update_external_event(...):\n     continue","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"01e6706c208ba0cce225c5450e6fc4412adfe0ac","unresolved":false,"context_lines":[{"line_number":4754,"context_line":""},{"line_number":4755,"context_line":"        do_volume_snapshot_delete(self, context, bdm.instance)"},{"line_number":4756,"context_line":""},{"line_number":4757,"context_line":"    def _handle_power_update_external_event(self, context, instance, tag):"},{"line_number":4758,"context_line":"        \"\"\"Power update of an instance prompted by an external event."},{"line_number":4759,"context_line":"        :param context: The API request context."},{"line_number":4760,"context_line":"        :param instance: The nova instance object."}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_f08d6235","line":4757,"range":{"start_line":4757,"start_character":8,"end_line":4757,"end_character":43},"in_reply_to":"7faddb67_457fd665","updated":"2019-08-12 16:24:08.000000000","message":"Initially I had everything under one roof like you suggested, it seemed crowded and ended up with ugly indentation which is why I moved things out. I can consolidate it again if that\u0027s better.","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"79018867b9c4d3e968f7710450e2f1602bc84846","unresolved":false,"context_lines":[{"line_number":4816,"context_line":"            elif event.name \u003d\u003d \u0027power-update\u0027:"},{"line_number":4817,"context_line":"                host \u003d hosts_by_instance[event.instance_uuid][0]"},{"line_number":4818,"context_line":"                cell_context \u003d cell_contexts_by_host[host]"},{"line_number":4819,"context_line":"                for inst in instances_by_host[host]:"},{"line_number":4820,"context_line":"                    if inst.uuid \u003d\u003d event.instance_uuid:"},{"line_number":4821,"context_line":"                        # once we find it, we break for performance"},{"line_number":4822,"context_line":"                        instance \u003d inst"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_a257a026","line":4819,"range":{"start_line":4819,"start_character":16,"end_line":4819,"end_character":19},"updated":"2019-08-12 15:09:43.000000000","message":"This `for` should have an `else` that freaks out if you didn\u0027t find your instance. Otherwise you\u0027re going to push this event onto the wrong one (the last one in the list).\n\n(...assuming it\u0027s possible for an event for a nonexistent instance to get this far.)","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"01e6706c208ba0cce225c5450e6fc4412adfe0ac","unresolved":false,"context_lines":[{"line_number":4816,"context_line":"            elif event.name \u003d\u003d \u0027power-update\u0027:"},{"line_number":4817,"context_line":"                host \u003d hosts_by_instance[event.instance_uuid][0]"},{"line_number":4818,"context_line":"                cell_context \u003d cell_contexts_by_host[host]"},{"line_number":4819,"context_line":"                for inst in instances_by_host[host]:"},{"line_number":4820,"context_line":"                    if inst.uuid \u003d\u003d event.instance_uuid:"},{"line_number":4821,"context_line":"                        # once we find it, we break for performance"},{"line_number":4822,"context_line":"                        instance \u003d inst"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_f0bec2fe","line":4819,"range":{"start_line":4819,"start_character":16,"end_line":4819,"end_character":19},"in_reply_to":"7faddb67_a257a026","updated":"2019-08-12 16:24:08.000000000","message":"\u003e This `for` should have an `else` that freaks out if you didn\u0027t find\n \u003e your instance. Otherwise you\u0027re going to push this event onto the\n \u003e wrong one (the last one in the list).\n \u003e \n \u003e (...assuming it\u0027s possible for an event for a nonexistent instance\n \u003e to get this far.)\n\nno its not possible, the event won\u0027t be propagated down here since it will be blocked here: https://github.com/openstack/nova/blob/52b9359d6c6f387b8b9728c723c9a2501136d605/nova/api/openstack/compute/server_external_events.py#L99 in the api level itself.","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"79018867b9c4d3e968f7710450e2f1602bc84846","unresolved":false,"context_lines":[{"line_number":4824,"context_line":"                if _is_valid_vm_task_power_states(instance, event.tag):"},{"line_number":4825,"context_line":"                    self._handle_power_update_external_event("},{"line_number":4826,"context_line":"                        cell_context, instance, event.tag)"},{"line_number":4827,"context_line":"                else:"},{"line_number":4828,"context_line":"                    LOG.debug(\u0027The power-update %(tag)s event for instance \u0027"},{"line_number":4829,"context_line":"                              \u0027%(uuid)s is a no-op since the instance is in \u0027"},{"line_number":4830,"context_line":"                              \u0027vm_state %(vm_state)s, task_state \u0027"},{"line_number":4831,"context_line":"                              \u0027%(task_state)s and power_state \u0027"},{"line_number":4832,"context_line":"                              \u0027%(power_state)s.\u0027,"},{"line_number":4833,"context_line":"                              {\u0027tag\u0027: event.tag, \u0027uuid\u0027: instance.uuid,"},{"line_number":4834,"context_line":"                               \u0027vm_state\u0027: instance.vm_state,"},{"line_number":4835,"context_line":"                               \u0027task_state\u0027: instance.task_state,"},{"line_number":4836,"context_line":"                               \u0027power_state\u0027: instance.power_state})"},{"line_number":4837,"context_line":"                    continue"},{"line_number":4838,"context_line":""},{"line_number":4839,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_42a02c43","line":4836,"range":{"start_line":4827,"start_character":15,"end_line":4836,"end_character":68},"updated":"2019-08-12 15:09:43.000000000","message":"This logic could/should be folded into _handle_power_update_external_event (with _is_valid_vm_task_power_states as noted above).","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"01e6706c208ba0cce225c5450e6fc4412adfe0ac","unresolved":false,"context_lines":[{"line_number":4824,"context_line":"                if _is_valid_vm_task_power_states(instance, event.tag):"},{"line_number":4825,"context_line":"                    self._handle_power_update_external_event("},{"line_number":4826,"context_line":"                        cell_context, instance, event.tag)"},{"line_number":4827,"context_line":"                else:"},{"line_number":4828,"context_line":"                    LOG.debug(\u0027The power-update %(tag)s event for instance \u0027"},{"line_number":4829,"context_line":"                              \u0027%(uuid)s is a no-op since the instance is in \u0027"},{"line_number":4830,"context_line":"                              \u0027vm_state %(vm_state)s, task_state \u0027"},{"line_number":4831,"context_line":"                              \u0027%(task_state)s and power_state \u0027"},{"line_number":4832,"context_line":"                              \u0027%(power_state)s.\u0027,"},{"line_number":4833,"context_line":"                              {\u0027tag\u0027: event.tag, \u0027uuid\u0027: instance.uuid,"},{"line_number":4834,"context_line":"                               \u0027vm_state\u0027: instance.vm_state,"},{"line_number":4835,"context_line":"                               \u0027task_state\u0027: instance.task_state,"},{"line_number":4836,"context_line":"                               \u0027power_state\u0027: instance.power_state})"},{"line_number":4837,"context_line":"                    continue"},{"line_number":4838,"context_line":""},{"line_number":4839,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_b08b6abe","line":4836,"range":{"start_line":4827,"start_character":15,"end_line":4836,"end_character":68},"in_reply_to":"7faddb67_42a02c43","updated":"2019-08-12 16:24:08.000000000","message":"Done","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":247,"context_line":"    return image_meta"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"def _is_valid_vm_task_power_states(instance, tag):"},{"line_number":251,"context_line":"    \"\"\"Check if the current state of the instance allows it to be"},{"line_number":252,"context_line":"    a candidate for the power-update event."},{"line_number":253,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_6730c49f","line":250,"range":{"start_line":250,"start_character":4,"end_line":250,"end_character":34},"updated":"2019-08-13 14:30:42.000000000","message":"nit: I\u0027d probably name this something like is_state_valid_for_power_update_event - something that has the actual power_update wording in it, not to be confused with check_instance_state.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":247,"context_line":"    return image_meta"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"def _is_valid_vm_task_power_states(instance, tag):"},{"line_number":251,"context_line":"    \"\"\"Check if the current state of the instance allows it to be"},{"line_number":252,"context_line":"    a candidate for the power-update event."},{"line_number":253,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_0778df8c","line":250,"range":{"start_line":250,"start_character":4,"end_line":250,"end_character":34},"in_reply_to":"7faddb67_6730c49f","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":252,"context_line":"    a candidate for the power-update event."},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    :param instance: The nova instance object."},{"line_number":255,"context_line":"    :param tag: The desired target power state."},{"line_number":256,"context_line":"    :returns Boolean: True if the instance can be subjected to the"},{"line_number":257,"context_line":"                      power-update event."},{"line_number":258,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_47d26836","line":255,"range":{"start_line":255,"start_character":46,"end_line":255,"end_character":47},"updated":"2019-08-13 14:30:42.000000000","message":"\"; this should be either POWER_ON or POWER_OFF\"\n\nOtherwise this could be confused as asking for a nova.compute.power_state enum.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":252,"context_line":"    a candidate for the power-update event."},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    :param instance: The nova instance object."},{"line_number":255,"context_line":"    :param tag: The desired target power state."},{"line_number":256,"context_line":"    :returns Boolean: True if the instance can be subjected to the"},{"line_number":257,"context_line":"                      power-update event."},{"line_number":258,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_c77167aa","line":255,"range":{"start_line":255,"start_character":46,"end_line":255,"end_character":47},"in_reply_to":"7faddb67_47d26836","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":4682,"context_line":"        \"\"\"Power update of an instance prompted by an external event."},{"line_number":4683,"context_line":"        :param context: The API request context."},{"line_number":4684,"context_line":"        :param instance: The nova instance object."},{"line_number":4685,"context_line":"        :param tag: The desired target power state."},{"line_number":4686,"context_line":"        :returns Boolean: True if the power-update has been initialized on"},{"line_number":4687,"context_line":"                          the instance."},{"line_number":4688,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_e79cb45c","line":4685,"updated":"2019-08-13 14:30:42.000000000","message":"same as above","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":4682,"context_line":"        \"\"\"Power update of an instance prompted by an external event."},{"line_number":4683,"context_line":"        :param context: The API request context."},{"line_number":4684,"context_line":"        :param instance: The nova instance object."},{"line_number":4685,"context_line":"        :param tag: The desired target power state."},{"line_number":4686,"context_line":"        :returns Boolean: True if the power-update has been initialized on"},{"line_number":4687,"context_line":"                          the instance."},{"line_number":4688,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_2762bbd9","line":4685,"in_reply_to":"7faddb67_e79cb45c","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"56e23bcf6689cb33c55ec448199ff4f5eb616df1","unresolved":false,"context_lines":[{"line_number":4686,"context_line":"        :returns Boolean: True if the power-update has been initialized on"},{"line_number":4687,"context_line":"                          the instance."},{"line_number":4688,"context_line":"        \"\"\""},{"line_number":4689,"context_line":"        if not _is_valid_vm_task_power_states(instance, tag):"},{"line_number":4690,"context_line":"            LOG.debug(\u0027The power-update %(tag)s event for instance \u0027"},{"line_number":4691,"context_line":"                      \u0027%(uuid)s is a no-op since the instance is in \u0027"},{"line_number":4692,"context_line":"                      \u0027vm_state %(vm_state)s, task_state \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_6323e7a8","line":4689,"range":{"start_line":4689,"start_character":15,"end_line":4689,"end_character":45},"updated":"2019-08-12 18:36:27.000000000","message":"Yeah, this looks nicer, thanks. Now I would just say to move the methods closer together for readability, but meh.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":4695,"context_line":"                      {\u0027tag\u0027: tag, \u0027uuid\u0027: instance.uuid,"},{"line_number":4696,"context_line":"                      \u0027vm_state\u0027: instance.vm_state,"},{"line_number":4697,"context_line":"                      \u0027task_state\u0027: instance.task_state,"},{"line_number":4698,"context_line":"                      \u0027power_state\u0027: instance.power_state})"},{"line_number":4699,"context_line":"            return False"},{"line_number":4700,"context_line":"        else:"},{"line_number":4701,"context_line":"            LOG.debug(\"Trying to %(state)s instance\","}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_e7ca7444","line":4698,"range":{"start_line":4698,"start_character":37,"end_line":4698,"end_character":57},"updated":"2019-08-13 14:30:42.000000000","message":"nit: unfortunately this just shows up as an integer which isn\u0027t super useful, though it\u0027s not unique to this log message (compute does the same thing in the _sync_power_states periodic):\n\nAug 12 18:57:50.498695 ubuntu-bionic-rax-iad-0010063764 devstack@n-api.service[7908]: DEBUG nova.compute.api [req-9d647d50-f56c-48b2-bc3f-689016bf8986 req-2bdf1b49-4081-4b27-94f6-466e0437ff8a service ironic] The power-update POWER_OFF event for instance c3541378-0afa-448d-9f3f-87008eeac085 is a no-op since the instance is in vm_state active, task_state deleting and power_state 1. {{(pid\u003d7909) _handle_power_update_external_event /opt/stack/nova/nova/compute/api.py:4698}}\n\nFortunately the API reference defines the OS-EXT-STS:power_state enums so people can correlate the name of the enum to the value.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":4695,"context_line":"                      {\u0027tag\u0027: tag, \u0027uuid\u0027: instance.uuid,"},{"line_number":4696,"context_line":"                      \u0027vm_state\u0027: instance.vm_state,"},{"line_number":4697,"context_line":"                      \u0027task_state\u0027: instance.task_state,"},{"line_number":4698,"context_line":"                      \u0027power_state\u0027: instance.power_state})"},{"line_number":4699,"context_line":"            return False"},{"line_number":4700,"context_line":"        else:"},{"line_number":4701,"context_line":"            LOG.debug(\"Trying to %(state)s instance\","}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_67dbd37c","line":4698,"range":{"start_line":4698,"start_character":37,"end_line":4698,"end_character":57},"in_reply_to":"7faddb67_e7ca7444","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":4697,"context_line":"                      \u0027task_state\u0027: instance.task_state,"},{"line_number":4698,"context_line":"                      \u0027power_state\u0027: instance.power_state})"},{"line_number":4699,"context_line":"            return False"},{"line_number":4700,"context_line":"        else:"},{"line_number":4701,"context_line":"            LOG.debug(\"Trying to %(state)s instance\","},{"line_number":4702,"context_line":"                      {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4703,"context_line":"            if tag \u003d\u003d common.POWER_ON:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_47b7c8d9","line":4700,"updated":"2019-08-13 14:30:42.000000000","message":"Drop this else to avoid the unnecessary nesting.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":4697,"context_line":"                      \u0027task_state\u0027: instance.task_state,"},{"line_number":4698,"context_line":"                      \u0027power_state\u0027: instance.power_state})"},{"line_number":4699,"context_line":"            return False"},{"line_number":4700,"context_line":"        else:"},{"line_number":4701,"context_line":"            LOG.debug(\"Trying to %(state)s instance\","},{"line_number":4702,"context_line":"                      {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4703,"context_line":"            if tag \u003d\u003d common.POWER_ON:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_67c43393","line":4700,"in_reply_to":"7faddb67_47b7c8d9","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":4698,"context_line":"                      \u0027power_state\u0027: instance.power_state})"},{"line_number":4699,"context_line":"            return False"},{"line_number":4700,"context_line":"        else:"},{"line_number":4701,"context_line":"            LOG.debug(\"Trying to %(state)s instance\","},{"line_number":4702,"context_line":"                      {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4703,"context_line":"            if tag \u003d\u003d common.POWER_ON:"},{"line_number":4704,"context_line":"                instance.task_state \u003d task_states.POWERING_ON"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_8cc40742","line":4701,"updated":"2019-08-13 14:30:42.000000000","message":"Unfortunately I don\u0027t ever see us hit this in an ironic CI run, but that\u0027s probably due to tempest tests for ironic not triggering weird out of band power failures on the node.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":4698,"context_line":"                      \u0027power_state\u0027: instance.power_state})"},{"line_number":4699,"context_line":"            return False"},{"line_number":4700,"context_line":"        else:"},{"line_number":4701,"context_line":"            LOG.debug(\"Trying to %(state)s instance\","},{"line_number":4702,"context_line":"                      {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4703,"context_line":"            if tag \u003d\u003d common.POWER_ON:"},{"line_number":4704,"context_line":"                instance.task_state \u003d task_states.POWERING_ON"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_a73f8b85","line":4701,"in_reply_to":"7faddb67_8cc40742","updated":"2019-08-14 12:54:15.000000000","message":"\u003e Unfortunately I don\u0027t ever see us hit this in an ironic CI run, but\n \u003e that\u0027s probably due to tempest tests for ironic not triggering\n \u003e weird out of band power failures on the node.\n\nhmm,,I see in my my devstack.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":4702,"context_line":"                      {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4703,"context_line":"            if tag \u003d\u003d common.POWER_ON:"},{"line_number":4704,"context_line":"                instance.task_state \u003d task_states.POWERING_ON"},{"line_number":4705,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":4706,"context_line":"                self._record_action_start("},{"line_number":4707,"context_line":"                    context, instance, instance_actions.START)"},{"line_number":4708,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_e738343c","line":4705,"range":{"start_line":4705,"start_character":30,"end_line":4705,"end_character":49},"updated":"2019-08-13 14:30:42.000000000","message":"This and below, we could be racing with another operation that is setting the task_state on the instance between the time we checked the task_state for None above and when we save the value here, which would result in an UnexpectedTaskStateError being raised and that would result in a 500 response from the API since we\u0027re not handling that type of error.\n\nShould we handle that here in this method and return False if we hit it so we\u0027d continue to process the next event for the next instance in the external_instance_event method?","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"76f2b17857866ae0d10807d309e4b523305f44f9","unresolved":false,"context_lines":[{"line_number":4702,"context_line":"                      {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4703,"context_line":"            if tag \u003d\u003d common.POWER_ON:"},{"line_number":4704,"context_line":"                instance.task_state \u003d task_states.POWERING_ON"},{"line_number":4705,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":4706,"context_line":"                self._record_action_start("},{"line_number":4707,"context_line":"                    context, instance, instance_actions.START)"},{"line_number":4708,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_bc07b21d","line":4705,"range":{"start_line":4705,"start_character":30,"end_line":4705,"end_character":49},"in_reply_to":"7faddb67_5cf23e9c","updated":"2019-08-13 15:26:07.000000000","message":"\u003e Another issue is that, I think, right now I could use this api to break KVM instances by firing power update events which will be dropped/ignored by the libvirt driver and similarly require admin intervention to clean up the state.\n\nThe libvirt driver would raise NotImplementedError which will trigger the @reverts_task_state decorator in compute and reset the task_state to None. If you abused this for KVM instances on Stein computes, sure it\u0027s the same problem.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3acc787c65aae69cc568c2e3ecc8affc3ace2ad1","unresolved":false,"context_lines":[{"line_number":4702,"context_line":"                      {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4703,"context_line":"            if tag \u003d\u003d common.POWER_ON:"},{"line_number":4704,"context_line":"                instance.task_state \u003d task_states.POWERING_ON"},{"line_number":4705,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":4706,"context_line":"                self._record_action_start("},{"line_number":4707,"context_line":"                    context, instance, instance_actions.START)"},{"line_number":4708,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_b28ef92f","line":4705,"range":{"start_line":4705,"start_character":30,"end_line":4705,"end_character":49},"in_reply_to":"7faddb67_af3532dd","updated":"2019-08-13 16:12:04.000000000","message":"Ack, yeah, I see the helper in manager has the revert on it. I was pretty sure the event handler didn\u0027t but I see that she\u0027s got it there on the helper.\n\nAnyway, I still think we should avoid the task state manip in the api for this.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":4702,"context_line":"                      {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4703,"context_line":"            if tag \u003d\u003d common.POWER_ON:"},{"line_number":4704,"context_line":"                instance.task_state \u003d task_states.POWERING_ON"},{"line_number":4705,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":4706,"context_line":"                self._record_action_start("},{"line_number":4707,"context_line":"                    context, instance, instance_actions.START)"},{"line_number":4708,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_67e5130a","line":4705,"range":{"start_line":4705,"start_character":30,"end_line":4705,"end_character":49},"in_reply_to":"7faddb67_b28ef92f","updated":"2019-08-14 12:54:15.000000000","message":"@mriedem: Intially during development I was handling the UnexpectedStateError (which is what made me do _is_state_valid_for_power_update_event function in the first place to make it strict). If you are concerned about other functions also making a race for the task_state, I could do a lock on the function based on instance_uuid like we do in the manager ?\n\n@dansmith: as mriedem pointed out already I have the @revert helper for task_state. Also I understand why you want me to defer the task_state update also downwards since even in the spec design time you clearly did tell me to push everything to the driver level. However the whole point of this task state change is to see the transition right ? If I push it down it would be something like setting it to POWERING_ON immediately followed by None. Meaning the transition from None to POWERING_ON and back to None would be super quick which didn\u0027t make much sense to me.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce0bff1e36708ce3c43e3b69d1e5a544f0299107","unresolved":false,"context_lines":[{"line_number":4702,"context_line":"                      {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4703,"context_line":"            if tag \u003d\u003d common.POWER_ON:"},{"line_number":4704,"context_line":"                instance.task_state \u003d task_states.POWERING_ON"},{"line_number":4705,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":4706,"context_line":"                self._record_action_start("},{"line_number":4707,"context_line":"                    context, instance, instance_actions.START)"},{"line_number":4708,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_af3532dd","line":4705,"range":{"start_line":4705,"start_character":30,"end_line":4705,"end_character":49},"in_reply_to":"7faddb67_bc07b21d","updated":"2019-08-13 15:28:17.000000000","message":"\u003e \u003e Another issue is that, I think, right now I could use this api to\n \u003e break KVM instances by firing power update events which will be\n \u003e dropped/ignored by the libvirt driver and similarly require admin\n \u003e intervention to clean up the state.\n \u003e \n \u003e The libvirt driver would raise NotImplementedError which will\n \u003e trigger the @reverts_task_state decorator in compute and reset the\n \u003e task_state to None. If you abused this for KVM instances on Stein\n \u003e computes, sure it\u0027s the same problem.\n\nI also pointed out that we should be testing that to be sure we\u0027re reverting the task state properly for this scenario:\n\nhttps://review.opendev.org/#/c/645611/11/nova/tests/unit/compute/test_compute_mgr.py@3029","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dc645c95bd90af595760a2e3810e88d0ac3ba4c3","unresolved":false,"context_lines":[{"line_number":4702,"context_line":"                      {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4703,"context_line":"            if tag \u003d\u003d common.POWER_ON:"},{"line_number":4704,"context_line":"                instance.task_state \u003d task_states.POWERING_ON"},{"line_number":4705,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":4706,"context_line":"                self._record_action_start("},{"line_number":4707,"context_line":"                    context, instance, instance_actions.START)"},{"line_number":4708,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_5cf23e9c","line":4705,"range":{"start_line":4705,"start_character":30,"end_line":4705,"end_character":49},"in_reply_to":"7faddb67_e738343c","updated":"2019-08-13 15:09:34.000000000","message":"Personally, I\u0027d prefer we just remove all the updating of the instance here in the API and defer it all down to the compute manager and driver. As you mention, if the compute isn\u0027t upgraded, the API will change the task_state, but the old compute will never reset it.\n\nAnother issue is that, I think, right now I could use this api to break KVM instances by firing power update events which will be dropped/ignored by the libvirt driver and similarly require admin intervention to clean up the state.\n\nI think that deferring everything down to the compute/driver to decide if it\u0027s going to change the instance state, and then do so, is fine.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":4714,"context_line":"                    context, instance, instance_actions.STOP)"},{"line_number":4715,"context_line":"        return True"},{"line_number":4716,"context_line":""},{"line_number":4717,"context_line":"    def external_instance_event(self, api_context, instances, events):"},{"line_number":4718,"context_line":"        # NOTE(danms): The external API consumer just provides events,"},{"line_number":4719,"context_line":"        # but doesn\u0027t know where they go. We need to collate lists"},{"line_number":4720,"context_line":"        # by the host the affected instance is on and dispatch them"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_c793b85b","line":4717,"updated":"2019-08-13 14:30:42.000000000","message":"I just realized this doesn\u0027t check if any of the instances are locked. That\u0027s not a problem for you to address here, and I\u0027m not sure it\u0027s a problem at all, but it seems to violate the lock API semantics a bit, though external events are service/admin driven things, not from users.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":4714,"context_line":"                    context, instance, instance_actions.STOP)"},{"line_number":4715,"context_line":"        return True"},{"line_number":4716,"context_line":""},{"line_number":4717,"context_line":"    def external_instance_event(self, api_context, instances, events):"},{"line_number":4718,"context_line":"        # NOTE(danms): The external API consumer just provides events,"},{"line_number":4719,"context_line":"        # but doesn\u0027t know where they go. We need to collate lists"},{"line_number":4720,"context_line":"        # by the host the affected instance is on and dispatch them"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_c7b727f5","line":4717,"in_reply_to":"7faddb67_c793b85b","updated":"2019-08-14 12:54:15.000000000","message":"\u003e I just realized this doesn\u0027t check if any of the instances are\n \u003e locked. That\u0027s not a problem for you to address here, and I\u0027m not\n \u003e sure it\u0027s a problem at all, but it seems to violate the lock API\n \u003e semantics a bit, though external events are service/admin driven\n \u003e things, not from users.\n\nwe had a brief discussion in the spec about the instance being locked, but decided its not our concern (https://review.opendev.org/#/c/636132/7/specs/train/approved/nova-support-instance-power-update.rst@61)","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":4757,"context_line":"                cell_context \u003d cell_contexts_by_host[host]"},{"line_number":4758,"context_line":"                for inst in instances_by_host[host]:"},{"line_number":4759,"context_line":"                    if inst.uuid \u003d\u003d event.instance_uuid:"},{"line_number":4760,"context_line":"                        # once we find it, we break for performance"},{"line_number":4761,"context_line":"                        instance \u003d inst"},{"line_number":4762,"context_line":"                        break"},{"line_number":4763,"context_line":"                if not self._handle_power_update_external_event("}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_07831006","line":4760,"updated":"2019-08-13 14:30:42.000000000","message":"If we don\u0027t find the instance we won\u0027t break the loop and we won\u0027t set the local instance variable so we\u0027d get an error below, but that shouldn\u0027t really happen, right?","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":4757,"context_line":"                cell_context \u003d cell_contexts_by_host[host]"},{"line_number":4758,"context_line":"                for inst in instances_by_host[host]:"},{"line_number":4759,"context_line":"                    if inst.uuid \u003d\u003d event.instance_uuid:"},{"line_number":4760,"context_line":"                        # once we find it, we break for performance"},{"line_number":4761,"context_line":"                        instance \u003d inst"},{"line_number":4762,"context_line":"                        break"},{"line_number":4763,"context_line":"                if not self._handle_power_update_external_event("}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_a7a9cb90","line":4760,"in_reply_to":"7faddb67_07831006","updated":"2019-08-14 12:54:15.000000000","message":"\u003e If we don\u0027t find the instance we won\u0027t break the loop and we won\u0027t\n \u003e set the local instance variable so we\u0027d get an error below, but\n \u003e that shouldn\u0027t really happen, right?\n\nwell logic wise we should never be in the \"if we don\u0027t find the instance\" part since it should be handled here: https://github.com/openstack/nova/blob/778a986a65ac3f55b434cea40c76faf65b5abf22/nova/api/openstack/compute/server_external_events.py#L100 . The instances argument that gets passed here should have the instance.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ae686195dac26254f27619fd3b99390f67931fba","unresolved":false,"context_lines":[{"line_number":4762,"context_line":"                        break"},{"line_number":4763,"context_line":"                if not self._handle_power_update_external_event("},{"line_number":4764,"context_line":"                        cell_context, instance, event.tag):"},{"line_number":4765,"context_line":"                    continue"},{"line_number":4766,"context_line":""},{"line_number":4767,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"},{"line_number":4768,"context_line":"                events_by_host[host].append(event)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_76eaca0e","line":4765,"updated":"2019-08-12 16:58:42.000000000","message":"I missed this before, but why are you skipping the rest of the events because one of them was a no-op? This is a batch interface, which means ironic is totally allowed to send multiple events for multiple instances. Just because one isn\u0027t in an actionable state when the event comes in does not mean we should skip events for subsequent instances. What am I missing?","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ce875ab790cc239a8d9947ed980b9691a45d797","unresolved":false,"context_lines":[{"line_number":4762,"context_line":"                        break"},{"line_number":4763,"context_line":"                if not self._handle_power_update_external_event("},{"line_number":4764,"context_line":"                        cell_context, instance, event.tag):"},{"line_number":4765,"context_line":"                    continue"},{"line_number":4766,"context_line":""},{"line_number":4767,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"},{"line_number":4768,"context_line":"                events_by_host[host].append(event)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_b66602bb","line":4765,"in_reply_to":"7faddb67_76eaca0e","updated":"2019-08-12 17:04:11.000000000","message":"\u003e I missed this before, but why are you skipping the rest of the\n \u003e events because one of them was a no-op? This is a batch interface,\n \u003e which means ironic is totally allowed to send multiple events for\n \u003e multiple instances. Just because one isn\u0027t in an actionable state\n \u003e when the event comes in does not mean we should skip events for\n \u003e subsequent instances. What am I missing?\n\nI hope I am not skipping the rest of the events, the aim with continue here is to go back into the loop at L4745 which will process the next event. My aim is to avoid L4770 since that instance is not ready to be processed if _handle_power_update_external_event returns False. Let me know if that makes sense.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":4762,"context_line":"                        break"},{"line_number":4763,"context_line":"                if not self._handle_power_update_external_event("},{"line_number":4764,"context_line":"                        cell_context, instance, event.tag):"},{"line_number":4765,"context_line":"                    continue"},{"line_number":4766,"context_line":""},{"line_number":4767,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"},{"line_number":4768,"context_line":"                events_by_host[host].append(event)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_c7a17897","line":4765,"in_reply_to":"7faddb67_967e66ad","updated":"2019-08-13 14:30:42.000000000","message":"A comment on the continue could have helped with the logic, something simple like, \"Ignore this event for this instance since the instance vm/task/power state is not valid for the event. Continue to process the next event.\"","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5428f105ee00d61e089ae902478cce0f9f8a6b52","unresolved":false,"context_lines":[{"line_number":4762,"context_line":"                        break"},{"line_number":4763,"context_line":"                if not self._handle_power_update_external_event("},{"line_number":4764,"context_line":"                        cell_context, instance, event.tag):"},{"line_number":4765,"context_line":"                    continue"},{"line_number":4766,"context_line":""},{"line_number":4767,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"},{"line_number":4768,"context_line":"                events_by_host[host].append(event)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_967e66ad","line":4765,"in_reply_to":"7faddb67_b66602bb","updated":"2019-08-12 17:12:11.000000000","message":"Yep, sorry I was confused where we were in the nesting, so ignore me.\n\n(for posterity, Surya meant s/4770/4768/)","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4e7f49181672f3722f74b83ee98d589f4dff0631","unresolved":false,"context_lines":[{"line_number":4762,"context_line":"                        break"},{"line_number":4763,"context_line":"                if not self._handle_power_update_external_event("},{"line_number":4764,"context_line":"                        cell_context, instance, event.tag):"},{"line_number":4765,"context_line":"                    continue"},{"line_number":4766,"context_line":""},{"line_number":4767,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"},{"line_number":4768,"context_line":"                events_by_host[host].append(event)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_76072a83","line":4765,"in_reply_to":"7faddb67_b66602bb","updated":"2019-08-12 17:07:24.000000000","message":"hope this test helps: https://review.opendev.org/#/c/645611/11/nova/tests/unit/compute/test_compute_api.py@4074","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":4762,"context_line":"                        break"},{"line_number":4763,"context_line":"                if not self._handle_power_update_external_event("},{"line_number":4764,"context_line":"                        cell_context, instance, event.tag):"},{"line_number":4765,"context_line":"                    continue"},{"line_number":4766,"context_line":""},{"line_number":4767,"context_line":"            for host in hosts_by_instance[event.instance_uuid]:"},{"line_number":4768,"context_line":"                events_by_host[host].append(event)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_078c5f33","line":4765,"in_reply_to":"7faddb67_c7a17897","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7011c8d687547c0e5b095bb80fcfc56f5c6749e6","unresolved":false,"context_lines":[{"line_number":247,"context_line":"    return image_meta"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"def _is_state_valid_for_power_update_event(instance, tag):"},{"line_number":251,"context_line":"    \"\"\"Check if the current state of the instance allows it to be"},{"line_number":252,"context_line":"    a candidate for the power-update event."},{"line_number":253,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7faddb67_f918c3d3","line":250,"updated":"2019-08-14 16:10:45.000000000","message":"Based on IRC discussion today I think this moves to the compute manager.","commit_id":"f7677c0bec4d3f350e07e04fb5518c622e641c4b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7011c8d687547c0e5b095bb80fcfc56f5c6749e6","unresolved":false,"context_lines":[{"line_number":4704,"context_line":"        LOG.debug(\"Trying to %(state)s instance\","},{"line_number":4705,"context_line":"                  {\u0027state\u0027: tag}, instance\u003dinstance)"},{"line_number":4706,"context_line":"        if tag \u003d\u003d external_event_obj.POWER_ON:"},{"line_number":4707,"context_line":"            instance.task_state \u003d task_states.POWERING_ON"},{"line_number":4708,"context_line":"            instance.save(expected_task_state\u003d[None])"},{"line_number":4709,"context_line":"            self._record_action_start("},{"line_number":4710,"context_line":"                context, instance, instance_actions.START)"},{"line_number":4711,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7faddb67_7924d30d","line":4708,"range":{"start_line":4707,"start_character":12,"end_line":4708,"end_character":53},"updated":"2019-08-14 16:10:45.000000000","message":"This and below move to the compute manager as well based on discussion today. Note that you have to handle UnexpectedTaskStateError so you don\u0027t blow up all events in the same request on the same host.","commit_id":"f7677c0bec4d3f350e07e04fb5518c622e641c4b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7011c8d687547c0e5b095bb80fcfc56f5c6749e6","unresolved":false,"context_lines":[{"line_number":4706,"context_line":"        if tag \u003d\u003d external_event_obj.POWER_ON:"},{"line_number":4707,"context_line":"            instance.task_state \u003d task_states.POWERING_ON"},{"line_number":4708,"context_line":"            instance.save(expected_task_state\u003d[None])"},{"line_number":4709,"context_line":"            self._record_action_start("},{"line_number":4710,"context_line":"                context, instance, instance_actions.START)"},{"line_number":4711,"context_line":"        else:"},{"line_number":4712,"context_line":"            # It\u0027s POWER_OFF"}],"source_content_type":"text/x-python","patch_set":12,"id":"7faddb67_391adbc5","line":4709,"updated":"2019-08-14 16:10:45.000000000","message":"This stays in the API (and below).","commit_id":"f7677c0bec4d3f350e07e04fb5518c622e641c4b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":4703,"context_line":"                elif event.tag \u003d\u003d external_event_obj.POWER_OFF:"},{"line_number":4704,"context_line":"                    inst_action \u003d instance_actions.STOP"},{"line_number":4705,"context_line":"                else:"},{"line_number":4706,"context_line":"                    LOG.info(\"Invalid power state %s. Cannot process \""},{"line_number":4707,"context_line":"                             \"the event %s. Skipping it.\", event.tag,"},{"line_number":4708,"context_line":"                             event)"},{"line_number":4709,"context_line":"                    continue"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_785cbb18","line":4706,"range":{"start_line":4706,"start_character":24,"end_line":4706,"end_character":28},"updated":"2019-08-15 15:18:06.000000000","message":"This should probably be a warning.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":4703,"context_line":"                elif event.tag \u003d\u003d external_event_obj.POWER_OFF:"},{"line_number":4704,"context_line":"                    inst_action \u003d instance_actions.STOP"},{"line_number":4705,"context_line":"                else:"},{"line_number":4706,"context_line":"                    LOG.info(\"Invalid power state %s. Cannot process \""},{"line_number":4707,"context_line":"                             \"the event %s. Skipping it.\", event.tag,"},{"line_number":4708,"context_line":"                             event)"},{"line_number":4709,"context_line":"                    continue"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_f8e74be2","line":4706,"range":{"start_line":4706,"start_character":24,"end_line":4706,"end_character":28},"in_reply_to":"7faddb67_785cbb18","updated":"2019-08-15 16:05:59.000000000","message":"yea I couldn\u0027t decide between the two, I\u0027ll make it warning then.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"}],"nova/compute/manager.py":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"6d79fc429e4476f9c27dffd8f9a671f628eb77e9","unresolved":false,"context_lines":[{"line_number":8395,"context_line":"                            \u0027this instance does not support the \u0027"},{"line_number":8396,"context_line":"                            \u0027power-update event\u0027, instance\u003dinstance)"},{"line_number":8397,"context_line":"                raise"},{"line_number":8398,"context_line":"            instance.power_state \u003d self._get_power_state(context, instance)"},{"line_number":8399,"context_line":"            instance.vm_state \u003d vm_states.ACTIVE"},{"line_number":8400,"context_line":"            instance.task_state \u003d None"},{"line_number":8401,"context_line":"            instance.save(expected_task_state\u003dtask_states.POWERING_ON)"}],"source_content_type":"text/x-python","patch_set":2,"id":"dfbec78f_afc2d957","line":8398,"range":{"start_line":8398,"start_character":12,"end_line":8398,"end_character":75},"updated":"2019-05-13 19:43:20.000000000","message":"maybe this is not needed since its just a recheck as its already done in the driver.","commit_id":"d45cd33a28a8f6feddf4c7dbb96c47711ce7bf77"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"71a4499e05520b7b41fb62faebdd08350ba56123","unresolved":false,"context_lines":[{"line_number":2882,"context_line":"    @reverts_task_state"},{"line_number":2883,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":2884,"context_line":"    @wrap_instance_fault"},{"line_number":2885,"context_line":"    def start_instance(self, context, instance, call_driver\u003dTrue):"},{"line_number":2886,"context_line":"        \"\"\"Starting an instance on this host.\"\"\""},{"line_number":2887,"context_line":"        self._notify_about_instance_usage(context, instance, \"power_on.start\")"},{"line_number":2888,"context_line":"        compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_fface79f","line":2885,"updated":"2019-06-12 13:58:04.000000000","message":"left-overs: cleanup","commit_id":"f22275e5feca544d244f5be17803f4a05bddfe77"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":8663,"context_line":"                LOG.warning(\u0027Power Update failed because the driver backing \u0027"},{"line_number":8664,"context_line":"                            \u0027this instance does not support the \u0027"},{"line_number":8665,"context_line":"                            \u0027power-update event\u0027, instance\u003dinstance)"},{"line_number":8666,"context_line":"                raise"},{"line_number":8667,"context_line":"            instance.vm_state \u003d vm_states.ACTIVE"},{"line_number":8668,"context_line":"            instance.task_state \u003d None"},{"line_number":8669,"context_line":"            instance.save(expected_task_state\u003dtask_states.POWERING_ON)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_5ce51308","line":8666,"updated":"2019-07-16 10:51:16.000000000","message":"This exception will be lost as this rpc is a cast. Still I guess this is OK to re-reaise to stop the execution of this function.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":8663,"context_line":"                LOG.warning(\u0027Power Update failed because the driver backing \u0027"},{"line_number":8664,"context_line":"                            \u0027this instance does not support the \u0027"},{"line_number":8665,"context_line":"                            \u0027power-update event\u0027, instance\u003dinstance)"},{"line_number":8666,"context_line":"                raise"},{"line_number":8667,"context_line":"            instance.vm_state \u003d vm_states.ACTIVE"},{"line_number":8668,"context_line":"            instance.task_state \u003d None"},{"line_number":8669,"context_line":"            instance.save(expected_task_state\u003dtask_states.POWERING_ON)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_8d534539","line":8666,"in_reply_to":"7faddb67_5ce51308","updated":"2019-07-18 11:32:53.000000000","message":"yea, you are right. I don\u0027t think I have to catch this explicitly since in the virt driver its raised anyways.\n\nBased on the double save() thing you mentioned in the below comment, I have moved the vm_state/task_state saving also to the driver.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":8666,"context_line":"                raise"},{"line_number":8667,"context_line":"            instance.vm_state \u003d vm_states.ACTIVE"},{"line_number":8668,"context_line":"            instance.task_state \u003d None"},{"line_number":8669,"context_line":"            instance.save(expected_task_state\u003dtask_states.POWERING_ON)"},{"line_number":8670,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8671,"context_line":"                                              \"power_on.end\")"},{"line_number":8672,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_1ceebbb3","line":8669,"updated":"2019-07-16 10:51:16.000000000","message":"There will be two instance.save() calls for each power-update in case of ironic driver. I don\u0027t know if this can cause any real performance issues.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":8666,"context_line":"                raise"},{"line_number":8667,"context_line":"            instance.vm_state \u003d vm_states.ACTIVE"},{"line_number":8668,"context_line":"            instance.task_state \u003d None"},{"line_number":8669,"context_line":"            instance.save(expected_task_state\u003dtask_states.POWERING_ON)"},{"line_number":8670,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8671,"context_line":"                                              \"power_on.end\")"},{"line_number":8672,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_cd5dbd47","line":8669,"in_reply_to":"7faddb67_1ceebbb3","updated":"2019-07-18 11:32:53.000000000","message":"\u003e There will be two instance.save() calls for each power-update in\n \u003e case of ironic driver. I don\u0027t know if this can cause any real\n \u003e performance issues.\n\nhmm, yea I didn\u0027t think about this, if its an issue the other way forward would be to also save the vm_state and task_state back in the driver itself. In fact as per the spec the vm_state update will also be done in the driver. So I can move it there.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"917adfaaac707d9af251db0a985b26c7aebc00c5","unresolved":false,"context_lines":[{"line_number":8647,"context_line":"    @reverts_task_state"},{"line_number":8648,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":8649,"context_line":"    @wrap_instance_fault"},{"line_number":8650,"context_line":"    def power_update(self, context, instance, target_power_state):"},{"line_number":8651,"context_line":"        LOG.debug(\u0027Handling power-update event for instance\u0027,"},{"line_number":8652,"context_line":"                  instance\u003dinstance)"},{"line_number":8653,"context_line":"        if target_power_state \u003d\u003d \"POWER_ON\":"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_508ee8d0","line":8650,"updated":"2019-07-23 16:55:51.000000000","message":"As Eric mentioned in a top-level comment, why don\u0027t we lock on the instance.uuid in this method so we can lock against a race with the sync task running at the same time as we\u0027re processing the event? Note that stop_instance already locks on instance.uuid but start_instance doesn\u0027t. I\u0027m not sure if start_instance needs to worry about a lock or not, the power state sync task will only stop an instance, never start it.\n\nThe scenario I\u0027m thinking is something like:\n\nt0: we get the event and pass the api checks for vm/task/power state\n\nt1: the sync task starts running before the instance.task_state is set by the api and it calls api.stop_instance\n\nt2: the compute gets the event and starts processing it\n\nt3. the compute stops the instance and clears the task_state while the t2 thread is processing it in the driver\n\nI think either way one of those is going to lose the race and the instance.save() will likely fail with UnexpectedTaskStateError so maybe the lock is not a major concern.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0dd780ad4699d6f860eea908c5d0abddee77137b","unresolved":false,"context_lines":[{"line_number":8647,"context_line":"    @reverts_task_state"},{"line_number":8648,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":8649,"context_line":"    @wrap_instance_fault"},{"line_number":8650,"context_line":"    def power_update(self, context, instance, target_power_state):"},{"line_number":8651,"context_line":"        LOG.debug(\u0027Handling power-update event for instance\u0027,"},{"line_number":8652,"context_line":"                  instance\u003dinstance)"},{"line_number":8653,"context_line":"        if target_power_state \u003d\u003d \"POWER_ON\":"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_f0611413","line":8650,"in_reply_to":"7faddb67_508ee8d0","updated":"2019-07-23 16:58:07.000000000","message":"If we decide not to lock, I\u0027m thinking we should have a code comment summarizing the above, just to show we\u0027ve thought it through and accepted the risk.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":8647,"context_line":"    @reverts_task_state"},{"line_number":8648,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":8649,"context_line":"    @wrap_instance_fault"},{"line_number":8650,"context_line":"    def power_update(self, context, instance, target_power_state):"},{"line_number":8651,"context_line":"        LOG.debug(\u0027Handling power-update event for instance\u0027,"},{"line_number":8652,"context_line":"                  instance\u003dinstance)"},{"line_number":8653,"context_line":"        if target_power_state \u003d\u003d \"POWER_ON\":"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_fbf1e902","line":8650,"in_reply_to":"7faddb67_f0611413","updated":"2019-07-25 15:19:21.000000000","message":"I am looking into the locking mechanism. I feel we should do it like outlined in the spec for both start and stop just to lock the resource update on the instance object to avoid unnecessary hazel.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":8648,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":8649,"context_line":"    @wrap_instance_fault"},{"line_number":8650,"context_line":"    def power_update(self, context, instance, target_power_state):"},{"line_number":8651,"context_line":"        LOG.debug(\u0027Handling power-update event for instance\u0027,"},{"line_number":8652,"context_line":"                  instance\u003dinstance)"},{"line_number":8653,"context_line":"        if target_power_state \u003d\u003d \"POWER_ON\":"},{"line_number":8654,"context_line":"            self._notify_about_instance_usage(context, instance,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_ad334562","line":8651,"range":{"start_line":8651,"start_character":41,"end_line":8651,"end_character":46},"updated":"2019-07-23 16:17:38.000000000","message":"Would be good to include the target_power_state value in this debug message.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":8648,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":8649,"context_line":"    @wrap_instance_fault"},{"line_number":8650,"context_line":"    def power_update(self, context, instance, target_power_state):"},{"line_number":8651,"context_line":"        LOG.debug(\u0027Handling power-update event for instance\u0027,"},{"line_number":8652,"context_line":"                  instance\u003dinstance)"},{"line_number":8653,"context_line":"        if target_power_state \u003d\u003d \"POWER_ON\":"},{"line_number":8654,"context_line":"            self._notify_about_instance_usage(context, instance,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_dbc74d45","line":8651,"range":{"start_line":8651,"start_character":41,"end_line":8651,"end_character":46},"in_reply_to":"7faddb67_ad334562","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":8650,"context_line":"    def power_update(self, context, instance, target_power_state):"},{"line_number":8651,"context_line":"        LOG.debug(\u0027Handling power-update event for instance\u0027,"},{"line_number":8652,"context_line":"                  instance\u003dinstance)"},{"line_number":8653,"context_line":"        if target_power_state \u003d\u003d \"POWER_ON\":"},{"line_number":8654,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8655,"context_line":"                                              \"power_on.start\")"},{"line_number":8656,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_cd38013f","line":8653,"range":{"start_line":8653,"start_character":33,"end_line":8653,"end_character":43},"updated":"2019-07-23 16:17:38.000000000","message":"I\u0027m beginning to feel like we should have constants defined for these values in the API module rather than hard-code this in multiple places.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":8650,"context_line":"    def power_update(self, context, instance, target_power_state):"},{"line_number":8651,"context_line":"        LOG.debug(\u0027Handling power-update event for instance\u0027,"},{"line_number":8652,"context_line":"                  instance\u003dinstance)"},{"line_number":8653,"context_line":"        if target_power_state \u003d\u003d \"POWER_ON\":"},{"line_number":8654,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8655,"context_line":"                                              \"power_on.start\")"},{"line_number":8656,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_cc8471b4","line":8653,"range":{"start_line":8653,"start_character":33,"end_line":8653,"end_character":43},"in_reply_to":"7faddb67_cd38013f","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":8656,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"},{"line_number":8657,"context_line":"                self.host, action\u003dfields.NotificationAction.POWER_ON,"},{"line_number":8658,"context_line":"                phase\u003dfields.NotificationPhase.START)"},{"line_number":8659,"context_line":"            self.driver.power_update_event("},{"line_number":8660,"context_line":"                context, instance, target_power_state)"},{"line_number":8661,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8662,"context_line":"                                              \"power_on.end\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_ad44a575","line":8659,"range":{"start_line":8659,"start_character":24,"end_line":8659,"end_character":42},"updated":"2019-07-23 16:17:38.000000000","message":"Why don\u0027t we handle NotImplementedError for these calls?","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":8656,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"},{"line_number":8657,"context_line":"                self.host, action\u003dfields.NotificationAction.POWER_ON,"},{"line_number":8658,"context_line":"                phase\u003dfields.NotificationPhase.START)"},{"line_number":8659,"context_line":"            self.driver.power_update_event("},{"line_number":8660,"context_line":"                context, instance, target_power_state)"},{"line_number":8661,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8662,"context_line":"                                              \"power_on.end\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_bb961194","line":8659,"range":{"start_line":8659,"start_character":24,"end_line":8659,"end_character":42},"in_reply_to":"7faddb67_ad44a575","updated":"2019-07-25 15:19:21.000000000","message":"\u003e Why don\u0027t we handle NotImplementedError for these calls?\n\nI used to handle it in the previous patch set (see me and gibi talking about it) but decided to not do it to maintain consistency. The error is raised from the driver and it seems in the compute manager we don\u0027t actually handle it explicitly (for actions like pause on the ironic driver).","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"79018867b9c4d3e968f7710450e2f1602bc84846","unresolved":false,"context_lines":[{"line_number":8668,"context_line":"        def do_power_update():"},{"line_number":8669,"context_line":"            LOG.debug(\u0027Handling power-update event with target_power_state %s \u0027"},{"line_number":8670,"context_line":"                      \u0027for instance\u0027, target_power_state, instance\u003dinstance)"},{"line_number":8671,"context_line":"            if target_power_state \u003d\u003d common.POWER_UPDATE_EVENT_VALID_TAGS[0]:"},{"line_number":8672,"context_line":"                self._notify_about_instance_usage(context, instance,"},{"line_number":8673,"context_line":"                                                  \"power_on.start\")"},{"line_number":8674,"context_line":"                compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_c58ae662","line":8671,"range":{"start_line":8671,"start_character":73,"end_line":8671,"end_character":76},"updated":"2019-08-12 15:09:43.000000000","message":"likewise, using a numeric index here is not pretty IMO","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"01e6706c208ba0cce225c5450e6fc4412adfe0ac","unresolved":false,"context_lines":[{"line_number":8668,"context_line":"        def do_power_update():"},{"line_number":8669,"context_line":"            LOG.debug(\u0027Handling power-update event with target_power_state %s \u0027"},{"line_number":8670,"context_line":"                      \u0027for instance\u0027, target_power_state, instance\u003dinstance)"},{"line_number":8671,"context_line":"            if target_power_state \u003d\u003d common.POWER_UPDATE_EVENT_VALID_TAGS[0]:"},{"line_number":8672,"context_line":"                self._notify_about_instance_usage(context, instance,"},{"line_number":8673,"context_line":"                                                  \"power_on.start\")"},{"line_number":8674,"context_line":"                compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_45a03643","line":8671,"range":{"start_line":8671,"start_character":73,"end_line":8671,"end_character":76},"in_reply_to":"7faddb67_c58ae662","updated":"2019-08-12 16:24:08.000000000","message":"agreed, I am not sure why I complicated this.","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"88f1e2bb65ab5367f58704adf7b72b5e3da89487","unresolved":false,"context_lines":[{"line_number":8691,"context_line":"                                                  \"power_off.end\")"},{"line_number":8692,"context_line":"                compute_utils.notify_about_instance_action(context, instance,"},{"line_number":8693,"context_line":"                    self.host, action\u003dfields.NotificationAction.POWER_OFF,"},{"line_number":8694,"context_line":"                    phase\u003dfields.NotificationPhase.END)"},{"line_number":8695,"context_line":"        do_power_update()"},{"line_number":8696,"context_line":""},{"line_number":8697,"context_line":"    @wrap_exception()"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_e2f7d88b","line":8694,"updated":"2019-08-12 14:48:59.000000000","message":"Seems like a lot of this could be unified, just collecting the constants we need conditionally and then making all these calls.\n\n if target_power_state \u003d\u003d common.POWER_ON:\n     action \u003d fields.NotificationAction.POWER_ON\n     notification_name \u003d \u0027power_on.%s\u0027\n\nand so on.","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"e2f0a7c3bfcfcf2f01217211f572201fec7e350f","unresolved":false,"context_lines":[{"line_number":8691,"context_line":"                                                  \"power_off.end\")"},{"line_number":8692,"context_line":"                compute_utils.notify_about_instance_action(context, instance,"},{"line_number":8693,"context_line":"                    self.host, action\u003dfields.NotificationAction.POWER_OFF,"},{"line_number":8694,"context_line":"                    phase\u003dfields.NotificationPhase.END)"},{"line_number":8695,"context_line":"        do_power_update()"},{"line_number":8696,"context_line":""},{"line_number":8697,"context_line":"    @wrap_exception()"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_85386e9f","line":8694,"in_reply_to":"7faddb67_e2f7d88b","updated":"2019-08-12 15:25:51.000000000","message":"oh yea good point!","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":2842,"context_line":"    def stop_instance(self, context, instance, clean_shutdown):"},{"line_number":2843,"context_line":"        \"\"\"Stopping an instance on this host.\"\"\""},{"line_number":2844,"context_line":""},{"line_number":2845,"context_line":"        @utils.synchronized(instance.uuid)"},{"line_number":2846,"context_line":"        def do_stop_instance():"},{"line_number":2847,"context_line":"            current_power_state \u003d self._get_power_state(context, instance)"},{"line_number":2848,"context_line":"            LOG.debug(\u0027Stopping instance; current vm_state: %(vm_state)s, \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_e74fd4bb","line":2845,"updated":"2019-08-13 14:30:42.000000000","message":"✔","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":2869,"context_line":"                         instance\u003dinstance)"},{"line_number":2870,"context_line":"                expected_task_state.append(None)"},{"line_number":2871,"context_line":""},{"line_number":2872,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":2873,"context_line":"                                              \"power_off.start\")"},{"line_number":2874,"context_line":""},{"line_number":2875,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"},{"line_number":2876,"context_line":"                        self.host, action\u003dfields.NotificationAction.POWER_OFF,"},{"line_number":2877,"context_line":"                        phase\u003dfields.NotificationPhase.START)"},{"line_number":2878,"context_line":""},{"line_number":2879,"context_line":"            self._power_off_instance(context, instance, clean_shutdown)"},{"line_number":2880,"context_line":"            instance.power_state \u003d self._get_power_state(context, instance)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_67c9a423","line":2877,"range":{"start_line":2872,"start_character":12,"end_line":2877,"end_character":61},"updated":"2019-08-13 14:30:42.000000000","message":"✔","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":2881,"context_line":"            instance.vm_state \u003d vm_states.STOPPED"},{"line_number":2882,"context_line":"            instance.task_state \u003d None"},{"line_number":2883,"context_line":"            instance.save(expected_task_state\u003dexpected_task_state)"},{"line_number":2884,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":2885,"context_line":"                                              \"power_off.end\")"},{"line_number":2886,"context_line":""},{"line_number":2887,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"},{"line_number":2888,"context_line":"                        self.host, action\u003dfields.NotificationAction.POWER_OFF,"},{"line_number":2889,"context_line":"                        phase\u003dfields.NotificationPhase.END)"},{"line_number":2890,"context_line":""},{"line_number":2891,"context_line":"        do_stop_instance()"},{"line_number":2892,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_07d0f0c8","line":2889,"range":{"start_line":2884,"start_character":12,"end_line":2889,"end_character":59},"updated":"2019-08-13 14:30:42.000000000","message":"✔","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":2920,"context_line":"    @reverts_task_state"},{"line_number":2921,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":2922,"context_line":"    @wrap_instance_fault"},{"line_number":2923,"context_line":"    def start_instance(self, context, instance):"},{"line_number":2924,"context_line":"        \"\"\"Starting an instance on this host.\"\"\""},{"line_number":2925,"context_line":"        self._notify_about_instance_usage(context, instance, \"power_on.start\")"},{"line_number":2926,"context_line":"        compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_4794a8e8","line":2923,"updated":"2019-08-13 14:30:42.000000000","message":"I guess we don\u0027t lock on the instance.uuid in here like in stop_instance.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":2920,"context_line":"    @reverts_task_state"},{"line_number":2921,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":2922,"context_line":"    @wrap_instance_fault"},{"line_number":2923,"context_line":"    def start_instance(self, context, instance):"},{"line_number":2924,"context_line":"        \"\"\"Starting an instance on this host.\"\"\""},{"line_number":2925,"context_line":"        self._notify_about_instance_usage(context, instance, \"power_on.start\")"},{"line_number":2926,"context_line":"        compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_a79d4b0b","line":2923,"in_reply_to":"7faddb67_4794a8e8","updated":"2019-08-14 12:54:15.000000000","message":"yea, not sure why though (maybe it has something to do with stop_instance modifying instance.progress and start_instance not doing that ? maybe not)","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":2922,"context_line":"    @wrap_instance_fault"},{"line_number":2923,"context_line":"    def start_instance(self, context, instance):"},{"line_number":2924,"context_line":"        \"\"\"Starting an instance on this host.\"\"\""},{"line_number":2925,"context_line":"        self._notify_about_instance_usage(context, instance, \"power_on.start\")"},{"line_number":2926,"context_line":"        compute_utils.notify_about_instance_action(context, instance,"},{"line_number":2927,"context_line":"            self.host, action\u003dfields.NotificationAction.POWER_ON,"},{"line_number":2928,"context_line":"            phase\u003dfields.NotificationPhase.START)"},{"line_number":2929,"context_line":"        self._power_on(context, instance)"},{"line_number":2930,"context_line":"        instance.power_state \u003d self._get_power_state(context, instance)"},{"line_number":2931,"context_line":"        instance.vm_state \u003d vm_states.ACTIVE"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_c702d83e","line":2928,"range":{"start_line":2925,"start_character":8,"end_line":2928,"end_character":49},"updated":"2019-08-13 14:30:42.000000000","message":"✔","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":2941,"context_line":"        compute_utils.remove_shelved_keys_from_system_metadata(instance)"},{"line_number":2942,"context_line":""},{"line_number":2943,"context_line":"        instance.save(expected_task_state\u003dtask_states.POWERING_ON)"},{"line_number":2944,"context_line":"        self._notify_about_instance_usage(context, instance, \"power_on.end\")"},{"line_number":2945,"context_line":"        compute_utils.notify_about_instance_action(context, instance,"},{"line_number":2946,"context_line":"            self.host, action\u003dfields.NotificationAction.POWER_ON,"},{"line_number":2947,"context_line":"            phase\u003dfields.NotificationPhase.END)"},{"line_number":2948,"context_line":""},{"line_number":2949,"context_line":"    @messaging.expected_exceptions(NotImplementedError,"},{"line_number":2950,"context_line":"                                   exception.TriggerCrashDumpNotSupported,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_e7fd943b","line":2947,"range":{"start_line":2944,"start_character":8,"end_line":2947,"end_character":47},"updated":"2019-08-13 14:30:42.000000000","message":"✔","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":8654,"context_line":"            raise"},{"line_number":8655,"context_line":""},{"line_number":8656,"context_line":"    @wrap_exception()"},{"line_number":8657,"context_line":"    @reverts_task_state"},{"line_number":8658,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":8659,"context_line":"    @wrap_instance_fault"},{"line_number":8660,"context_line":"    def power_update(self, context, instance, target_power_state):"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_a770fc09","line":8657,"updated":"2019-08-13 14:30:42.000000000","message":"I know that we talked about this before, but if we\u0027re getting a power-update event for an instance on a Stein compute, the API will set the task_state on the instance and cast off to the old compute service which won\u0027t do anything with the event but the instance\u0027s task_state will be stuck and the admin will have to reset the state using the os-resetState API. That\u0027s not so great, especially considering we\u0027ve always told deployers that you must upgrade ironic before nova (though ironic won\u0027t be able to send the even until the nova API service is upgraded to expose the microversion, but still, we could have old compute services during a rolling upgrade). If we aren\u0027t going to have compute service version checking in the API, let\u0027s be sure to mention something in the release note that this won\u0027t work for instances running on older compute services during a rolling upgrade.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":8654,"context_line":"            raise"},{"line_number":8655,"context_line":""},{"line_number":8656,"context_line":"    @wrap_exception()"},{"line_number":8657,"context_line":"    @reverts_task_state"},{"line_number":8658,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":8659,"context_line":"    @wrap_instance_fault"},{"line_number":8660,"context_line":"    def power_update(self, context, instance, target_power_state):"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_47701709","line":8657,"in_reply_to":"7faddb67_a770fc09","updated":"2019-08-14 12:54:15.000000000","message":"\u003e I know that we talked about this before, but if we\u0027re getting a\n \u003e power-update event for an instance on a Stein compute, the API will\n \u003e set the task_state on the instance and cast off to the old compute\n \u003e service which won\u0027t do anything with the event but the instance\u0027s\n \u003e task_state will be stuck and the admin will have to reset the state\n \u003e using the os-resetState API. That\u0027s not so great, especially\n \u003e considering we\u0027ve always told deployers that you must upgrade\n \u003e ironic before nova (though ironic won\u0027t be able to send the even\n \u003e until the nova API service is upgraded to expose the microversion,\n \u003e but still, we could have old compute services during a rolling\n \u003e upgrade). If we aren\u0027t going to have compute service version\n \u003e checking in the API, let\u0027s be sure to mention something in the\n \u003e release note that this won\u0027t work for instances running on older\n \u003e compute services during a rolling upgrade.\n\nack, yea its important to put that info out.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":8655,"context_line":""},{"line_number":8656,"context_line":"    @wrap_exception()"},{"line_number":8657,"context_line":"    @reverts_task_state"},{"line_number":8658,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":8659,"context_line":"    @wrap_instance_fault"},{"line_number":8660,"context_line":"    def power_update(self, context, instance, target_power_state):"},{"line_number":8661,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_39867467","line":8658,"range":{"start_line":8658,"start_character":5,"end_line":8658,"end_character":24},"updated":"2019-08-13 14:30:42.000000000","message":"Nothing in tests is asserting that this is on this method, meaning if I removed this decorator nothing would fail in tests. The functional test is asserting the API creates the action records, but the test_compute_mgr tests aren\u0027t asserting that the \"compute_power_update\" even is created for the action. You could do that in the functional test pretty easily, or in the unit test - though the unit test is probably stubbing out what this does under the covers. Functional is probably more robust for test coverage.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":8655,"context_line":""},{"line_number":8656,"context_line":"    @wrap_exception()"},{"line_number":8657,"context_line":"    @reverts_task_state"},{"line_number":8658,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":8659,"context_line":"    @wrap_instance_fault"},{"line_number":8660,"context_line":"    def power_update(self, context, instance, target_power_state):"},{"line_number":8661,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_804fd5bc","line":8658,"range":{"start_line":8658,"start_character":5,"end_line":8658,"end_character":24},"in_reply_to":"7faddb67_39867467","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":8657,"context_line":"    @reverts_task_state"},{"line_number":8658,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":8659,"context_line":"    @wrap_instance_fault"},{"line_number":8660,"context_line":"    def power_update(self, context, instance, target_power_state):"},{"line_number":8661,"context_line":""},{"line_number":8662,"context_line":"        @utils.synchronized(instance.uuid)"},{"line_number":8663,"context_line":"        def do_power_update():"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_874700bd","line":8660,"updated":"2019-08-13 14:30:42.000000000","message":"nit: would be good to document these parameters, especially target_power_state so it\u0027s not confused with nova.compute.power_state enum values.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":8657,"context_line":"    @reverts_task_state"},{"line_number":8658,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":8659,"context_line":"    @wrap_instance_fault"},{"line_number":8660,"context_line":"    def power_update(self, context, instance, target_power_state):"},{"line_number":8661,"context_line":""},{"line_number":8662,"context_line":"        @utils.synchronized(instance.uuid)"},{"line_number":8663,"context_line":"        def do_power_update():"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_47f7b75a","line":8660,"in_reply_to":"7faddb67_874700bd","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":8673,"context_line":"                                              notification_name + \"start\")"},{"line_number":8674,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"},{"line_number":8675,"context_line":"                self.host, action\u003daction, phase\u003dfields.NotificationPhase.START)"},{"line_number":8676,"context_line":"            self.driver.power_update_event(instance, target_power_state)"},{"line_number":8677,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8678,"context_line":"                                              notification_name + \"end\")"},{"line_number":8679,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_07e9d07e","line":8676,"updated":"2019-08-13 14:30:42.000000000","message":"OK so this *must* set the task_state to None otherwise, unless there is an error to trigger @reverts_task_state, the instance task_state would be stuck in a non-None state until the admin resets it.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":8673,"context_line":"                                              notification_name + \"start\")"},{"line_number":8674,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"},{"line_number":8675,"context_line":"                self.host, action\u003daction, phase\u003dfields.NotificationPhase.START)"},{"line_number":8676,"context_line":"            self.driver.power_update_event(instance, target_power_state)"},{"line_number":8677,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8678,"context_line":"                                              notification_name + \"end\")"},{"line_number":8679,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_a7e8eb7b","line":8676,"in_reply_to":"7faddb67_07e9d07e","updated":"2019-08-14 12:54:15.000000000","message":"yea its done in the driver","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7011c8d687547c0e5b095bb80fcfc56f5c6749e6","unresolved":false,"context_lines":[{"line_number":8670,"context_line":"        def do_power_update():"},{"line_number":8671,"context_line":"            LOG.debug(\u0027Handling power-update event with target_power_state %s \u0027"},{"line_number":8672,"context_line":"                      \u0027for instance\u0027, target_power_state, instance\u003dinstance)"},{"line_number":8673,"context_line":"            if target_power_state \u003d\u003d external_event_obj.POWER_ON:"},{"line_number":8674,"context_line":"                action \u003d fields.NotificationAction.POWER_ON"},{"line_number":8675,"context_line":"                notification_name \u003d \"power_on.\""},{"line_number":8676,"context_line":"            else:"},{"line_number":8677,"context_line":"                action \u003d fields.NotificationAction.POWER_OFF"},{"line_number":8678,"context_line":"                notification_name \u003d \"power_off.\""},{"line_number":8679,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8680,"context_line":"                                              notification_name + \"start\")"},{"line_number":8681,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":12,"id":"7faddb67_5955574f","line":8678,"range":{"start_line":8673,"start_character":12,"end_line":8678,"end_character":48},"updated":"2019-08-14 16:10:45.000000000","message":"Set the instance task_state in here and handle UnexpectedTaskStateError - log something and return so you don\u0027t blow up other events in the same request.","commit_id":"f7677c0bec4d3f350e07e04fb5518c622e641c4b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":8653,"context_line":"                        instance\u003dinstance)"},{"line_number":8654,"context_line":"            raise"},{"line_number":8655,"context_line":""},{"line_number":8656,"context_line":"    def _is_state_valid_for_power_update_event(self, instance, tag):"},{"line_number":8657,"context_line":"        \"\"\"Check if the current state of the instance allows it to be"},{"line_number":8658,"context_line":"        a candidate for the power-update event."},{"line_number":8659,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_d8792f82","line":8656,"updated":"2019-08-15 15:18:06.000000000","message":"nit: this could be a @staticmethod","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":8653,"context_line":"                        instance\u003dinstance)"},{"line_number":8654,"context_line":"            raise"},{"line_number":8655,"context_line":""},{"line_number":8656,"context_line":"    def _is_state_valid_for_power_update_event(self, instance, tag):"},{"line_number":8657,"context_line":"        \"\"\"Check if the current state of the instance allows it to be"},{"line_number":8658,"context_line":"        a candidate for the power-update event."},{"line_number":8659,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_5369a089","line":8656,"in_reply_to":"7faddb67_d8792f82","updated":"2019-08-15 16:05:59.000000000","message":"Done","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":8658,"context_line":"        a candidate for the power-update event."},{"line_number":8659,"context_line":""},{"line_number":8660,"context_line":"        :param instance: The nova instance object."},{"line_number":8661,"context_line":"        :param tag: The desired target power state; this should either be"},{"line_number":8662,"context_line":"                    \"POWER_ON\" or \"POWER_OFF\"."},{"line_number":8663,"context_line":"        :returns Boolean: True if the instance can be subjected to the"},{"line_number":8664,"context_line":"                        power-update event."}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_18e90719","line":8661,"range":{"start_line":8661,"start_character":15,"end_line":8661,"end_character":18},"updated":"2019-08-15 15:18:06.000000000","message":"This is a bit confusing, how about just naming this target_power_state.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":8658,"context_line":"        a candidate for the power-update event."},{"line_number":8659,"context_line":""},{"line_number":8660,"context_line":"        :param instance: The nova instance object."},{"line_number":8661,"context_line":"        :param tag: The desired target power state; this should either be"},{"line_number":8662,"context_line":"                    \"POWER_ON\" or \"POWER_OFF\"."},{"line_number":8663,"context_line":"        :returns Boolean: True if the instance can be subjected to the"},{"line_number":8664,"context_line":"                        power-update event."}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_93f878c4","line":8661,"range":{"start_line":8661,"start_character":15,"end_line":8661,"end_character":18},"in_reply_to":"7faddb67_18e90719","updated":"2019-08-15 16:05:59.000000000","message":"Done","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":8706,"context_line":"                         \u0027power_state\u0027: pow_state})"},{"line_number":8707,"context_line":"                return"},{"line_number":8708,"context_line":"            LOG.debug(\"Trying to %(state)s instance\","},{"line_number":8709,"context_line":"                      {\u0027state\u0027: target_power_state}, instance\u003dinstance)"},{"line_number":8710,"context_line":"            if target_power_state \u003d\u003d external_event_obj.POWER_ON:"},{"line_number":8711,"context_line":"                action \u003d fields.NotificationAction.POWER_ON"},{"line_number":8712,"context_line":"                notification_name \u003d \"power_on.\""}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_18d2675d","line":8709,"range":{"start_line":8709,"start_character":22,"end_line":8709,"end_character":51},"updated":"2019-08-15 15:18:06.000000000","message":"nit: don\u0027t really need the dict for variable substitution here, we aren\u0027t translating this message.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":8706,"context_line":"                         \u0027power_state\u0027: pow_state})"},{"line_number":8707,"context_line":"                return"},{"line_number":8708,"context_line":"            LOG.debug(\"Trying to %(state)s instance\","},{"line_number":8709,"context_line":"                      {\u0027state\u0027: target_power_state}, instance\u003dinstance)"},{"line_number":8710,"context_line":"            if target_power_state \u003d\u003d external_event_obj.POWER_ON:"},{"line_number":8711,"context_line":"                action \u003d fields.NotificationAction.POWER_ON"},{"line_number":8712,"context_line":"                notification_name \u003d \"power_on.\""}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_53ec40f3","line":8709,"range":{"start_line":8709,"start_character":22,"end_line":8709,"end_character":51},"in_reply_to":"7faddb67_18d2675d","updated":"2019-08-15 16:05:59.000000000","message":"Done","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":8718,"context_line":"                instance.task_state \u003d task_states.POWERING_OFF"},{"line_number":8719,"context_line":"                instance.progress \u003d 0"},{"line_number":8720,"context_line":"            try:"},{"line_number":8721,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":8722,"context_line":"            except exception.UnexpectedTaskStateError as e:"},{"line_number":8723,"context_line":"                LOG.info(\"The power-update event was possibly preempted: %s \""},{"line_number":8724,"context_line":"                         \"for instance\", e.format_message(), instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_984ad724","line":8721,"updated":"2019-08-15 15:18:06.000000000","message":"It would probably be good to add a comment about why we\u0027re setting the task_state here rather than in the API (which is where we\u0027d normally set the task_state to lock the instance down from concurrent actions on the instance). I think it\u0027s essentially because this is a best effort operation and deferring updating the task_state until we get to the compute service avoids error handling in the API and needing to account for older compute services during rolling upgrades from Stein.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d8941968c81c292abacca4cf574fb819c57f6b5","unresolved":false,"context_lines":[{"line_number":8718,"context_line":"                instance.task_state \u003d task_states.POWERING_OFF"},{"line_number":8719,"context_line":"                instance.progress \u003d 0"},{"line_number":8720,"context_line":"            try:"},{"line_number":8721,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":8722,"context_line":"            except exception.UnexpectedTaskStateError as e:"},{"line_number":8723,"context_line":"                LOG.info(\"The power-update event was possibly preempted: %s \""},{"line_number":8724,"context_line":"                         \"for instance\", e.format_message(), instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_1e956fe4","line":8721,"in_reply_to":"7faddb67_984ad724","updated":"2019-08-15 17:05:09.000000000","message":"Done","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"526292cc3927dc73f5b4d24279fbb30d661736b5","unresolved":false,"context_lines":[{"line_number":8721,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":8722,"context_line":"            except exception.UnexpectedTaskStateError as e:"},{"line_number":8723,"context_line":"                LOG.info(\"The power-update event was possibly preempted: %s \""},{"line_number":8724,"context_line":"                         \"for instance\", e.format_message(), instance\u003dinstance)"},{"line_number":8725,"context_line":"                return"},{"line_number":8726,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8727,"context_line":"                                              notification_name + \"start\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_2d8fe323","line":8724,"range":{"start_line":8724,"start_character":25,"end_line":8724,"end_character":39},"updated":"2019-08-15 14:30:24.000000000","message":"You don\u0027t \"for instance\" in here, you\u0027re using the instance kwarg which formats the message for the instance uuid anyway.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":8721,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":8722,"context_line":"            except exception.UnexpectedTaskStateError as e:"},{"line_number":8723,"context_line":"                LOG.info(\"The power-update event was possibly preempted: %s \""},{"line_number":8724,"context_line":"                         \"for instance\", e.format_message(), instance\u003dinstance)"},{"line_number":8725,"context_line":"                return"},{"line_number":8726,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8727,"context_line":"                                              notification_name + \"start\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_f3b68cf9","line":8724,"range":{"start_line":8724,"start_character":25,"end_line":8724,"end_character":39},"in_reply_to":"7faddb67_2d8fe323","updated":"2019-08-15 16:05:59.000000000","message":"Done","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"c7f1ebd9cb2217f48893994c4f46717e4bb501ee","unresolved":false,"context_lines":[{"line_number":8719,"context_line":"                instance.progress \u003d 0"},{"line_number":8720,"context_line":"            try:"},{"line_number":8721,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":8722,"context_line":"            except exception.UnexpectedTaskStateError as e:"},{"line_number":8723,"context_line":"                LOG.info(\"The power-update event was possibly preempted: %s \""},{"line_number":8724,"context_line":"                         \"for instance\", e.format_message(), instance\u003dinstance)"},{"line_number":8725,"context_line":"                return"},{"line_number":8726,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8727,"context_line":"                                              notification_name + \"start\")"},{"line_number":8728,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_aa6c1936","line":8725,"range":{"start_line":8722,"start_character":12,"end_line":8725,"end_character":22},"updated":"2019-08-15 13:41:42.000000000","message":"also include the driver call inside the try block plus handle fault here separately because we are going around the wrap_instance_event thing.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"77af8b9e9de406da6f8f45884c5d7d8d796edb63","unresolved":false,"context_lines":[{"line_number":8719,"context_line":"                instance.progress \u003d 0"},{"line_number":8720,"context_line":"            try:"},{"line_number":8721,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":8722,"context_line":"            except exception.UnexpectedTaskStateError as e:"},{"line_number":8723,"context_line":"                LOG.info(\"The power-update event was possibly preempted: %s \""},{"line_number":8724,"context_line":"                         \"for instance\", e.format_message(), instance\u003dinstance)"},{"line_number":8725,"context_line":"                return"},{"line_number":8726,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":8727,"context_line":"                                              notification_name + \"start\")"},{"line_number":8728,"context_line":"            compute_utils.notify_about_instance_action(context, instance,"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_cdcc0f8b","line":8725,"range":{"start_line":8722,"start_character":12,"end_line":8725,"end_character":22},"in_reply_to":"7faddb67_aa6c1936","updated":"2019-08-15 14:28:02.000000000","message":"\u003e because we are going around the wrap_instance_event thing.\n\nI don\u0027t know what this means, but @wrap_instance_event is a decorator (obviously) and will record a start and finish event for the action created in the API, so if you return or the method raises, either way there is going to be a start and finish event for the action.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f41cbaf0e97c0f4a7a67b7969d5bdcba34f7b43","unresolved":false,"context_lines":[{"line_number":8721,"context_line":"            try:"},{"line_number":8722,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":8723,"context_line":"                self._notify_about_instance_usage(context, instance,"},{"line_number":8724,"context_line":"                                                notification_name + \"start\")"},{"line_number":8725,"context_line":"                compute_utils.notify_about_instance_action(context, instance,"},{"line_number":8726,"context_line":"                    self.host, action\u003daction,"},{"line_number":8727,"context_line":"                    phase\u003dfields.NotificationPhase.START)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_3e7b8b8c","line":8724,"updated":"2019-08-15 16:34:38.000000000","message":"alignment","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d8941968c81c292abacca4cf574fb819c57f6b5","unresolved":false,"context_lines":[{"line_number":8721,"context_line":"            try:"},{"line_number":8722,"context_line":"                instance.save(expected_task_state\u003d[None])"},{"line_number":8723,"context_line":"                self._notify_about_instance_usage(context, instance,"},{"line_number":8724,"context_line":"                                                notification_name + \"start\")"},{"line_number":8725,"context_line":"                compute_utils.notify_about_instance_action(context, instance,"},{"line_number":8726,"context_line":"                    self.host, action\u003daction,"},{"line_number":8727,"context_line":"                    phase\u003dfields.NotificationPhase.START)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_7ebee3ae","line":8724,"in_reply_to":"7faddb67_3e7b8b8c","updated":"2019-08-15 17:05:09.000000000","message":"Done","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f41cbaf0e97c0f4a7a67b7969d5bdcba34f7b43","unresolved":false,"context_lines":[{"line_number":8726,"context_line":"                    self.host, action\u003daction,"},{"line_number":8727,"context_line":"                    phase\u003dfields.NotificationPhase.START)"},{"line_number":8728,"context_line":"                # NOTE(tssurya): Error notifications are not emitted in case of"},{"line_number":8729,"context_line":"                # encountering exceptions in the driver layer similar to the"},{"line_number":8730,"context_line":"                # existing instance actions like start/stop/pause. In such"},{"line_number":8731,"context_line":"                # cases only the start notification is emitted."},{"line_number":8732,"context_line":"                self.driver.power_update_event(instance, target_power_state)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_be669bec","line":8729,"range":{"start_line":8729,"start_character":31,"end_line":8729,"end_character":41},"updated":"2019-08-15 16:34:38.000000000","message":"Well, UnexpectedTaskStateError only. If the driver raises NotImplementedError the @wrap_exception decorator is going to emit a notification.","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d8941968c81c292abacca4cf574fb819c57f6b5","unresolved":false,"context_lines":[{"line_number":8726,"context_line":"                    self.host, action\u003daction,"},{"line_number":8727,"context_line":"                    phase\u003dfields.NotificationPhase.START)"},{"line_number":8728,"context_line":"                # NOTE(tssurya): Error notifications are not emitted in case of"},{"line_number":8729,"context_line":"                # encountering exceptions in the driver layer similar to the"},{"line_number":8730,"context_line":"                # existing instance actions like start/stop/pause. In such"},{"line_number":8731,"context_line":"                # cases only the start notification is emitted."},{"line_number":8732,"context_line":"                self.driver.power_update_event(instance, target_power_state)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_1e148f9f","line":8729,"range":{"start_line":8729,"start_character":31,"end_line":8729,"end_character":41},"in_reply_to":"7faddb67_be669bec","updated":"2019-08-15 17:05:09.000000000","message":"Done","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f41cbaf0e97c0f4a7a67b7969d5bdcba34f7b43","unresolved":false,"context_lines":[{"line_number":8727,"context_line":"                    phase\u003dfields.NotificationPhase.START)"},{"line_number":8728,"context_line":"                # NOTE(tssurya): Error notifications are not emitted in case of"},{"line_number":8729,"context_line":"                # encountering exceptions in the driver layer similar to the"},{"line_number":8730,"context_line":"                # existing instance actions like start/stop/pause. In such"},{"line_number":8731,"context_line":"                # cases only the start notification is emitted."},{"line_number":8732,"context_line":"                self.driver.power_update_event(instance, target_power_state)"},{"line_number":8733,"context_line":"                self._notify_about_instance_usage(context, instance,"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_7e5ca318","line":8730,"range":{"start_line":8730,"start_character":18,"end_line":8730,"end_character":66},"updated":"2019-08-15 16:34:38.000000000","message":"These will definitely emit an error notification if the driver raises an unexpected error, e.g. libvirt driver raising libvirtError during pause.","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d8941968c81c292abacca4cf574fb819c57f6b5","unresolved":false,"context_lines":[{"line_number":8727,"context_line":"                    phase\u003dfields.NotificationPhase.START)"},{"line_number":8728,"context_line":"                # NOTE(tssurya): Error notifications are not emitted in case of"},{"line_number":8729,"context_line":"                # encountering exceptions in the driver layer similar to the"},{"line_number":8730,"context_line":"                # existing instance actions like start/stop/pause. In such"},{"line_number":8731,"context_line":"                # cases only the start notification is emitted."},{"line_number":8732,"context_line":"                self.driver.power_update_event(instance, target_power_state)"},{"line_number":8733,"context_line":"                self._notify_about_instance_usage(context, instance,"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_de091784","line":8730,"range":{"start_line":8730,"start_character":18,"end_line":8730,"end_character":66},"in_reply_to":"7faddb67_7e5ca318","updated":"2019-08-15 17:05:09.000000000","message":"Done","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f41cbaf0e97c0f4a7a67b7969d5bdcba34f7b43","unresolved":false,"context_lines":[{"line_number":8731,"context_line":"                # cases only the start notification is emitted."},{"line_number":8732,"context_line":"                self.driver.power_update_event(instance, target_power_state)"},{"line_number":8733,"context_line":"                self._notify_about_instance_usage(context, instance,"},{"line_number":8734,"context_line":"                                                notification_name + \"end\")"},{"line_number":8735,"context_line":"                compute_utils.notify_about_instance_action(context, instance,"},{"line_number":8736,"context_line":"                    self.host, action\u003daction,"},{"line_number":8737,"context_line":"                    phase\u003dfields.NotificationPhase.END)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_1e9b2fc9","line":8734,"updated":"2019-08-15 16:34:38.000000000","message":"alignment","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d8941968c81c292abacca4cf574fb819c57f6b5","unresolved":false,"context_lines":[{"line_number":8731,"context_line":"                # cases only the start notification is emitted."},{"line_number":8732,"context_line":"                self.driver.power_update_event(instance, target_power_state)"},{"line_number":8733,"context_line":"                self._notify_about_instance_usage(context, instance,"},{"line_number":8734,"context_line":"                                                notification_name + \"end\")"},{"line_number":8735,"context_line":"                compute_utils.notify_about_instance_action(context, instance,"},{"line_number":8736,"context_line":"                    self.host, action\u003daction,"},{"line_number":8737,"context_line":"                    phase\u003dfields.NotificationPhase.END)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_1edd6f13","line":8734,"in_reply_to":"7faddb67_1e9b2fc9","updated":"2019-08-15 17:05:09.000000000","message":"Done","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f41cbaf0e97c0f4a7a67b7969d5bdcba34f7b43","unresolved":false,"context_lines":[{"line_number":8736,"context_line":"                    self.host, action\u003daction,"},{"line_number":8737,"context_line":"                    phase\u003dfields.NotificationPhase.END)"},{"line_number":8738,"context_line":"            except exception.UnexpectedTaskStateError as e:"},{"line_number":8739,"context_line":"                LOG.info(\"The power-update event was possibly preempted: %s \","},{"line_number":8740,"context_line":"                         e.format_message(), instance\u003dinstance)"},{"line_number":8741,"context_line":"                return"},{"line_number":8742,"context_line":"        do_power_update()"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_7eb10344","line":8739,"updated":"2019-08-15 16:34:38.000000000","message":"It\u0027s probably worth adding a comment here saying the power-update event is best effort and if we lost a race with something else acting on the instance then we just log it and return so the overall instance action does not show up as failed in the API.","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d8941968c81c292abacca4cf574fb819c57f6b5","unresolved":false,"context_lines":[{"line_number":8736,"context_line":"                    self.host, action\u003daction,"},{"line_number":8737,"context_line":"                    phase\u003dfields.NotificationPhase.END)"},{"line_number":8738,"context_line":"            except exception.UnexpectedTaskStateError as e:"},{"line_number":8739,"context_line":"                LOG.info(\"The power-update event was possibly preempted: %s \","},{"line_number":8740,"context_line":"                         e.format_message(), instance\u003dinstance)"},{"line_number":8741,"context_line":"                return"},{"line_number":8742,"context_line":"        do_power_update()"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_be245b0e","line":8739,"in_reply_to":"7faddb67_7eb10344","updated":"2019-08-15 17:05:09.000000000","message":"Done","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"}],"nova/objects/external_event.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"79018867b9c4d3e968f7710450e2f1602bc84846","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    # Volume was extended for this instance, tag is volume_id"},{"line_number":28,"context_line":"    \u0027volume-extended\u0027,"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    # Power state has changed for this (physical) instance"},{"line_number":31,"context_line":"    \u0027power-update\u0027,"},{"line_number":32,"context_line":"]"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_65d0d254","line":30,"range":{"start_line":30,"start_character":40,"end_line":30,"end_character":48},"updated":"2019-08-12 15:09:43.000000000","message":"?\n\nBecause this currently only applies to ironic?","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"56e23bcf6689cb33c55ec448199ff4f5eb616df1","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    # Volume was extended for this instance, tag is volume_id"},{"line_number":28,"context_line":"    \u0027volume-extended\u0027,"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    # Power state has changed for this (physical) instance"},{"line_number":31,"context_line":"    \u0027power-update\u0027,"},{"line_number":32,"context_line":"]"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_83770309","line":30,"range":{"start_line":30,"start_character":40,"end_line":30,"end_character":48},"in_reply_to":"7faddb67_6593f201","updated":"2019-08-12 18:36:27.000000000","message":"Yeah, so what I was saying (poorly) is that this comment is not future-proof. I would strike `(physical)`.","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"01e6706c208ba0cce225c5450e6fc4412adfe0ac","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    # Volume was extended for this instance, tag is volume_id"},{"line_number":28,"context_line":"    \u0027volume-extended\u0027,"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    # Power state has changed for this (physical) instance"},{"line_number":31,"context_line":"    \u0027power-update\u0027,"},{"line_number":32,"context_line":"]"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_6593f201","line":30,"range":{"start_line":30,"start_character":40,"end_line":30,"end_character":48},"in_reply_to":"7faddb67_65d0d254","updated":"2019-08-12 16:24:08.000000000","message":"ack.","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"88f1e2bb65ab5367f58704adf7b72b5e3da89487","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    # Version 1.1: adds network-vif-deleted event"},{"line_number":42,"context_line":"    # Version 1.2: adds volume-extended event"},{"line_number":43,"context_line":"    # Version 1.3: adds power-update event"},{"line_number":44,"context_line":"    VERSION \u003d \u00271.3\u0027"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    fields \u003d {"},{"line_number":47,"context_line":"        \u0027instance_uuid\u0027: fields.UUIDField(),"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_4236ec53","line":44,"updated":"2019-08-12 14:48:59.000000000","message":"This is not your problem because you weren\u0027t the first to do it, but we really should be refusing to down-grade from 1.3 to 1.0 if the newer event names are set.","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"e2f0a7c3bfcfcf2f01217211f572201fec7e350f","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    # Version 1.1: adds network-vif-deleted event"},{"line_number":42,"context_line":"    # Version 1.2: adds volume-extended event"},{"line_number":43,"context_line":"    # Version 1.3: adds power-update event"},{"line_number":44,"context_line":"    VERSION \u003d \u00271.3\u0027"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    fields \u003d {"},{"line_number":47,"context_line":"        \u0027instance_uuid\u0027: fields.UUIDField(),"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_655e92ea","line":44,"in_reply_to":"7faddb67_4236ec53","updated":"2019-08-12 15:25:51.000000000","message":"\u003e This is not your problem because you weren\u0027t the first to do it,\n \u003e but we really should be refusing to down-grade from 1.3 to 1.0 if\n \u003e the newer event names are set.\n\nhmm yea I never thought of this.","commit_id":"2bba3b7103609307e5da0de18085c9a1362eb7d1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    # Volume was extended for this instance, tag is volume_id"},{"line_number":28,"context_line":"    \u0027volume-extended\u0027,"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    # Power state has changed for this instance"},{"line_number":31,"context_line":"    \u0027power-update\u0027,"},{"line_number":32,"context_line":"]"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_5850dfd5","line":30,"range":{"start_line":30,"start_character":39,"end_line":30,"end_character":47},"updated":"2019-08-15 15:18:06.000000000","message":"Why did you remove \"(physical)\" here? Didn\u0027t efried ask for that earlier?","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    # Volume was extended for this instance, tag is volume_id"},{"line_number":28,"context_line":"    \u0027volume-extended\u0027,"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    # Power state has changed for this instance"},{"line_number":31,"context_line":"    \u0027power-update\u0027,"},{"line_number":32,"context_line":"]"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_58d69ff4","line":30,"range":{"start_line":30,"start_character":39,"end_line":30,"end_character":47},"in_reply_to":"7faddb67_5850dfd5","updated":"2019-08-15 16:05:59.000000000","message":"\u003e Why did you remove \"(physical)\" here? Didn\u0027t efried ask for that\n \u003e earlier?\n\nyea efried asked me to remove physical","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"30378d52440957585e030ed44e9f4f77e743afd8","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    # Volume was extended for this instance, tag is volume_id"},{"line_number":28,"context_line":"    \u0027volume-extended\u0027,"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    # Power state has changed for this instance"},{"line_number":31,"context_line":"    \u0027power-update\u0027,"},{"line_number":32,"context_line":"]"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_d87fef14","line":30,"range":{"start_line":30,"start_character":39,"end_line":30,"end_character":47},"in_reply_to":"7faddb67_5850dfd5","updated":"2019-08-15 15:24:14.000000000","message":"TBH, I don\u0027t really agree with the inclusion of physical in here. This is only _used_ by ironic, but it\u0027s not specific to them. Once vmware decides this is an excellent idea because people could use vcenter under nova or something, we\u0027d have to remember to change it.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    # Volume was extended for this instance, tag is volume_id"},{"line_number":28,"context_line":"    \u0027volume-extended\u0027,"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    # Power state has changed for this instance"},{"line_number":31,"context_line":"    \u0027power-update\u0027,"},{"line_number":32,"context_line":"]"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_380ba38e","line":30,"range":{"start_line":30,"start_character":39,"end_line":30,"end_character":47},"in_reply_to":"7faddb67_d87fef14","updated":"2019-08-15 16:05:59.000000000","message":"\u003e TBH, I don\u0027t really agree with the inclusion of physical in here.\n \u003e This is only _used_ by ironic, but it\u0027s not specific to them. Once\n \u003e vmware decides this is an excellent idea because people could use\n \u003e vcenter under nova or something, we\u0027d have to remember to change\n \u003e it.\n\nyea efried had the same opinion.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcb2903079f28a0de417cf8ba4f110880b5812a7","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    # Volume was extended for this instance, tag is volume_id"},{"line_number":28,"context_line":"    \u0027volume-extended\u0027,"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    # Power state has changed for this instance"},{"line_number":31,"context_line":"    \u0027power-update\u0027,"},{"line_number":32,"context_line":"]"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_78befbae","line":30,"range":{"start_line":30,"start_character":39,"end_line":30,"end_character":47},"in_reply_to":"7faddb67_d87fef14","updated":"2019-08-15 15:26:28.000000000","message":"Sure, I\u0027m fine with omitting it also - it seemed like unnecessarily tight coupling between the API and the implementation in compute.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"}],"nova/tests/functional/test_server_external_events.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":32,"context_line":"CONF \u003d nova.conf.CONF"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class PowerUpdateFakeDriver(fake.SmallFakeDriver):"},{"line_number":36,"context_line":"    # A specific fake driver for our tests."},{"line_number":37,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":38,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_3c4057a5","line":35,"updated":"2019-07-16 10:51:16.000000000","message":"Can we somehow call the ironic driver\u0027s power_update_event function so that if the implementation changes there then the test will run against the changed impl?\n\nThis seems to be working:\n\nclass PowerUpdateFakeDriver(fake.SmallFakeDriver):\n    # A specific fake driver for our tests.\n    def power_update_event(self, context, instance, target_power_state):\n        \"\"\"Update power state of the specified instance in the nova DB.\"\"\"\n        driver \u003d ironic.IronicDriver(virtapi\u003dNone)\n        driver.power_update_event(context, instance, target_power_state)","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":32,"context_line":"CONF \u003d nova.conf.CONF"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class PowerUpdateFakeDriver(fake.SmallFakeDriver):"},{"line_number":36,"context_line":"    # A specific fake driver for our tests."},{"line_number":37,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":38,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_1ece9ab3","line":35,"in_reply_to":"7faddb67_3c4057a5","updated":"2019-07-18 11:32:53.000000000","message":"good point.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":52,"context_line":"class ServerExternalEventsTestV21("},{"line_number":53,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":54,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":55,"context_line":"    server_external_events \u003d server_external_events"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def setUp(self):"},{"line_number":58,"context_line":"        super(ServerExternalEventsTestV21, self).setUp()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_17b3f44e","line":55,"updated":"2019-07-16 10:51:16.000000000","message":"Why do we need this?","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":52,"context_line":"class ServerExternalEventsTestV21("},{"line_number":53,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":54,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":55,"context_line":"    server_external_events \u003d server_external_events"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def setUp(self):"},{"line_number":58,"context_line":"        super(ServerExternalEventsTestV21, self).setUp()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_9e4e0a36","line":55,"in_reply_to":"7faddb67_17b3f44e","updated":"2019-07-18 11:32:53.000000000","message":"ya I forgot to remove this. its not needed.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def setUp(self):"},{"line_number":71,"context_line":"        super(ServerExternalEventsTestV275, self).setUp()"},{"line_number":72,"context_line":"        self.stub_out(\u0027nova.virt.driver.load_compute_driver\u0027,"},{"line_number":73,"context_line":"                      _fake_load_compute_driver)"},{"line_number":74,"context_line":"        self.useFixture(cast_as_call.CastAsCall(self))"},{"line_number":75,"context_line":"        self.compute \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027compute\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_77f028fe","line":72,"updated":"2019-07-16 10:51:16.000000000","message":"I think this is not needed. The base class and the \u0027compute_driver\u0027 class level variable already does the trick.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f932343f1c3d83043e1946dbe4e055dad22da0df","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def setUp(self):"},{"line_number":71,"context_line":"        super(ServerExternalEventsTestV275, self).setUp()"},{"line_number":72,"context_line":"        self.stub_out(\u0027nova.virt.driver.load_compute_driver\u0027,"},{"line_number":73,"context_line":"                      _fake_load_compute_driver)"},{"line_number":74,"context_line":"        self.useFixture(cast_as_call.CastAsCall(self))"},{"line_number":75,"context_line":"        self.compute \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027compute\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_e223cda5","line":72,"in_reply_to":"7faddb67_5e95f231","updated":"2019-07-18 12:50:02.000000000","message":"I see. You are right about the limitation for the location of the fake driver impl. So I\u0027m OK to use the stubbing here. Then I guess L63 can be removed.\n\n//later\n\nL63 cannot be removed either. Bah. This is ugly but I don\u0027t see an easy way to avoid this duplication if we want to keep the fake driver in this package.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def setUp(self):"},{"line_number":71,"context_line":"        super(ServerExternalEventsTestV275, self).setUp()"},{"line_number":72,"context_line":"        self.stub_out(\u0027nova.virt.driver.load_compute_driver\u0027,"},{"line_number":73,"context_line":"                      _fake_load_compute_driver)"},{"line_number":74,"context_line":"        self.useFixture(cast_as_call.CastAsCall(self))"},{"line_number":75,"context_line":"        self.compute \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027compute\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_5e95f231","line":72,"in_reply_to":"7faddb67_77f028fe","updated":"2019-07-18 11:32:53.000000000","message":"\u003e I think this is not needed. The base class and the \u0027compute_driver\u0027\n \u003e class level variable already does the trick.\n\nI thought so too, but for some reason I need both. If I don\u0027t stub it out, I get the following error:\n\n Captured traceback:\n~~~~~~~~~~~~~~~~~~~\n    Traceback (most recent call last):\n      File \"nova/tests/functional/test_server_external_events.py\", line 72, in setUp\n        self.compute \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027compute\u0027)\n      File \"nova/test.py\", line 443, in start_service\n        nova_fixtures.ServiceFixture(name, host, cell\u003dcell, **kwargs))\n      File \"/home/surya/nova/.tox/functional/local/lib/python2.7/site-packages/testtools/testcase.py\", line 756, in useFixture\n        reraise(*exc_info)\n      File \"/home/surya/nova/.tox/functional/local/lib/python2.7/site-packages/testtools/testcase.py\", line 731, in useFixture\n        fixture.setUp()\n      File \"nova/tests/fixtures.py\", line 99, in setUp\n        self.service \u003d service.Service.create(**self.kwargs)\n      File \"nova/service.py\", line 258, in create\n        periodic_interval_max\u003dperiodic_interval_max)\n      File \"nova/service.py\", line 130, in __init__\n        self.manager \u003d manager_class(host\u003dself.host, *args, **kwargs)\n      File \"nova/compute/manager.py\", line 577, in __init__\n        self.driver \u003d driver.load_compute_driver(self.virtapi, compute_driver)\n      File \"nova/virt/driver.py\", line 1901, in load_compute_driver\n        sys.exit(1)\n    SystemExit: 1\n\nSo I sort of copied what was done here: https://github.com/openstack/nova/blob/b7c98befdab1a88932f41f9c463358f91701ce4a/nova/tests/functional/test_server_group.py#L145\n\n\nIt looks like the \"_load_compute_driver\" doesn\u0027t like any non-nova.virt drivers. So if I put PowerUpdateFakeDriver inside the nova.virt.fake.py it works, but if I have it in this same file I need to stub it.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        super(ServerExternalEventsTestV275, self).setUp()"},{"line_number":72,"context_line":"        self.stub_out(\u0027nova.virt.driver.load_compute_driver\u0027,"},{"line_number":73,"context_line":"                      _fake_load_compute_driver)"},{"line_number":74,"context_line":"        self.useFixture(cast_as_call.CastAsCall(self))"},{"line_number":75,"context_line":"        self.compute \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027compute\u0027)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        flavors \u003d self.api.get_flavors()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_b7ea200c","line":74,"updated":"2019-07-16 10:51:16.000000000","message":"I\u0027d like to avoid this if possible as it makes the test unrealistic. I know that the rpc is a cast down to the compute but you can wait for the instance action notifications like instance.power_off.end to see if everything is finished.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        super(ServerExternalEventsTestV275, self).setUp()"},{"line_number":72,"context_line":"        self.stub_out(\u0027nova.virt.driver.load_compute_driver\u0027,"},{"line_number":73,"context_line":"                      _fake_load_compute_driver)"},{"line_number":74,"context_line":"        self.useFixture(cast_as_call.CastAsCall(self))"},{"line_number":75,"context_line":"        self.compute \u003d self.start_service(\u0027compute\u0027, host\u003d\u0027compute\u0027)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        flavors \u003d self.api.get_flavors()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_078ddb30","line":74,"in_reply_to":"7faddb67_b7ea200c","updated":"2019-07-18 11:32:53.000000000","message":"Done","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":86,"context_line":"                      \u0027tag\u0027: \u0027POWER_OFF\u0027,"},{"line_number":87,"context_line":"                      \u0027server_uuid\u0027: self.server[\"id\"]}"},{"line_number":88,"context_line":"        self.default_body \u003d {\u0027events\u0027: [self.event]}"},{"line_number":89,"context_line":"        self.controller \u003d ("},{"line_number":90,"context_line":"            server_external_events.ServerExternalEventsController())"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    @mock.patch(\u0027nova.tests.functional.test_server_external_events.LOG.debug\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_97f5a4ef","line":89,"updated":"2019-07-16 10:51:16.000000000","message":"Why do you want to call the controller directly instead of calling the REST API?","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":86,"context_line":"                      \u0027tag\u0027: \u0027POWER_OFF\u0027,"},{"line_number":87,"context_line":"                      \u0027server_uuid\u0027: self.server[\"id\"]}"},{"line_number":88,"context_line":"        self.default_body \u003d {\u0027events\u0027: [self.event]}"},{"line_number":89,"context_line":"        self.controller \u003d ("},{"line_number":90,"context_line":"            server_external_events.ServerExternalEventsController())"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    @mock.patch(\u0027nova.tests.functional.test_server_external_events.LOG.debug\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_6cb2764b","line":89,"in_reply_to":"7faddb67_97f5a4ef","updated":"2019-07-18 11:32:53.000000000","message":"Done","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        rule2 \u003d \u0027os_compute_api:servers:detail\u0027"},{"line_number":96,"context_line":"        rule3 \u003d \u0027os_compute_api:os-instance-actions\u0027"},{"line_number":97,"context_line":"        self.policy.set_rules({rule1: \u0027@\u0027, rule2: \u0027@\u0027, rule3: \u0027@\u0027})"},{"line_number":98,"context_line":"        server \u003d self.api.get_servers()[0]"},{"line_number":99,"context_line":"        self.assertEqual(vm_states.ACTIVE, server[\u0027OS-EXT-STS:vm_state\u0027])"},{"line_number":100,"context_line":"        self.assertEqual(power_state.RUNNING, server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":101,"context_line":"        req \u003d self.req(\u0027/os-server-external-events/%s\u0027, self.default_body)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_b7d30060","line":98,"updated":"2019-07-16 10:51:16.000000000","message":"you already have the self.server storing the server information after it reached ACTIVE state so you don\u0027t have t get it again.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        rule2 \u003d \u0027os_compute_api:servers:detail\u0027"},{"line_number":96,"context_line":"        rule3 \u003d \u0027os_compute_api:os-instance-actions\u0027"},{"line_number":97,"context_line":"        self.policy.set_rules({rule1: \u0027@\u0027, rule2: \u0027@\u0027, rule3: \u0027@\u0027})"},{"line_number":98,"context_line":"        server \u003d self.api.get_servers()[0]"},{"line_number":99,"context_line":"        self.assertEqual(vm_states.ACTIVE, server[\u0027OS-EXT-STS:vm_state\u0027])"},{"line_number":100,"context_line":"        self.assertEqual(power_state.RUNNING, server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":101,"context_line":"        req \u003d self.req(\u0027/os-server-external-events/%s\u0027, self.default_body)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_093414fb","line":98,"in_reply_to":"7faddb67_b7d30060","updated":"2019-07-18 11:32:53.000000000","message":"Done","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        rule3 \u003d \u0027os_compute_api:os-instance-actions\u0027"},{"line_number":97,"context_line":"        self.policy.set_rules({rule1: \u0027@\u0027, rule2: \u0027@\u0027, rule3: \u0027@\u0027})"},{"line_number":98,"context_line":"        server \u003d self.api.get_servers()[0]"},{"line_number":99,"context_line":"        self.assertEqual(vm_states.ACTIVE, server[\u0027OS-EXT-STS:vm_state\u0027])"},{"line_number":100,"context_line":"        self.assertEqual(power_state.RUNNING, server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":101,"context_line":"        req \u003d self.req(\u0027/os-server-external-events/%s\u0027, self.default_body)"},{"line_number":102,"context_line":"        self.controller.create(req, body\u003dself.default_body)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_57c40c91","line":99,"updated":"2019-07-16 10:51:16.000000000","message":"wait_for_state_change already asserted this.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        rule3 \u003d \u0027os_compute_api:os-instance-actions\u0027"},{"line_number":97,"context_line":"        self.policy.set_rules({rule1: \u0027@\u0027, rule2: \u0027@\u0027, rule3: \u0027@\u0027})"},{"line_number":98,"context_line":"        server \u003d self.api.get_servers()[0]"},{"line_number":99,"context_line":"        self.assertEqual(vm_states.ACTIVE, server[\u0027OS-EXT-STS:vm_state\u0027])"},{"line_number":100,"context_line":"        self.assertEqual(power_state.RUNNING, server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":101,"context_line":"        req \u003d self.req(\u0027/os-server-external-events/%s\u0027, self.default_body)"},{"line_number":102,"context_line":"        self.controller.create(req, body\u003dself.default_body)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_a95dc047","line":99,"in_reply_to":"7faddb67_57c40c91","updated":"2019-07-18 11:32:53.000000000","message":"Done","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        self.policy.set_rules({rule1: \u0027@\u0027, rule2: \u0027@\u0027, rule3: \u0027@\u0027})"},{"line_number":98,"context_line":"        server \u003d self.api.get_servers()[0]"},{"line_number":99,"context_line":"        self.assertEqual(vm_states.ACTIVE, server[\u0027OS-EXT-STS:vm_state\u0027])"},{"line_number":100,"context_line":"        self.assertEqual(power_state.RUNNING, server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":101,"context_line":"        req \u003d self.req(\u0027/os-server-external-events/%s\u0027, self.default_body)"},{"line_number":102,"context_line":"        self.controller.create(req, body\u003dself.default_body)"},{"line_number":103,"context_line":"        inst \u003d objects.Instance.get_by_uuid("}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_b738e09f","line":100,"updated":"2019-07-16 10:51:16.000000000","message":"You could change wait_for_state_change to _wait_for_server_parameter and then you can assert power_state there.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        self.policy.set_rules({rule1: \u0027@\u0027, rule2: \u0027@\u0027, rule3: \u0027@\u0027})"},{"line_number":98,"context_line":"        server \u003d self.api.get_servers()[0]"},{"line_number":99,"context_line":"        self.assertEqual(vm_states.ACTIVE, server[\u0027OS-EXT-STS:vm_state\u0027])"},{"line_number":100,"context_line":"        self.assertEqual(power_state.RUNNING, server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":101,"context_line":"        req \u003d self.req(\u0027/os-server-external-events/%s\u0027, self.default_body)"},{"line_number":102,"context_line":"        self.controller.create(req, body\u003dself.default_body)"},{"line_number":103,"context_line":"        inst \u003d objects.Instance.get_by_uuid("}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_6953483a","line":100,"in_reply_to":"7faddb67_b738e09f","updated":"2019-07-18 11:32:53.000000000","message":"Done","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        server \u003d self.api.get_servers()[0]"},{"line_number":99,"context_line":"        self.assertEqual(vm_states.ACTIVE, server[\u0027OS-EXT-STS:vm_state\u0027])"},{"line_number":100,"context_line":"        self.assertEqual(power_state.RUNNING, server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":101,"context_line":"        req \u003d self.req(\u0027/os-server-external-events/%s\u0027, self.default_body)"},{"line_number":102,"context_line":"        self.controller.create(req, body\u003dself.default_body)"},{"line_number":103,"context_line":"        inst \u003d objects.Instance.get_by_uuid("},{"line_number":104,"context_line":"            context.get_admin_context(), server[\u0027id\u0027])"},{"line_number":105,"context_line":"        self.assertEqual(vm_states.STOPPED, inst.vm_state)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_374cf040","line":102,"range":{"start_line":101,"start_character":0,"end_line":102,"end_character":59},"updated":"2019-07-16 10:51:16.000000000","message":"I think in a funct test this should be go through the REST API via the nova.tests.functional.api.client.TestOpenStackClient() client.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        server \u003d self.api.get_servers()[0]"},{"line_number":99,"context_line":"        self.assertEqual(vm_states.ACTIVE, server[\u0027OS-EXT-STS:vm_state\u0027])"},{"line_number":100,"context_line":"        self.assertEqual(power_state.RUNNING, server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":101,"context_line":"        req \u003d self.req(\u0027/os-server-external-events/%s\u0027, self.default_body)"},{"line_number":102,"context_line":"        self.controller.create(req, body\u003dself.default_body)"},{"line_number":103,"context_line":"        inst \u003d objects.Instance.get_by_uuid("},{"line_number":104,"context_line":"            context.get_admin_context(), server[\u0027id\u0027])"},{"line_number":105,"context_line":"        self.assertEqual(vm_states.STOPPED, inst.vm_state)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_fe44de75","line":102,"range":{"start_line":101,"start_character":0,"end_line":102,"end_character":59},"in_reply_to":"7faddb67_374cf040","updated":"2019-07-18 11:32:53.000000000","message":"ack, I will then add the necessary stuff into the TestOpenStackClient(). I didn\u0027t use it since it did not have an interface for server external events.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        self.assertEqual(power_state.RUNNING, server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":101,"context_line":"        req \u003d self.req(\u0027/os-server-external-events/%s\u0027, self.default_body)"},{"line_number":102,"context_line":"        self.controller.create(req, body\u003dself.default_body)"},{"line_number":103,"context_line":"        inst \u003d objects.Instance.get_by_uuid("},{"line_number":104,"context_line":"            context.get_admin_context(), server[\u0027id\u0027])"},{"line_number":105,"context_line":"        self.assertEqual(vm_states.STOPPED, inst.vm_state)"},{"line_number":106,"context_line":"        self.assertEqual(power_state.SHUTDOWN, inst.power_state)"},{"line_number":107,"context_line":"        msg \u003d (\u0027Power update called for %s from this fake driver\u0027, inst.uuid)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_975cc4ed","line":104,"range":{"start_line":103,"start_character":1,"end_line":104,"end_character":54},"updated":"2019-07-16 10:51:16.000000000","message":"This should be go through the REST API, like:\n\n  api.get_server(self.server[\u0027id\u0027])","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        self.assertEqual(power_state.RUNNING, server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":101,"context_line":"        req \u003d self.req(\u0027/os-server-external-events/%s\u0027, self.default_body)"},{"line_number":102,"context_line":"        self.controller.create(req, body\u003dself.default_body)"},{"line_number":103,"context_line":"        inst \u003d objects.Instance.get_by_uuid("},{"line_number":104,"context_line":"            context.get_admin_context(), server[\u0027id\u0027])"},{"line_number":105,"context_line":"        self.assertEqual(vm_states.STOPPED, inst.vm_state)"},{"line_number":106,"context_line":"        self.assertEqual(power_state.SHUTDOWN, inst.power_state)"},{"line_number":107,"context_line":"        msg \u003d (\u0027Power update called for %s from this fake driver\u0027, inst.uuid)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_5ef65265","line":104,"range":{"start_line":103,"start_character":1,"end_line":104,"end_character":54},"in_reply_to":"7faddb67_975cc4ed","updated":"2019-07-18 11:32:53.000000000","message":"Done","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"7faddb67_b7a220ad","line":114,"updated":"2019-07-16 10:51:16.000000000","message":"Could you please assert the that the notifications are emitted as expected?","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"7faddb67_0c874264","line":114,"in_reply_to":"7faddb67_b7a220ad","updated":"2019-07-18 11:32:53.000000000","message":"Done","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# All Rights Reserved."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_ed77fd07","line":1,"updated":"2019-07-23 16:17:38.000000000","message":"We don\u0027t need this line.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# All Rights Reserved."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_47329aa9","line":1,"in_reply_to":"7faddb67_ed77fd07","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"CONF \u003d nova.conf.CONF"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class PowerUpdateFakeDriver(fake.SmallFakeDriver):"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_cdbb2170","line":29,"updated":"2019-07-23 16:17:38.000000000","message":"This isn\u0027t used.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"CONF \u003d nova.conf.CONF"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class PowerUpdateFakeDriver(fake.SmallFakeDriver):"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_a7f7ced4","line":29,"in_reply_to":"7faddb67_cdbb2170","updated":"2019-07-25 15:19:21.000000000","message":"hmm looks like I had some plans but can\u0027t remember what.. I\u0027ll remove it.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f932343f1c3d83043e1946dbe4e055dad22da0df","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    # A specific fake driver for our tests."},{"line_number":34,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":35,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":36,"context_line":"        LOG.debug("},{"line_number":37,"context_line":"            \u0027Power update called for %s from this fake driver\u0027, instance.uuid)"},{"line_number":38,"context_line":"        driver \u003d ironic.IronicDriver(virtapi\u003dNone)"},{"line_number":39,"context_line":"        driver.power_update_event(context, instance, target_power_state)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_c23fb184","line":36,"updated":"2019-07-18 12:50:02.000000000","message":"this seems redundant as the IronicDriver will log it anyhow","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    # A specific fake driver for our tests."},{"line_number":34,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":35,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":36,"context_line":"        LOG.debug("},{"line_number":37,"context_line":"            \u0027Power update called for %s from this fake driver\u0027, instance.uuid)"},{"line_number":38,"context_line":"        driver \u003d ironic.IronicDriver(virtapi\u003dNone)"},{"line_number":39,"context_line":"        driver.power_update_event(context, instance, target_power_state)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_47d7fa24","line":36,"in_reply_to":"7faddb67_c23fb184","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f932343f1c3d83043e1946dbe4e055dad22da0df","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    return PowerUpdateFakeDriver(virtapi)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class ServerExternalEventsTestV21("},{"line_number":47,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":48,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_02bf09d1","line":46,"updated":"2019-07-18 12:50:02.000000000","message":"As far as I see this is an empty test class so I think it can be dropped from the tree. Or somebody can write a test case in this class (or to be precise with microversion 2.74) to assert that the API does not accept the power update event with old microversion.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    return PowerUpdateFakeDriver(virtapi)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class ServerExternalEventsTestV21("},{"line_number":47,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":48,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_2d7515fb","line":46,"in_reply_to":"7faddb67_02bf09d1","updated":"2019-07-23 16:17:38.000000000","message":"\u003e Or somebody can write a test case in this class (or to be precise with microversion 2.74) to assert that the API does not accept the power update event with old microversion.\n\nThat should be a negative unit test IMO. But yes we should test that for the schema validation.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    return PowerUpdateFakeDriver(virtapi)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class ServerExternalEventsTestV21("},{"line_number":47,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":48,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_a261ee3b","line":46,"in_reply_to":"7faddb67_02bf09d1","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    return PowerUpdateFakeDriver(virtapi)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class ServerExternalEventsTestV21("},{"line_number":47,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":48,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_0271e20c","line":46,"in_reply_to":"7faddb67_2d7515fb","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"class ServerExternalEventsTestV275(ServerExternalEventsTestV21):"},{"line_number":55,"context_line":"    microversion \u003d \u00272.75\u0027"},{"line_number":56,"context_line":"    compute_driver \u003d PowerUpdateFakeDriver"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def setUp(self):"},{"line_number":59,"context_line":"        super(ServerExternalEventsTestV275, self).setUp()"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_0d661953","line":56,"updated":"2019-07-23 16:17:38.000000000","message":"This is supposed to be a string I thought? I\u0027m not sure how this is working. Oh I see you have to use _fake_load_compute_driver for it...\n\nNormally fake drivers would be defined in nova.virt.fake and you\u0027d specify compute_driver \u003d \u0027fake.PowerUpdateFakeDriver\u0027. Can we do that for consistency and to avoid this weird stub?","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"class ServerExternalEventsTestV275(ServerExternalEventsTestV21):"},{"line_number":55,"context_line":"    microversion \u003d \u00272.75\u0027"},{"line_number":56,"context_line":"    compute_driver \u003d PowerUpdateFakeDriver"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def setUp(self):"},{"line_number":59,"context_line":"        super(ServerExternalEventsTestV275, self).setUp()"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_22889ec4","line":56,"in_reply_to":"7faddb67_0d661953","updated":"2019-07-25 15:19:21.000000000","message":"\u003e \n \u003e Normally fake drivers would be defined in nova.virt.fake and you\u0027d\n \u003e specify compute_driver \u003d \u0027fake.PowerUpdateFakeDriver\u0027. Can we do\n \u003e that for consistency and to avoid this weird stub?\n\noh yea I guess I did try to do this at some point but.. changed it thinking it would be better to put the driver in this test module itself as its more specific. I can put this in the fake.py file to make it consistent.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        self.server \u003d self._wait_for_state_change("},{"line_number":71,"context_line":"            self.api, created_server, \u0027ACTIVE\u0027)"},{"line_number":72,"context_line":"        self.event \u003d {\u0027name\u0027: \u0027power-update\u0027,"},{"line_number":73,"context_line":"                      \u0027tag\u0027: \u0027POWER_OFF\u0027,"},{"line_number":74,"context_line":"                      \u0027server_uuid\u0027: self.server[\"id\"]}"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @mock.patch(\u0027nova.tests.functional.test_server_external_events.LOG.debug\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_edbcdd6d","line":73,"range":{"start_line":73,"start_character":30,"end_line":73,"end_character":39},"updated":"2019-07-23 16:17:38.000000000","message":"Can we also have a functional test for POWER_ON?","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        self.server \u003d self._wait_for_state_change("},{"line_number":71,"context_line":"            self.api, created_server, \u0027ACTIVE\u0027)"},{"line_number":72,"context_line":"        self.event \u003d {\u0027name\u0027: \u0027power-update\u0027,"},{"line_number":73,"context_line":"                      \u0027tag\u0027: \u0027POWER_OFF\u0027,"},{"line_number":74,"context_line":"                      \u0027server_uuid\u0027: self.server[\"id\"]}"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @mock.patch(\u0027nova.tests.functional.test_server_external_events.LOG.debug\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_220dfe3d","line":73,"range":{"start_line":73,"start_character":30,"end_line":73,"end_character":39},"in_reply_to":"7faddb67_edbcdd6d","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                      \u0027tag\u0027: \u0027POWER_OFF\u0027,"},{"line_number":74,"context_line":"                      \u0027server_uuid\u0027: self.server[\"id\"]}"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @mock.patch(\u0027nova.tests.functional.test_server_external_events.LOG.debug\u0027)"},{"line_number":77,"context_line":"    def test_server_power_update(self, mock_debug):"},{"line_number":78,"context_line":"        rule1 \u003d \u0027os_compute_api:os-server-external-events:create\u0027"},{"line_number":79,"context_line":"        rule2 \u003d \u0027os_compute_api:servers:detail\u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_0df4d95a","line":76,"updated":"2019-07-23 16:17:38.000000000","message":"We shouldn\u0027t need to mock out logging in the tests, you can assert things like:\n\nself.assertIn(\u0027...\u0027, self.stdlog.logger.output)","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                      \u0027tag\u0027: \u0027POWER_OFF\u0027,"},{"line_number":74,"context_line":"                      \u0027server_uuid\u0027: self.server[\"id\"]}"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @mock.patch(\u0027nova.tests.functional.test_server_external_events.LOG.debug\u0027)"},{"line_number":77,"context_line":"    def test_server_power_update(self, mock_debug):"},{"line_number":78,"context_line":"        rule1 \u003d \u0027os_compute_api:os-server-external-events:create\u0027"},{"line_number":79,"context_line":"        rule2 \u003d \u0027os_compute_api:servers:detail\u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_425a7a50","line":76,"in_reply_to":"7faddb67_0df4d95a","updated":"2019-07-25 15:19:21.000000000","message":"oh cool, thanks Matt, this is way neater!","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                      \u0027server_uuid\u0027: self.server[\"id\"]}"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @mock.patch(\u0027nova.tests.functional.test_server_external_events.LOG.debug\u0027)"},{"line_number":77,"context_line":"    def test_server_power_update(self, mock_debug):"},{"line_number":78,"context_line":"        rule1 \u003d \u0027os_compute_api:os-server-external-events:create\u0027"},{"line_number":79,"context_line":"        rule2 \u003d \u0027os_compute_api:servers:detail\u0027"},{"line_number":80,"context_line":"        rule3 \u003d \u0027os_compute_api:os-instance-actions\u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_6dd9cdf2","line":77,"range":{"start_line":77,"start_character":8,"end_line":77,"end_character":32},"updated":"2019-07-23 16:17:38.000000000","message":"A description of the test would be useful.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                      \u0027server_uuid\u0027: self.server[\"id\"]}"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @mock.patch(\u0027nova.tests.functional.test_server_external_events.LOG.debug\u0027)"},{"line_number":77,"context_line":"    def test_server_power_update(self, mock_debug):"},{"line_number":78,"context_line":"        rule1 \u003d \u0027os_compute_api:os-server-external-events:create\u0027"},{"line_number":79,"context_line":"        rule2 \u003d \u0027os_compute_api:servers:detail\u0027"},{"line_number":80,"context_line":"        rule3 \u003d \u0027os_compute_api:os-instance-actions\u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_3d1c4312","line":77,"range":{"start_line":77,"start_character":8,"end_line":77,"end_character":32},"in_reply_to":"7faddb67_6dd9cdf2","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        rule2 \u003d \u0027os_compute_api:servers:detail\u0027"},{"line_number":80,"context_line":"        rule3 \u003d \u0027os_compute_api:os-instance-actions\u0027"},{"line_number":81,"context_line":"        rule4 \u003d \u0027os_compute_api:servers:show\u0027"},{"line_number":82,"context_line":"        self.policy.set_rules({rule1: \u0027@\u0027, rule2: \u0027@\u0027, rule3: \u0027@\u0027, rule4: \u0027@\u0027})"},{"line_number":83,"context_line":"        self.assertEqual("},{"line_number":84,"context_line":"            power_state.RUNNING, self.server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":85,"context_line":"        self.api.create_server_external_events(events\u003d[self.event])"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_6d022d41","line":82,"updated":"2019-07-23 16:17:38.000000000","message":"Why do we need this? Why not just use self.admin_api for the tests?","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        rule2 \u003d \u0027os_compute_api:servers:detail\u0027"},{"line_number":80,"context_line":"        rule3 \u003d \u0027os_compute_api:os-instance-actions\u0027"},{"line_number":81,"context_line":"        rule4 \u003d \u0027os_compute_api:servers:show\u0027"},{"line_number":82,"context_line":"        self.policy.set_rules({rule1: \u0027@\u0027, rule2: \u0027@\u0027, rule3: \u0027@\u0027, rule4: \u0027@\u0027})"},{"line_number":83,"context_line":"        self.assertEqual("},{"line_number":84,"context_line":"            power_state.RUNNING, self.server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":85,"context_line":"        self.api.create_server_external_events(events\u003d[self.event])"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_1dae27e7","line":82,"in_reply_to":"7faddb67_6d022d41","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        self.policy.set_rules({rule1: \u0027@\u0027, rule2: \u0027@\u0027, rule3: \u0027@\u0027, rule4: \u0027@\u0027})"},{"line_number":83,"context_line":"        self.assertEqual("},{"line_number":84,"context_line":"            power_state.RUNNING, self.server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":85,"context_line":"        self.api.create_server_external_events(events\u003d[self.event])"},{"line_number":86,"context_line":"        expected_params \u003d {\u0027OS-EXT-STS:task_state\u0027: None,"},{"line_number":87,"context_line":"                           \u0027OS-EXT-STS:vm_state\u0027: vm_states.STOPPED,"},{"line_number":88,"context_line":"                           \u0027OS-EXT-STS:power_state\u0027: power_state.SHUTDOWN}"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_ad9d850b","line":85,"range":{"start_line":85,"start_character":13,"end_line":85,"end_character":16},"updated":"2019-07-23 16:17:38.000000000","message":"I\u0027m pretty sure this is admin_api in ProviderUsageBaseTestCase anyway so not sure why we need the policy rule stuff above.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        self.policy.set_rules({rule1: \u0027@\u0027, rule2: \u0027@\u0027, rule3: \u0027@\u0027, rule4: \u0027@\u0027})"},{"line_number":83,"context_line":"        self.assertEqual("},{"line_number":84,"context_line":"            power_state.RUNNING, self.server[\u0027OS-EXT-STS:power_state\u0027])"},{"line_number":85,"context_line":"        self.api.create_server_external_events(events\u003d[self.event])"},{"line_number":86,"context_line":"        expected_params \u003d {\u0027OS-EXT-STS:task_state\u0027: None,"},{"line_number":87,"context_line":"                           \u0027OS-EXT-STS:vm_state\u0027: vm_states.STOPPED,"},{"line_number":88,"context_line":"                           \u0027OS-EXT-STS:power_state\u0027: power_state.SHUTDOWN}"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_0202420c","line":85,"range":{"start_line":85,"start_character":13,"end_line":85,"end_character":16},"in_reply_to":"7faddb67_ad9d850b","updated":"2019-07-25 15:19:21.000000000","message":"\u003e I\u0027m pretty sure this is admin_api in ProviderUsageBaseTestCase\n \u003e anyway so not sure why we need the policy rule stuff above.\n\nyar, I think I needed this because I wasn\u0027t initially doing this via client api (https://review.opendev.org/#/c/645611/6/nova/tests/functional/test_server_external_events.py@102). I can remove these policy checks safely.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f932343f1c3d83043e1946dbe4e055dad22da0df","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                           \u0027OS-EXT-STS:power_state\u0027: power_state.SHUTDOWN}"},{"line_number":89,"context_line":"        server \u003d self._wait_for_server_parameter(self.api, self.server,"},{"line_number":90,"context_line":"                                                 expected_params)"},{"line_number":91,"context_line":"        msg \u003d (\u0027Power update called for %s from this fake driver\u0027,"},{"line_number":92,"context_line":"               self.server[\u0027id\u0027])"},{"line_number":93,"context_line":"        mock_debug.assert_called_once_with(*msg)"},{"line_number":94,"context_line":"        # Test if this is logged in the instance action list."},{"line_number":95,"context_line":"        actions \u003d self.api.get_instance_actions(server[\u0027id\u0027])"},{"line_number":96,"context_line":"        self.assertEqual(2, len(actions))"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_e2b98d78","line":93,"range":{"start_line":91,"start_character":0,"end_line":93,"end_character":48},"updated":"2019-07-18 12:50:02.000000000","message":"You can assert the log from the IronicDriver instead but I can accept not even looking at the log in the functional test.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                           \u0027OS-EXT-STS:power_state\u0027: power_state.SHUTDOWN}"},{"line_number":89,"context_line":"        server \u003d self._wait_for_server_parameter(self.api, self.server,"},{"line_number":90,"context_line":"                                                 expected_params)"},{"line_number":91,"context_line":"        msg \u003d (\u0027Power update called for %s from this fake driver\u0027,"},{"line_number":92,"context_line":"               self.server[\u0027id\u0027])"},{"line_number":93,"context_line":"        mock_debug.assert_called_once_with(*msg)"},{"line_number":94,"context_line":"        # Test if this is logged in the instance action list."},{"line_number":95,"context_line":"        actions \u003d self.api.get_instance_actions(server[\u0027id\u0027])"},{"line_number":96,"context_line":"        self.assertEqual(2, len(actions))"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_3da9a3dc","line":93,"range":{"start_line":91,"start_character":0,"end_line":93,"end_character":48},"in_reply_to":"7faddb67_e2b98d78","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from nova.tests.unit import fake_notifier"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class ServerExternalEventsTestV21("},{"line_number":20,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":21,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_27bacc6d","line":19,"updated":"2019-08-13 14:30:42.000000000","message":"Why have this separate base test class when there is only one sub-class? IOW, why not just combine this and ServerExternalEventsTestV276?","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from nova.tests.unit import fake_notifier"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class ServerExternalEventsTestV21("},{"line_number":20,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":21,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_9873b780","line":19,"in_reply_to":"7faddb67_07653f1d","updated":"2019-08-15 15:18:06.000000000","message":"I don\u0027t really envision more versioned tests for this event but if they happen someone can refactor the base class stuff out.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from nova.tests.unit import fake_notifier"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class ServerExternalEventsTestV21("},{"line_number":20,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":21,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_07653f1d","line":19,"in_reply_to":"7faddb67_27bacc6d","updated":"2019-08-14 12:54:15.000000000","message":"\u003e Why have this separate base test class when there is only one\n \u003e sub-class? IOW, why not just combine this and ServerExternalEventsTestV276?\n\nWell it was just a padding for future versioned tests since I started the new file.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        created_server \u003d self.api.post_server({\u0027server\u0027: server_req})"},{"line_number":41,"context_line":"        self.server \u003d self._wait_for_state_change("},{"line_number":42,"context_line":"            self.api, created_server, \u0027ACTIVE\u0027)"},{"line_number":43,"context_line":"        self.event1 \u003d {\u0027name\u0027: \u0027power-update\u0027,"},{"line_number":44,"context_line":"                       \u0027tag\u0027: \u0027POWER_OFF\u0027,"},{"line_number":45,"context_line":"                       \u0027server_uuid\u0027: self.server[\"id\"]}"},{"line_number":46,"context_line":"        self.event2 \u003d {\u0027name\u0027: \u0027power-update\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_27488c85","line":43,"range":{"start_line":43,"start_character":13,"end_line":43,"end_character":19},"updated":"2019-08-13 14:30:42.000000000","message":"nit: naming this power_off and the other power_on would be more descriptive and self-documenting for the test code below.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        created_server \u003d self.api.post_server({\u0027server\u0027: server_req})"},{"line_number":41,"context_line":"        self.server \u003d self._wait_for_state_change("},{"line_number":42,"context_line":"            self.api, created_server, \u0027ACTIVE\u0027)"},{"line_number":43,"context_line":"        self.event1 \u003d {\u0027name\u0027: \u0027power-update\u0027,"},{"line_number":44,"context_line":"                       \u0027tag\u0027: \u0027POWER_OFF\u0027,"},{"line_number":45,"context_line":"                       \u0027server_uuid\u0027: self.server[\"id\"]}"},{"line_number":46,"context_line":"        self.event2 \u003d {\u0027name\u0027: \u0027power-update\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_074e9f95","line":43,"range":{"start_line":43,"start_character":13,"end_line":43,"end_character":19},"in_reply_to":"7faddb67_27488c85","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                           \u0027OS-EXT-STS:power_state\u0027: power_state.SHUTDOWN}"},{"line_number":59,"context_line":"        server \u003d self._wait_for_server_parameter(self.api, self.server,"},{"line_number":60,"context_line":"                                                 expected_params)"},{"line_number":61,"context_line":"        msg \u003d (\u0027Power update called for instance\u0027)"},{"line_number":62,"context_line":"        self.assertIn(msg, self.stdlog.logger.output)"},{"line_number":63,"context_line":"        # Test if this is logged in the instance action list."},{"line_number":64,"context_line":"        actions \u003d self.api.get_instance_actions(server[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_87586056","line":61,"range":{"start_line":61,"start_character":14,"end_line":61,"end_character":15},"updated":"2019-08-13 14:30:42.000000000","message":"nit: don\u0027t need the paranthesis","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                           \u0027OS-EXT-STS:power_state\u0027: power_state.SHUTDOWN}"},{"line_number":59,"context_line":"        server \u003d self._wait_for_server_parameter(self.api, self.server,"},{"line_number":60,"context_line":"                                                 expected_params)"},{"line_number":61,"context_line":"        msg \u003d (\u0027Power update called for instance\u0027)"},{"line_number":62,"context_line":"        self.assertIn(msg, self.stdlog.logger.output)"},{"line_number":63,"context_line":"        # Test if this is logged in the instance action list."},{"line_number":64,"context_line":"        actions \u003d self.api.get_instance_actions(server[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_e74a6381","line":61,"range":{"start_line":61,"start_character":14,"end_line":61,"end_character":15},"in_reply_to":"7faddb67_87586056","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        actions \u003d self.api.get_instance_actions(server[\u0027id\u0027])"},{"line_number":65,"context_line":"        self.assertEqual(2, len(actions))"},{"line_number":66,"context_line":"        acts \u003d [action[\u0027action\u0027] for action in actions]"},{"line_number":67,"context_line":"        self.assertEqual([\u0027stop\u0027, \u0027create\u0027], acts)"},{"line_number":68,"context_line":"        # Test if notifications were emitted."},{"line_number":69,"context_line":"        fake_notifier.wait_for_versioned_notifications("},{"line_number":70,"context_line":"            \u0027instance.power_off.start\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_273decdc","line":67,"updated":"2019-08-13 14:30:42.000000000","message":"nit: this may be racy, I\u0027ve seen tests that rely on instance action events to race in functional tests if we\u0027re hitting the same created_at/updated_at (whatever does the sorting in the DB API layer) at a low even value, like milliseconds. It might be better to compare sorted values.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        actions \u003d self.api.get_instance_actions(server[\u0027id\u0027])"},{"line_number":65,"context_line":"        self.assertEqual(2, len(actions))"},{"line_number":66,"context_line":"        acts \u003d [action[\u0027action\u0027] for action in actions]"},{"line_number":67,"context_line":"        self.assertEqual([\u0027stop\u0027, \u0027create\u0027], acts)"},{"line_number":68,"context_line":"        # Test if notifications were emitted."},{"line_number":69,"context_line":"        fake_notifier.wait_for_versioned_notifications("},{"line_number":70,"context_line":"            \u0027instance.power_off.start\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_c73c07e3","line":67,"in_reply_to":"7faddb67_273decdc","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":78,"context_line":"                           \u0027OS-EXT-STS:power_state\u0027: power_state.RUNNING}"},{"line_number":79,"context_line":"        server \u003d self._wait_for_server_parameter(self.api, self.server,"},{"line_number":80,"context_line":"                                                 expected_params)"},{"line_number":81,"context_line":"        msg \u003d (\u0027Power update called for instance\u0027)"},{"line_number":82,"context_line":"        self.assertIn(msg, self.stdlog.logger.output)"},{"line_number":83,"context_line":"        # Test if this is logged in the instance action list."},{"line_number":84,"context_line":"        actions \u003d self.api.get_instance_actions(server[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_671c4477","line":81,"range":{"start_line":81,"start_character":14,"end_line":81,"end_character":16},"updated":"2019-08-13 14:30:42.000000000","message":"same - also, note that if this message was in the logs before, it\u0027s going to be in the logs again, so this check isn\u0027t really useful unless you can make them unique messages to look for, like making sure one says POWER_OFF and one says POWER_ON.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":78,"context_line":"                           \u0027OS-EXT-STS:power_state\u0027: power_state.RUNNING}"},{"line_number":79,"context_line":"        server \u003d self._wait_for_server_parameter(self.api, self.server,"},{"line_number":80,"context_line":"                                                 expected_params)"},{"line_number":81,"context_line":"        msg \u003d (\u0027Power update called for instance\u0027)"},{"line_number":82,"context_line":"        self.assertIn(msg, self.stdlog.logger.output)"},{"line_number":83,"context_line":"        # Test if this is logged in the instance action list."},{"line_number":84,"context_line":"        actions \u003d self.api.get_instance_actions(server[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_aa0d12e9","line":81,"range":{"start_line":81,"start_character":14,"end_line":81,"end_character":16},"in_reply_to":"7faddb67_671c4477","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        actions \u003d self.api.get_instance_actions(server[\u0027id\u0027])"},{"line_number":85,"context_line":"        self.assertEqual(3, len(actions))"},{"line_number":86,"context_line":"        acts \u003d [action[\u0027action\u0027] for action in actions]"},{"line_number":87,"context_line":"        self.assertEqual([\u0027start\u0027, \u0027stop\u0027, \u0027create\u0027], acts)"},{"line_number":88,"context_line":"        # Test if notifications were emitted."},{"line_number":89,"context_line":"        fake_notifier.wait_for_versioned_notifications("},{"line_number":90,"context_line":"            \u0027instance.power_on.start\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_a701dc08","line":87,"updated":"2019-08-13 14:30:42.000000000","message":"same nit as above, or do a delta for the 2nd action list and assert the only new action is \u0027start\u0027.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        actions \u003d self.api.get_instance_actions(server[\u0027id\u0027])"},{"line_number":85,"context_line":"        self.assertEqual(3, len(actions))"},{"line_number":86,"context_line":"        acts \u003d [action[\u0027action\u0027] for action in actions]"},{"line_number":87,"context_line":"        self.assertEqual([\u0027start\u0027, \u0027stop\u0027, \u0027create\u0027], acts)"},{"line_number":88,"context_line":"        # Test if notifications were emitted."},{"line_number":89,"context_line":"        fake_notifier.wait_for_versioned_notifications("},{"line_number":90,"context_line":"            \u0027instance.power_on.start\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_6af71ad6","line":87,"in_reply_to":"7faddb67_a701dc08","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from nova.tests.unit import fake_notifier"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class ServerExternalEventsTestV21("},{"line_number":23,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":24,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_7866fbbd","line":22,"updated":"2019-08-15 15:18:06.000000000","message":"I think we can ditch the base class and just combine the setup for now - if there are future versioned tests this module then we can abstract things as necessary then, but I don\u0027t see that happening anytime soon for this event.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from nova.tests.unit import fake_notifier"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class ServerExternalEventsTestV21("},{"line_number":23,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":24,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_58ef7fb0","line":22,"in_reply_to":"7faddb67_7866fbbd","updated":"2019-08-15 16:05:59.000000000","message":"Done","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                         \u0027tag\u0027: \u0027POWER_ON\u0027,"},{"line_number":51,"context_line":"                         \u0027server_uuid\u0027: self.server[\"id\"]}"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    @mock.patch.object(compute_utils, \u0027EventReporter\u0027)"},{"line_number":54,"context_line":"    def test_server_power_update(self, mock_event):"},{"line_number":55,"context_line":"        # This test checks the functionality of handling the \"power-update\""},{"line_number":56,"context_line":"        # external events."}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_f80f4bdd","line":53,"updated":"2019-08-15 15:18:06.000000000","message":"This is not what I was suggesting when I said you could test the events in the functional test. You should actually be checking the API response for the instance action, like here:\n\nhttps://review.opendev.org/#/c/637316/37/nova/tests/functional/test_cross_cell_migrate.py@451","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                         \u0027tag\u0027: \u0027POWER_ON\u0027,"},{"line_number":51,"context_line":"                         \u0027server_uuid\u0027: self.server[\"id\"]}"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    @mock.patch.object(compute_utils, \u0027EventReporter\u0027)"},{"line_number":54,"context_line":"    def test_server_power_update(self, mock_event):"},{"line_number":55,"context_line":"        # This test checks the functionality of handling the \"power-update\""},{"line_number":56,"context_line":"        # external events."}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_d31d9062","line":53,"in_reply_to":"7faddb67_f80f4bdd","updated":"2019-08-15 16:05:59.000000000","message":"Done","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f41cbaf0e97c0f4a7a67b7969d5bdcba34f7b43","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        self.assertEqual(2, len(actions))"},{"line_number":60,"context_line":"        acts \u003d {action[\u0027action\u0027]: action for action in actions}"},{"line_number":61,"context_line":"        self.assertEqual([\u0027create\u0027, \u0027stop\u0027], sorted(acts))"},{"line_number":62,"context_line":"        confirm_action \u003d acts[instance_actions.STOP]"},{"line_number":63,"context_line":"        detail \u003d self.api.api_get("},{"line_number":64,"context_line":"            \u0027/servers/%s/os-instance-actions/%s\u0027 % ("},{"line_number":65,"context_line":"                server[\u0027id\u0027], confirm_action[\u0027request_id\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_5e8d277a","line":62,"range":{"start_line":62,"start_character":8,"end_line":62,"end_character":22},"updated":"2019-08-15 16:34:38.000000000","message":"copy/paste error, should be stop_action","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d8941968c81c292abacca4cf574fb819c57f6b5","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        self.assertEqual(2, len(actions))"},{"line_number":60,"context_line":"        acts \u003d {action[\u0027action\u0027]: action for action in actions}"},{"line_number":61,"context_line":"        self.assertEqual([\u0027create\u0027, \u0027stop\u0027], sorted(acts))"},{"line_number":62,"context_line":"        confirm_action \u003d acts[instance_actions.STOP]"},{"line_number":63,"context_line":"        detail \u003d self.api.api_get("},{"line_number":64,"context_line":"            \u0027/servers/%s/os-instance-actions/%s\u0027 % ("},{"line_number":65,"context_line":"                server[\u0027id\u0027], confirm_action[\u0027request_id\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_9e6cff36","line":62,"range":{"start_line":62,"start_character":8,"end_line":62,"end_character":22},"in_reply_to":"7faddb67_5e8d277a","updated":"2019-08-15 17:05:09.000000000","message":"Done","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f41cbaf0e97c0f4a7a67b7969d5bdcba34f7b43","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        self.assertEqual(3, len(actions))"},{"line_number":89,"context_line":"        acts \u003d {action[\u0027action\u0027]: action for action in actions}"},{"line_number":90,"context_line":"        self.assertEqual([\u0027create\u0027, \u0027start\u0027, \u0027stop\u0027], sorted(acts))"},{"line_number":91,"context_line":"        confirm_action \u003d acts[instance_actions.START]"},{"line_number":92,"context_line":"        detail \u003d self.api.api_get("},{"line_number":93,"context_line":"            \u0027/servers/%s/os-instance-actions/%s\u0027 % ("},{"line_number":94,"context_line":"                server[\u0027id\u0027], confirm_action[\u0027request_id\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_fef3b307","line":91,"range":{"start_line":91,"start_character":8,"end_line":91,"end_character":22},"updated":"2019-08-15 16:34:38.000000000","message":"start_action","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d8941968c81c292abacca4cf574fb819c57f6b5","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        self.assertEqual(3, len(actions))"},{"line_number":89,"context_line":"        acts \u003d {action[\u0027action\u0027]: action for action in actions}"},{"line_number":90,"context_line":"        self.assertEqual([\u0027create\u0027, \u0027start\u0027, \u0027stop\u0027], sorted(acts))"},{"line_number":91,"context_line":"        confirm_action \u003d acts[instance_actions.START]"},{"line_number":92,"context_line":"        detail \u003d self.api.api_get("},{"line_number":93,"context_line":"            \u0027/servers/%s/os-instance-actions/%s\u0027 % ("},{"line_number":94,"context_line":"                server[\u0027id\u0027], confirm_action[\u0027request_id\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_be69bb25","line":91,"range":{"start_line":91,"start_character":8,"end_line":91,"end_character":22},"in_reply_to":"7faddb67_fef3b307","updated":"2019-08-15 17:05:09.000000000","message":"Done","commit_id":"4feb2ff4ea2d4062095b7473c99504d1512f254b"}],"nova/tests/unit/api/openstack/compute/test_server_external_events.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":213,"context_line":"            fake_get_by_instance_uuids)"},{"line_number":214,"context_line":"@mock.patch(\u0027nova.objects.InstanceList.get_by_filters\u0027,"},{"line_number":215,"context_line":"            fake_get_by_filters)"},{"line_number":216,"context_line":"class ServerExternalEventsTestV275(ServerExternalEventsTestV21):"},{"line_number":217,"context_line":"    wsgi_api_version \u003d \u00272.75\u0027"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def test_create_with_missing_tag(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_d025f8ac","line":216,"updated":"2019-07-23 16:17:38.000000000","message":"As noted in the functional test, there should be a negative unit tests that passing the power-update event to 2.74 results in a schema validation failure.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":213,"context_line":"            fake_get_by_instance_uuids)"},{"line_number":214,"context_line":"@mock.patch(\u0027nova.objects.InstanceList.get_by_filters\u0027,"},{"line_number":215,"context_line":"            fake_get_by_filters)"},{"line_number":216,"context_line":"class ServerExternalEventsTestV275(ServerExternalEventsTestV21):"},{"line_number":217,"context_line":"    wsgi_api_version \u003d \u00272.75\u0027"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def test_create_with_missing_tag(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_fdea2bd6","line":216,"in_reply_to":"7faddb67_d025f8ac","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"7faddb67_6d754dcc","line":231,"updated":"2019-07-23 16:17:38.000000000","message":"Can we also assert that \"Event tag is missing for instance\" is logged?","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"7faddb67_35b1b790","line":231,"in_reply_to":"7faddb67_6d754dcc","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"acff7ab05e9fd8d9b6a7b51404f8088b1ac59196","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                                             self.resp_event_2]}"},{"line_number":98,"context_line":"        self.req \u003d fakes.HTTPRequest.blank(\u0027\u0027, use_admin_context\u003dTrue,"},{"line_number":99,"context_line":"                                           version\u003dself.wsgi_api_version)"},{"line_number":100,"context_line":"        os.environ[\u0027OS_DEBUG\u0027] \u003d \u00271\u0027"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _assert_call(self, body, expected_uuids, expected_events):"},{"line_number":103,"context_line":"        with mock.patch.object(self.api.compute_api,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_51bd5866","line":100,"range":{"start_line":100,"start_character":7,"end_line":100,"end_character":36},"updated":"2019-07-26 12:36:47.000000000","message":"i assume we dont want to hardcode this and this was just left over from your own debugging?","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"e5cdbff026a224f6985b0833d1f99d85854b0d1f","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                                             self.resp_event_2]}"},{"line_number":98,"context_line":"        self.req \u003d fakes.HTTPRequest.blank(\u0027\u0027, use_admin_context\u003dTrue,"},{"line_number":99,"context_line":"                                           version\u003dself.wsgi_api_version)"},{"line_number":100,"context_line":"        os.environ[\u0027OS_DEBUG\u0027] \u003d \u00271\u0027"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _assert_call(self, body, expected_uuids, expected_events):"},{"line_number":103,"context_line":"        with mock.patch.object(self.api.compute_api,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_4df36674","line":100,"range":{"start_line":100,"start_character":7,"end_line":100,"end_character":36},"in_reply_to":"7faddb67_035f9341","updated":"2019-07-29 08:13:25.000000000","message":"probably its neater if I used self.useFixture(fx.EnvironmentVariable(\u0027OS_DEBUG\u0027, \u00271\u0027)) instead","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"e2f7ad73bff15cd57a8422c6c0af9e5da423f169","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                                             self.resp_event_2]}"},{"line_number":98,"context_line":"        self.req \u003d fakes.HTTPRequest.blank(\u0027\u0027, use_admin_context\u003dTrue,"},{"line_number":99,"context_line":"                                           version\u003dself.wsgi_api_version)"},{"line_number":100,"context_line":"        os.environ[\u0027OS_DEBUG\u0027] \u003d \u00271\u0027"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _assert_call(self, body, expected_uuids, expected_events):"},{"line_number":103,"context_line":"        with mock.patch.object(self.api.compute_api,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_035f9341","line":100,"range":{"start_line":100,"start_character":7,"end_line":100,"end_character":36},"in_reply_to":"7faddb67_51bd5866","updated":"2019-07-26 13:39:43.000000000","message":"not really I added this because L229 requires the logging to the standard output to be in DEBUG mode. By default its in INFO and above levels. I added this because out fixtures say so (https://github.com/openstack/nova/blob/ffa85a9263ae2ea7a41d60712320149d052d108b/nova/tests/fixtures.py#L156)","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"0d7fdd81ac739d30e5c263a3e7bcab0e7c3eae3e","unresolved":false,"context_lines":[{"line_number":217,"context_line":"            fake_get_by_filters)"},{"line_number":218,"context_line":"class ServerExternalEventsTestV275(ServerExternalEventsTestV21):"},{"line_number":219,"context_line":"    wsgi_api_version \u003d \u00272.75\u0027"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def test_create_with_missing_tag(self):"},{"line_number":222,"context_line":"        body \u003d self.default_body"},{"line_number":223,"context_line":"        body[\u0027events\u0027][0][\u0027name\u0027] \u003d \u0027power-update\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_1be053fa","line":220,"updated":"2019-07-27 05:39:53.000000000","message":"Missing a normal test flow in microversion 2.75(allowed create power-update event).","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"785017ff6e79a78c3e76f329a7971a4800c9a241","unresolved":false,"context_lines":[{"line_number":217,"context_line":"            fake_get_by_filters)"},{"line_number":218,"context_line":"class ServerExternalEventsTestV275(ServerExternalEventsTestV21):"},{"line_number":219,"context_line":"    wsgi_api_version \u003d \u00272.75\u0027"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def test_create_with_missing_tag(self):"},{"line_number":222,"context_line":"        body \u003d self.default_body"},{"line_number":223,"context_line":"        body[\u0027events\u0027][0][\u0027name\u0027] \u003d \u0027power-update\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_ad3bface","line":220,"in_reply_to":"7faddb67_1be053fa","updated":"2019-07-29 07:14:03.000000000","message":"Check the other functional test, cores in nova don\u0027t recommend repeating tests in both unit and functional just because we have to \"fill it\". Unit tests are meant to only test corner and negative cases.","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a7be5f932894dbb2062c52c39c19a76005210b9c","unresolved":false,"context_lines":[{"line_number":217,"context_line":"            fake_get_by_filters)"},{"line_number":218,"context_line":"class ServerExternalEventsTestV275(ServerExternalEventsTestV21):"},{"line_number":219,"context_line":"    wsgi_api_version \u003d \u00272.75\u0027"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def test_create_with_missing_tag(self):"},{"line_number":222,"context_line":"        body \u003d self.default_body"},{"line_number":223,"context_line":"        body[\u0027events\u0027][0][\u0027name\u0027] \u003d \u0027power-update\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_88b38c4d","line":220,"in_reply_to":"7faddb67_ad3bface","updated":"2019-07-29 08:49:43.000000000","message":"I donot think add the normal test isnot necessary.\n- Unit testing is to ensure that your interface is ok.\n- Functional test is to see if the effect is achieved from the external test application from the perspective of the user.\n\nSo, it is necessary to test whether the interface can be returned normally.","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"0d7fdd81ac739d30e5c263a3e7bcab0e7c3eae3e","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        self.assertEqual(207, code)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def test_create_event_auth_pre_2_75_fails(self):"},{"line_number":237,"context_line":"        # Negative test to make sure you can\u0027t create \u0027power-update\u0027"},{"line_number":238,"context_line":"        # before 2.75."},{"line_number":239,"context_line":"        body \u003d self.default_body"},{"line_number":240,"context_line":"        body[\u0027events\u0027][0][\u0027name\u0027] \u003d \u0027power-update\u0027"},{"line_number":241,"context_line":"        body[\u0027events\u0027][1][\u0027name\u0027] \u003d \u0027power-update\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_9b99a37a","line":238,"range":{"start_line":237,"start_character":0,"end_line":238,"end_character":22},"updated":"2019-07-27 05:39:53.000000000","message":"nit: This is an explanation of the function, you can use \"\"\"Negative test to make sure you can\u0027t create \u0027power-update\u0027 before 2.75.\"\"\"","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"785017ff6e79a78c3e76f329a7971a4800c9a241","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        self.assertEqual(207, code)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def test_create_event_auth_pre_2_75_fails(self):"},{"line_number":237,"context_line":"        # Negative test to make sure you can\u0027t create \u0027power-update\u0027"},{"line_number":238,"context_line":"        # before 2.75."},{"line_number":239,"context_line":"        body \u003d self.default_body"},{"line_number":240,"context_line":"        body[\u0027events\u0027][0][\u0027name\u0027] \u003d \u0027power-update\u0027"},{"line_number":241,"context_line":"        body[\u0027events\u0027][1][\u0027name\u0027] \u003d \u0027power-update\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_6d3502da","line":238,"range":{"start_line":237,"start_character":0,"end_line":238,"end_character":22},"in_reply_to":"7faddb67_9b99a37a","updated":"2019-07-29 07:14:03.000000000","message":"\u003e nit: This is an explanation of the function, you can use\n \u003e \"\"\"Negative test to make sure you can\u0027t create \u0027power-update\u0027\n \u003e before 2.75.\"\"\"\n\nas long as you understand :)","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        body[\u0027events\u0027][1][\u0027name\u0027] \u003d \u0027power-update\u0027"},{"line_number":248,"context_line":"        req \u003d fakes.HTTPRequestV21.blank("},{"line_number":249,"context_line":"            \u0027/os-server-external-events\u0027, version\u003d\u00272.75\u0027)"},{"line_number":250,"context_line":"        self.assertRaises("},{"line_number":251,"context_line":"            exception.ValidationError,"},{"line_number":252,"context_line":"            self.api.create,"},{"line_number":253,"context_line":"            req,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_591b3072","line":250,"updated":"2019-08-13 14:30:42.000000000","message":"Assert the validation error is for what you expect by trapping the exception variable returned from this and assert something in the error message.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        body[\u0027events\u0027][1][\u0027name\u0027] \u003d \u0027power-update\u0027"},{"line_number":248,"context_line":"        req \u003d fakes.HTTPRequestV21.blank("},{"line_number":249,"context_line":"            \u0027/os-server-external-events\u0027, version\u003d\u00272.75\u0027)"},{"line_number":250,"context_line":"        self.assertRaises("},{"line_number":251,"context_line":"            exception.ValidationError,"},{"line_number":252,"context_line":"            self.api.create,"},{"line_number":253,"context_line":"            req,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_0a8c6633","line":250,"in_reply_to":"7faddb67_591b3072","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"}],"nova/tests/unit/compute/test_compute_api.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":4101,"context_line":"            mock_ex.assert_has_calls("},{"line_number":4102,"context_line":"                [mock.call(self.context, [instance2],"},{"line_number":4103,"context_line":"                           [events[1]], host\u003du\u0027host2\u0027),"},{"line_number":4104,"context_line":"                 mock.call(self.context, [instance1], [], host\u003du\u0027host1\u0027)],"},{"line_number":4105,"context_line":"                any_order\u003dTrue)"},{"line_number":4106,"context_line":"            mock_instance_save.assert_called_once_with("},{"line_number":4107,"context_line":"                expected_task_state\u003d[None])"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_b7d46021","line":4104,"updated":"2019-07-16 10:51:16.000000000","message":"Ohh we really sending an empty event list for host1 too? This seems strange but probably unrelated to your change.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":4101,"context_line":"            mock_ex.assert_has_calls("},{"line_number":4102,"context_line":"                [mock.call(self.context, [instance2],"},{"line_number":4103,"context_line":"                           [events[1]], host\u003du\u0027host2\u0027),"},{"line_number":4104,"context_line":"                 mock.call(self.context, [instance1], [], host\u003du\u0027host1\u0027)],"},{"line_number":4105,"context_line":"                any_order\u003dTrue)"},{"line_number":4106,"context_line":"            mock_instance_save.assert_called_once_with("},{"line_number":4107,"context_line":"                expected_task_state\u003d[None])"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_fe07fe16","line":4104,"in_reply_to":"7faddb67_b7d46021","updated":"2019-07-18 11:32:53.000000000","message":"yea, it looks like we process and send events based on host.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":4071,"context_line":"            self.compute_api.external_instance_event(self.context,"},{"line_number":4072,"context_line":"                instances, events)"},{"line_number":4073,"context_line":"            self.assertEqual(2, mock_ex.call_count)"},{"line_number":4074,"context_line":"            # event vacation requested on instance1 is ignored because"},{"line_number":4075,"context_line":"            # its an invalid event tag."},{"line_number":4076,"context_line":"            mock_ex.assert_has_calls("},{"line_number":4077,"context_line":"                [mock.call(self.context, [instance2],"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_78fb5bbd","line":4074,"range":{"start_line":4074,"start_character":20,"end_line":4074,"end_character":28},"updated":"2019-08-15 15:18:06.000000000","message":"VACATION","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":4071,"context_line":"            self.compute_api.external_instance_event(self.context,"},{"line_number":4072,"context_line":"                instances, events)"},{"line_number":4073,"context_line":"            self.assertEqual(2, mock_ex.call_count)"},{"line_number":4074,"context_line":"            # event vacation requested on instance1 is ignored because"},{"line_number":4075,"context_line":"            # its an invalid event tag."},{"line_number":4076,"context_line":"            mock_ex.assert_has_calls("},{"line_number":4077,"context_line":"                [mock.call(self.context, [instance2],"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_d3527012","line":4074,"range":{"start_line":4074,"start_character":20,"end_line":4074,"end_character":28},"in_reply_to":"7faddb67_78fb5bbd","updated":"2019-08-15 16:05:59.000000000","message":"Done","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":2979,"context_line":"        instance.uuid \u003d uuids.instance"},{"line_number":2980,"context_line":"        instance.id \u003d 1"},{"line_number":2981,"context_line":"        instance.vm_state \u003d vm_states.STOPPED"},{"line_number":2982,"context_line":"        instance.task_state \u003d None"},{"line_number":2983,"context_line":"        instance.power_state \u003d power_state.SHUTDOWN"},{"line_number":2984,"context_line":"        instance.host \u003d self.compute.host"},{"line_number":2985,"context_line":"        instance.system_metadata \u003d {}"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_37d15024","line":2982,"range":{"start_line":2982,"start_character":8,"end_line":2982,"end_character":34},"updated":"2019-07-16 10:51:16.000000000","message":"Shouldn\u0027t the compute.api already set the instance.task_state to task_states.POWERING_ON ?","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":2979,"context_line":"        instance.uuid \u003d uuids.instance"},{"line_number":2980,"context_line":"        instance.id \u003d 1"},{"line_number":2981,"context_line":"        instance.vm_state \u003d vm_states.STOPPED"},{"line_number":2982,"context_line":"        instance.task_state \u003d None"},{"line_number":2983,"context_line":"        instance.power_state \u003d power_state.SHUTDOWN"},{"line_number":2984,"context_line":"        instance.host \u003d self.compute.host"},{"line_number":2985,"context_line":"        instance.system_metadata \u003d {}"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_38bb71c5","line":2982,"range":{"start_line":2982,"start_character":8,"end_line":2982,"end_character":34},"in_reply_to":"7faddb67_37d15024","updated":"2019-07-18 11:32:53.000000000","message":"\u003e Shouldn\u0027t the compute.api already set the instance.task_state to\n \u003e task_states.POWERING_ON ?\n\nYou are absolutely right! I guess because I mock the save I missed this in the test. Thanks for pointing this out.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1382645c91268d4748e9c0cc5423ee892ccaf473","unresolved":false,"context_lines":[{"line_number":3033,"context_line":"        ):"},{"line_number":3034,"context_line":"            self.assertRaises(NotImplementedError,"},{"line_number":3035,"context_line":"                self.compute.power_update, self.context, instance, \"POWER_ON\")"},{"line_number":3036,"context_line":"            mock_instance_notify.assert_called_once_with("},{"line_number":3037,"context_line":"                self.context, instance, self.compute.host,"},{"line_number":3038,"context_line":"                action\u003dfields.NotificationAction.POWER_ON,"},{"line_number":3039,"context_line":"                phase\u003dfields.NotificationPhase.START)"},{"line_number":3040,"context_line":"            mock_instance_usage.assert_called_once_with("},{"line_number":3041,"context_line":"                self.context, instance, \"power_on.start\")"},{"line_number":3042,"context_line":""},{"line_number":3043,"context_line":"    def test_extend_volume(self):"},{"line_number":3044,"context_line":"        inst_obj \u003d objects.Instance(id\u003d3, uuid\u003duuids.instance)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_97860413","line":3041,"range":{"start_line":3036,"start_character":0,"end_line":3041,"end_character":57},"updated":"2019-07-16 10:51:16.000000000","message":"It feels wrong that we only emit the start notification but not an end or an error notification in this case.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f932343f1c3d83043e1946dbe4e055dad22da0df","unresolved":false,"context_lines":[{"line_number":3033,"context_line":"        ):"},{"line_number":3034,"context_line":"            self.assertRaises(NotImplementedError,"},{"line_number":3035,"context_line":"                self.compute.power_update, self.context, instance, \"POWER_ON\")"},{"line_number":3036,"context_line":"            mock_instance_notify.assert_called_once_with("},{"line_number":3037,"context_line":"                self.context, instance, self.compute.host,"},{"line_number":3038,"context_line":"                action\u003dfields.NotificationAction.POWER_ON,"},{"line_number":3039,"context_line":"                phase\u003dfields.NotificationPhase.START)"},{"line_number":3040,"context_line":"            mock_instance_usage.assert_called_once_with("},{"line_number":3041,"context_line":"                self.context, instance, \"power_on.start\")"},{"line_number":3042,"context_line":""},{"line_number":3043,"context_line":"    def test_extend_volume(self):"},{"line_number":3044,"context_line":"        inst_obj \u003d objects.Instance(id\u003d3, uuid\u003duuids.instance)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_e2474d76","line":3041,"range":{"start_line":3036,"start_character":0,"end_line":3041,"end_character":57},"in_reply_to":"7faddb67_5b52e43c","updated":"2019-07-18 12:50:02.000000000","message":"You are right. There are many bad examples in the notifications where only the start is emitted then due to an error the end is never emitted and the error is simply not implemented. I\u0027m OK not to complicate this patch more notifications.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"340944b1a635593a6f678e89ed430b976b689438","unresolved":false,"context_lines":[{"line_number":3033,"context_line":"        ):"},{"line_number":3034,"context_line":"            self.assertRaises(NotImplementedError,"},{"line_number":3035,"context_line":"                self.compute.power_update, self.context, instance, \"POWER_ON\")"},{"line_number":3036,"context_line":"            mock_instance_notify.assert_called_once_with("},{"line_number":3037,"context_line":"                self.context, instance, self.compute.host,"},{"line_number":3038,"context_line":"                action\u003dfields.NotificationAction.POWER_ON,"},{"line_number":3039,"context_line":"                phase\u003dfields.NotificationPhase.START)"},{"line_number":3040,"context_line":"            mock_instance_usage.assert_called_once_with("},{"line_number":3041,"context_line":"                self.context, instance, \"power_on.start\")"},{"line_number":3042,"context_line":""},{"line_number":3043,"context_line":"    def test_extend_volume(self):"},{"line_number":3044,"context_line":"        inst_obj \u003d objects.Instance(id\u003d3, uuid\u003duuids.instance)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_5b52e43c","line":3041,"range":{"start_line":3036,"start_character":0,"end_line":3041,"end_character":57},"in_reply_to":"7faddb67_97860413","updated":"2019-07-18 11:32:53.000000000","message":"hmm, I think all the actions are like that right ? for example \"pause_instance\" is not implemented for ironic driver. I can see that it emits the START notification but will fail halfway and not emit END.","commit_id":"487991e7fef4b0c3ed55a16765633d325754a235"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":2981,"context_line":""},{"line_number":2982,"context_line":"        do_test()"},{"line_number":2983,"context_line":""},{"line_number":2984,"context_line":"    def test_power_update(self):"},{"line_number":2985,"context_line":"        instance \u003d objects.Instance(self.context)"},{"line_number":2986,"context_line":"        instance.uuid \u003d uuids.instance"},{"line_number":2987,"context_line":"        instance.id \u003d 1"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_d955e0fb","line":2984,"updated":"2019-08-13 14:30:42.000000000","message":"nit: this is mostly redundant with the functional test, the only value-add is asserting the legacy unversioned notifications are sent, so I suppose it\u0027s fine to leave it.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":2989,"context_line":"        instance.task_state \u003d task_states.POWERING_ON"},{"line_number":2990,"context_line":"        instance.power_state \u003d power_state.SHUTDOWN"},{"line_number":2991,"context_line":"        instance.host \u003d self.compute.host"},{"line_number":2992,"context_line":"        instance.system_metadata \u003d {}"},{"line_number":2993,"context_line":"        with test.nested("},{"line_number":2994,"context_line":"            mock.patch.object(nova.compute.utils,"},{"line_number":2995,"context_line":"                              \u0027notify_about_instance_action\u0027),"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_5949f05d","line":2992,"updated":"2019-08-13 14:30:42.000000000","message":"Does setting the instance.id or system_metadata matter for this test (or the one below)?","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":2989,"context_line":"        instance.task_state \u003d task_states.POWERING_ON"},{"line_number":2990,"context_line":"        instance.power_state \u003d power_state.SHUTDOWN"},{"line_number":2991,"context_line":"        instance.host \u003d self.compute.host"},{"line_number":2992,"context_line":"        instance.system_metadata \u003d {}"},{"line_number":2993,"context_line":"        with test.nested("},{"line_number":2994,"context_line":"            mock.patch.object(nova.compute.utils,"},{"line_number":2995,"context_line":"                              \u0027notify_about_instance_action\u0027),"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_8777ef3b","line":2992,"in_reply_to":"7faddb67_5949f05d","updated":"2019-08-14 12:54:15.000000000","message":"\u003e Does setting the instance.id or system_metadata matter for this\n \u003e test (or the one below)?\n\nyeah it does, was giving error otherwise. Let me check why that was the case..\n\n(later)\n\nwell looks like it was needed only when I was using fake_instance.fake_instance_obj thingy. I guess I don\u0027t need it anymore. Good catch!","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":3026,"context_line":"            mock.patch.object(self.compute, \u0027_notify_about_instance_usage\u0027),"},{"line_number":3027,"context_line":"            mock.patch.object(self.compute.driver, \u0027power_update_event\u0027,"},{"line_number":3028,"context_line":"                              side_effect\u003dNotImplementedError()),"},{"line_number":3029,"context_line":"            mock.patch.object(instance, \u0027save\u0027),"},{"line_number":3030,"context_line":"            mock.patch.object(nova.compute.utils,"},{"line_number":3031,"context_line":"                              \u0027add_instance_fault_from_exc\u0027),"},{"line_number":3032,"context_line":"        ) as ("}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_199a98c4","line":3029,"updated":"2019-08-13 14:30:42.000000000","message":"This must be from @reverts_task_state? Can we either assert this mock is called or assert that the instance.task_state is None after we got the error?","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":3026,"context_line":"            mock.patch.object(self.compute, \u0027_notify_about_instance_usage\u0027),"},{"line_number":3027,"context_line":"            mock.patch.object(self.compute.driver, \u0027power_update_event\u0027,"},{"line_number":3028,"context_line":"                              side_effect\u003dNotImplementedError()),"},{"line_number":3029,"context_line":"            mock.patch.object(instance, \u0027save\u0027),"},{"line_number":3030,"context_line":"            mock.patch.object(nova.compute.utils,"},{"line_number":3031,"context_line":"                              \u0027add_instance_fault_from_exc\u0027),"},{"line_number":3032,"context_line":"        ) as ("}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_072d3ffc","line":3029,"in_reply_to":"7faddb67_199a98c4","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":3031,"context_line":"                              \u0027add_instance_fault_from_exc\u0027),"},{"line_number":3032,"context_line":"        ) as ("},{"line_number":3033,"context_line":"            mock_instance_notify, mock_instance_usage, mock_event,"},{"line_number":3034,"context_line":"            mock_save, mock_fault"},{"line_number":3035,"context_line":"        ):"},{"line_number":3036,"context_line":"            self.assertRaises(NotImplementedError,"},{"line_number":3037,"context_line":"                self.compute.power_update, self.context, instance, \"POWER_ON\")"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_b96344dd","line":3034,"range":{"start_line":3034,"start_character":23,"end_line":3034,"end_character":33},"updated":"2019-08-13 14:30:42.000000000","message":"Assert that this is called.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":3031,"context_line":"                              \u0027add_instance_fault_from_exc\u0027),"},{"line_number":3032,"context_line":"        ) as ("},{"line_number":3033,"context_line":"            mock_instance_notify, mock_instance_usage, mock_event,"},{"line_number":3034,"context_line":"            mock_save, mock_fault"},{"line_number":3035,"context_line":"        ):"},{"line_number":3036,"context_line":"            self.assertRaises(NotImplementedError,"},{"line_number":3037,"context_line":"                self.compute.power_update, self.context, instance, \"POWER_ON\")"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_87f36f9f","line":3034,"range":{"start_line":3034,"start_character":23,"end_line":3034,"end_character":33},"in_reply_to":"7faddb67_b96344dd","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"}],"nova/tests/unit/virt/ironic/test_driver.py":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"9bc4db70e537f45ebf0b9496b2a23fe08c8c118a","unresolved":false,"context_lines":[{"line_number":1891,"context_line":"            task_state\u003dNone)"},{"line_number":1892,"context_line":"        self.driver.power_update_event(instance, common.POWER_OFF)"},{"line_number":1893,"context_line":"        self.assertIsNone(instance.task_state)"},{"line_number":1894,"context_line":"        self.assertEqual(1, mock_log.info.call_count)"},{"line_number":1895,"context_line":"        self.assertIn(\u0027possibly preempted\u0027, mock_log.info.call_args[0][0])"},{"line_number":1896,"context_line":""},{"line_number":1897,"context_line":"    @mock.patch.object(loopingcall, \u0027FixedIntervalLoopingCall\u0027)"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_f8f3cb07","line":1894,"range":{"start_line":1894,"start_character":37,"end_line":1894,"end_character":41},"updated":"2019-08-15 15:02:56.000000000","message":"remove this.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":1891,"context_line":"            task_state\u003dNone)"},{"line_number":1892,"context_line":"        self.driver.power_update_event(instance, common.POWER_OFF)"},{"line_number":1893,"context_line":"        self.assertIsNone(instance.task_state)"},{"line_number":1894,"context_line":"        self.assertEqual(1, mock_log.info.call_count)"},{"line_number":1895,"context_line":"        self.assertIn(\u0027possibly preempted\u0027, mock_log.info.call_args[0][0])"},{"line_number":1896,"context_line":""},{"line_number":1897,"context_line":"    @mock.patch.object(loopingcall, \u0027FixedIntervalLoopingCall\u0027)"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_93dcf874","line":1894,"range":{"start_line":1894,"start_character":37,"end_line":1894,"end_character":41},"in_reply_to":"7faddb67_f8f3cb07","updated":"2019-08-15 16:05:59.000000000","message":"Done","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"9bc4db70e537f45ebf0b9496b2a23fe08c8c118a","unresolved":false,"context_lines":[{"line_number":1892,"context_line":"        self.driver.power_update_event(instance, common.POWER_OFF)"},{"line_number":1893,"context_line":"        self.assertIsNone(instance.task_state)"},{"line_number":1894,"context_line":"        self.assertEqual(1, mock_log.info.call_count)"},{"line_number":1895,"context_line":"        self.assertIn(\u0027possibly preempted\u0027, mock_log.info.call_args[0][0])"},{"line_number":1896,"context_line":""},{"line_number":1897,"context_line":"    @mock.patch.object(loopingcall, \u0027FixedIntervalLoopingCall\u0027)"},{"line_number":1898,"context_line":"    @mock.patch.object(ironic_driver.IronicDriver,"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_b8d9d383","line":1895,"range":{"start_line":1895,"start_character":53,"end_line":1895,"end_character":57},"updated":"2019-08-15 15:02:56.000000000","message":"remove this.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":1892,"context_line":"        self.driver.power_update_event(instance, common.POWER_OFF)"},{"line_number":1893,"context_line":"        self.assertIsNone(instance.task_state)"},{"line_number":1894,"context_line":"        self.assertEqual(1, mock_log.info.call_count)"},{"line_number":1895,"context_line":"        self.assertIn(\u0027possibly preempted\u0027, mock_log.info.call_args[0][0])"},{"line_number":1896,"context_line":""},{"line_number":1897,"context_line":"    @mock.patch.object(loopingcall, \u0027FixedIntervalLoopingCall\u0027)"},{"line_number":1898,"context_line":"    @mock.patch.object(ironic_driver.IronicDriver,"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_b3d9f483","line":1895,"range":{"start_line":1895,"start_character":53,"end_line":1895,"end_character":57},"in_reply_to":"7faddb67_b8d9d383","updated":"2019-08-15 16:05:59.000000000","message":"Done","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"}],"nova/virt/driver.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e31317cfa045027dca817dc7274eab432457520d","unresolved":false,"context_lines":[{"line_number":878,"context_line":"        raise NotImplementedError()"},{"line_number":879,"context_line":""},{"line_number":880,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":881,"context_line":"        \"\"\"Update power state of the specified instance."},{"line_number":882,"context_line":""},{"line_number":883,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":884,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_32cfc52a","line":881,"updated":"2019-07-22 18:21:38.000000000","message":"I feel like this docstring ought to be a bit more descriptive of the context under which it can be invoked and the expectations of its overrides.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"956ea230247671030252c1589adcdeda2334668f","unresolved":false,"context_lines":[{"line_number":878,"context_line":"        raise NotImplementedError()"},{"line_number":879,"context_line":""},{"line_number":880,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":881,"context_line":"        \"\"\"Update power state of the specified instance."},{"line_number":882,"context_line":""},{"line_number":883,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":884,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_301a4c17","line":881,"in_reply_to":"7faddb67_2d2d15a8","updated":"2019-07-23 16:33:29.000000000","message":"After discussing with Dan http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2019-07-23.log.html#t2019-07-23T16:18:09 the driver interface is intentionally generic so I\u0027m not sure how much ironic-specific details we want to put in this docstring. We could mention when this is called (like Eric) said and what drivers could do, for example the implementation might be as simple as updating vm_state/task_state/power_state on the instance and saving those changes to the DB.\n\nAlso, please document the parameters and what the values for target_power_state can be.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":878,"context_line":"        raise NotImplementedError()"},{"line_number":879,"context_line":""},{"line_number":880,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":881,"context_line":"        \"\"\"Update power state of the specified instance."},{"line_number":882,"context_line":""},{"line_number":883,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":884,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_f849d65f","line":881,"in_reply_to":"7faddb67_301a4c17","updated":"2019-07-25 15:19:21.000000000","message":"\u003e \n \u003e Also, please document the parameters and what the values for\n \u003e target_power_state can be.\n\ndone.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":878,"context_line":"        raise NotImplementedError()"},{"line_number":879,"context_line":""},{"line_number":880,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":881,"context_line":"        \"\"\"Update power state of the specified instance."},{"line_number":882,"context_line":""},{"line_number":883,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":884,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_2d2d15a8","line":881,"in_reply_to":"7faddb67_32cfc52a","updated":"2019-07-23 16:17:38.000000000","message":"Yeah...it seems kind of gross that the virt driver is expected to change the instance state and save the changes to the database - why doesn\u0027t the compute manager methods do that like in the stop_instance/start_instance methods for normal stop/start?","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":867,"context_line":""},{"line_number":868,"context_line":"    def power_update_event(self, instance, target_power_state):"},{"line_number":869,"context_line":"        \"\"\"Update power state of the specified instance."},{"line_number":870,"context_line":""},{"line_number":871,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":872,"context_line":"        :param target_power_state: The desired target power state for the"},{"line_number":873,"context_line":"                                   instance."}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_99968894","line":870,"updated":"2019-08-13 14:30:42.000000000","message":"Shouldn\u0027t this mention that the driver method is expected to set the instance task_state to None?","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":867,"context_line":""},{"line_number":868,"context_line":"    def power_update_event(self, instance, target_power_state):"},{"line_number":869,"context_line":"        \"\"\"Update power state of the specified instance."},{"line_number":870,"context_line":""},{"line_number":871,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":872,"context_line":"        :param target_power_state: The desired target power state for the"},{"line_number":873,"context_line":"                                   instance."}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_aab0b2de","line":870,"in_reply_to":"7faddb67_99968894","updated":"2019-08-14 12:54:15.000000000","message":"if you say so :D","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":867,"context_line":""},{"line_number":868,"context_line":"    def power_update_event(self, instance, target_power_state):"},{"line_number":869,"context_line":"        \"\"\"Update power state of the specified instance."},{"line_number":870,"context_line":""},{"line_number":871,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":872,"context_line":"        :param target_power_state: The desired target power state for the"},{"line_number":873,"context_line":"                                   instance."}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_d8d84f53","line":870,"in_reply_to":"7faddb67_aab0b2de","updated":"2019-08-15 15:18:06.000000000","message":"\u003e if you say so :D\n\nWell, it\u0027s a contract on the operation, right? The compute manager is setting the task_state so if a driver that implements this does not set the task_state back to None, the instance is going to be stuck with a task_state and the user can\u0027t do anything with it except delete the server unless the admin resets the state manually.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        instance back to None."},{"line_number":873,"context_line":""},{"line_number":874,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":875,"context_line":"        :param target_power_state: The desired target power state for the"},{"line_number":876,"context_line":"                                   instance."},{"line_number":877,"context_line":"        \"\"\""},{"line_number":878,"context_line":"        raise NotImplementedError()"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_98e65716","line":875,"updated":"2019-08-15 15:18:06.000000000","message":"nit: should probably mention the possible values (POWER_ON or POWER_OFF).","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        instance back to None."},{"line_number":873,"context_line":""},{"line_number":874,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":875,"context_line":"        :param target_power_state: The desired target power state for the"},{"line_number":876,"context_line":"                                   instance."},{"line_number":877,"context_line":"        \"\"\""},{"line_number":878,"context_line":"        raise NotImplementedError()"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_1384885d","line":875,"in_reply_to":"7faddb67_98e65716","updated":"2019-08-15 16:05:59.000000000","message":"Done","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"}],"nova/virt/fake.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":689,"context_line":""},{"line_number":690,"context_line":""},{"line_number":691,"context_line":"class PowerUpdateFakeDriver(SmallFakeDriver):"},{"line_number":692,"context_line":"    # A specific fake driver for our tests."},{"line_number":693,"context_line":"    def power_update_event(self, instance, target_power_state):"},{"line_number":694,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":695,"context_line":"        driver \u003d ironic.IronicDriver(virtapi\u003dNone)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_59e57037","line":692,"range":{"start_line":692,"start_character":4,"end_line":692,"end_character":43},"updated":"2019-08-13 14:30:42.000000000","message":"We could come up with a better description for this right? What is \"our tests\"? How about just saying this is a fake compute driver for power-update external event testing.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":689,"context_line":""},{"line_number":690,"context_line":""},{"line_number":691,"context_line":"class PowerUpdateFakeDriver(SmallFakeDriver):"},{"line_number":692,"context_line":"    # A specific fake driver for our tests."},{"line_number":693,"context_line":"    def power_update_event(self, instance, target_power_state):"},{"line_number":694,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":695,"context_line":"        driver \u003d ironic.IronicDriver(virtapi\u003dNone)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_2af2829b","line":692,"range":{"start_line":692,"start_character":4,"end_line":692,"end_character":43},"in_reply_to":"7faddb67_59e57037","updated":"2019-08-14 12:54:15.000000000","message":"mybad, this was initially inside the functional test module. Forgot to change the description when I moved it.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":692,"context_line":"    # A specific fake driver for our tests."},{"line_number":693,"context_line":"    def power_update_event(self, instance, target_power_state):"},{"line_number":694,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":695,"context_line":"        driver \u003d ironic.IronicDriver(virtapi\u003dNone)"},{"line_number":696,"context_line":"        driver.power_update_event(instance, target_power_state)"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_79b94c13","line":695,"updated":"2019-08-13 14:30:42.000000000","message":"A comment about why a fake driver here is using the Ironic driver would be nice. Also, couldn\u0027t set save this driver variable in __init__ of the fake driver so we don\u0027t have to initialize the ironic driver every time this method is called (the functional test will hit this twice). The IronicDriver.__init__ is not necessarily lightweight.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":692,"context_line":"    # A specific fake driver for our tests."},{"line_number":693,"context_line":"    def power_update_event(self, instance, target_power_state):"},{"line_number":694,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":695,"context_line":"        driver \u003d ironic.IronicDriver(virtapi\u003dNone)"},{"line_number":696,"context_line":"        driver.power_update_event(instance, target_power_state)"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_aa8192c5","line":695,"in_reply_to":"7faddb67_79b94c13","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"}],"nova/virt/ironic/driver.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e31317cfa045027dca817dc7274eab432457520d","unresolved":false,"context_lines":[{"line_number":1474,"context_line":"        LOG.info(\u0027Successfully powered on Ironic node %s\u0027,"},{"line_number":1475,"context_line":"                 node.uuid, instance\u003dinstance)"},{"line_number":1476,"context_line":""},{"line_number":1477,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":1478,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":1479,"context_line":"        LOG.debug(\u0027Power update called for instance\u0027, instance\u003dinstance)"},{"line_number":1480,"context_line":"        if target_power_state \u003d\u003d \"POWER_ON\":"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_f2860dbb","line":1477,"range":{"start_line":1477,"start_character":33,"end_line":1477,"end_character":40},"updated":"2019-07-22 18:21:38.000000000","message":"unused?","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":1474,"context_line":"        LOG.info(\u0027Successfully powered on Ironic node %s\u0027,"},{"line_number":1475,"context_line":"                 node.uuid, instance\u003dinstance)"},{"line_number":1476,"context_line":""},{"line_number":1477,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":1478,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":1479,"context_line":"        LOG.debug(\u0027Power update called for instance\u0027, instance\u003dinstance)"},{"line_number":1480,"context_line":"        if target_power_state \u003d\u003d \"POWER_ON\":"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_d89dfabb","line":1477,"range":{"start_line":1477,"start_character":33,"end_line":1477,"end_character":40},"in_reply_to":"7faddb67_f2860dbb","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"02e0b7e64466db567c90b3776d225b9506cd4a58","unresolved":false,"context_lines":[{"line_number":1475,"context_line":"                 node.uuid, instance\u003dinstance)"},{"line_number":1476,"context_line":""},{"line_number":1477,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":1478,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":1479,"context_line":"        LOG.debug(\u0027Power update called for instance\u0027, instance\u003dinstance)"},{"line_number":1480,"context_line":"        if target_power_state \u003d\u003d \"POWER_ON\":"},{"line_number":1481,"context_line":"            instance.power_state \u003d power_state.RUNNING"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_7011a453","line":1478,"updated":"2019-07-23 16:17:38.000000000","message":"This is so basic, why does it even need to be implemented by the driver? The compute manager code could handle it generically. If we don\u0027t want other virt drivers to handle the event, we could expose a capability on the drivers that support the power-update event and just check that from the compute manager code (the driver.capabilities dict).","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"956ea230247671030252c1589adcdeda2334668f","unresolved":false,"context_lines":[{"line_number":1475,"context_line":"                 node.uuid, instance\u003dinstance)"},{"line_number":1476,"context_line":""},{"line_number":1477,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":1478,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":1479,"context_line":"        LOG.debug(\u0027Power update called for instance\u0027, instance\u003dinstance)"},{"line_number":1480,"context_line":"        if target_power_state \u003d\u003d \"POWER_ON\":"},{"line_number":1481,"context_line":"            instance.power_state \u003d power_state.RUNNING"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_70f764d6","line":1478,"in_reply_to":"7faddb67_7011a453","updated":"2019-07-23 16:33:29.000000000","message":"I spoke with Dan about it and the answer is this is an abstraction for the driver regardless of how simple it is:\n\nhttp://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2019-07-23.log.html#t2019-07-23T16:18:09","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":1475,"context_line":"                 node.uuid, instance\u003dinstance)"},{"line_number":1476,"context_line":""},{"line_number":1477,"context_line":"    def power_update_event(self, context, instance, target_power_state):"},{"line_number":1478,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":1479,"context_line":"        LOG.debug(\u0027Power update called for instance\u0027, instance\u003dinstance)"},{"line_number":1480,"context_line":"        if target_power_state \u003d\u003d \"POWER_ON\":"},{"line_number":1481,"context_line":"            instance.power_state \u003d power_state.RUNNING"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_78a40609","line":1478,"in_reply_to":"7faddb67_70f764d6","updated":"2019-07-25 15:19:21.000000000","message":"thanks for the efforts/time/discussion.","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":1477,"context_line":""},{"line_number":1478,"context_line":"    def power_update_event(self, instance, target_power_state):"},{"line_number":1479,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":1480,"context_line":"        LOG.info(\u0027Power update called for instance %s with \u0027"},{"line_number":1481,"context_line":"                 \u0027target powr state %s.\u0027, instance.uuid, target_power_state)"},{"line_number":1482,"context_line":"        if target_power_state \u003d\u003d common.POWER_ON:"},{"line_number":1483,"context_line":"            instance.power_state \u003d power_state.RUNNING"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_79fcecb4","line":1480,"range":{"start_line":1480,"start_character":51,"end_line":1480,"end_character":53},"updated":"2019-08-13 14:30:42.000000000","message":"nit: You can ditch this and just use a kwarg for logging the instance:\n\nLOG.info(\u0027Power update called for instance with \u0027\n         \u0027target power state %s.\u0027, target_power_state,\n         instance\u003dinstance)","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":1477,"context_line":""},{"line_number":1478,"context_line":"    def power_update_event(self, instance, target_power_state):"},{"line_number":1479,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":1480,"context_line":"        LOG.info(\u0027Power update called for instance %s with \u0027"},{"line_number":1481,"context_line":"                 \u0027target powr state %s.\u0027, instance.uuid, target_power_state)"},{"line_number":1482,"context_line":"        if target_power_state \u003d\u003d common.POWER_ON:"},{"line_number":1483,"context_line":"            instance.power_state \u003d power_state.RUNNING"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_aa6bd2ee","line":1480,"range":{"start_line":1480,"start_character":51,"end_line":1480,"end_character":53},"in_reply_to":"7faddb67_79fcecb4","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[{"line_number":1478,"context_line":"    def power_update_event(self, instance, target_power_state):"},{"line_number":1479,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":1480,"context_line":"        LOG.info(\u0027Power update called for instance %s with \u0027"},{"line_number":1481,"context_line":"                 \u0027target powr state %s.\u0027, instance.uuid, target_power_state)"},{"line_number":1482,"context_line":"        if target_power_state \u003d\u003d common.POWER_ON:"},{"line_number":1483,"context_line":"            instance.power_state \u003d power_state.RUNNING"},{"line_number":1484,"context_line":"            instance.vm_state \u003d vm_states.ACTIVE"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_d90de0e8","line":1481,"range":{"start_line":1481,"start_character":25,"end_line":1481,"end_character":29},"updated":"2019-08-13 14:30:42.000000000","message":"power","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"fa54fec266c4c63473368e8614524c18a4193cc1","unresolved":false,"context_lines":[{"line_number":1478,"context_line":"    def power_update_event(self, instance, target_power_state):"},{"line_number":1479,"context_line":"        \"\"\"Update power state of the specified instance in the nova DB.\"\"\""},{"line_number":1480,"context_line":"        LOG.info(\u0027Power update called for instance %s with \u0027"},{"line_number":1481,"context_line":"                 \u0027target powr state %s.\u0027, instance.uuid, target_power_state)"},{"line_number":1482,"context_line":"        if target_power_state \u003d\u003d common.POWER_ON:"},{"line_number":1483,"context_line":"            instance.power_state \u003d power_state.RUNNING"},{"line_number":1484,"context_line":"            instance.vm_state \u003d vm_states.ACTIVE"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_0a65461d","line":1481,"range":{"start_line":1481,"start_character":25,"end_line":1481,"end_character":29},"in_reply_to":"7faddb67_d90de0e8","updated":"2019-08-14 12:54:15.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7011c8d687547c0e5b095bb80fcfc56f5c6749e6","unresolved":false,"context_lines":[{"line_number":1486,"context_line":"            instance.power_state \u003d power_state.RUNNING"},{"line_number":1487,"context_line":"            instance.vm_state \u003d vm_states.ACTIVE"},{"line_number":1488,"context_line":"            instance.task_state \u003d None"},{"line_number":1489,"context_line":"            instance.save(expected_task_state\u003dtask_states.POWERING_ON)"},{"line_number":1490,"context_line":"        else:"},{"line_number":1491,"context_line":"            instance.power_state \u003d power_state.SHUTDOWN"},{"line_number":1492,"context_line":"            instance.vm_state \u003d vm_states.STOPPED"}],"source_content_type":"text/x-python","patch_set":12,"id":"7faddb67_b9d1ebce","line":1489,"updated":"2019-08-14 16:10:45.000000000","message":"This and below needs to handle UnexpectedTaskStateError, log something and return. You essentially lost a race.","commit_id":"f7677c0bec4d3f350e07e04fb5518c622e641c4b"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"db3963539a127644e36d078304338c3bbae50cbd","unresolved":false,"context_lines":[{"line_number":1495,"context_line":"            expected_task_state \u003d task_states.POWERING_OFF"},{"line_number":1496,"context_line":"        try:"},{"line_number":1497,"context_line":"            instance.save(expected_task_state\u003dexpected_task_state)"},{"line_number":1498,"context_line":"        except exception.UnexpectedTaskStateError as e:"},{"line_number":1499,"context_line":"            LOG.info(\"The power-update event was possibly preempted: %s \""},{"line_number":1500,"context_line":"                     \"for instance\", e.format_message(), instance\u003dinstance)"},{"line_number":1501,"context_line":"            return"},{"line_number":1502,"context_line":""},{"line_number":1503,"context_line":"    def trigger_crash_dump(self, instance):"},{"line_number":1504,"context_line":"        \"\"\"Trigger crash dump mechanism on the given instance."}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_6a44e1b8","line":1501,"range":{"start_line":1498,"start_character":8,"end_line":1501,"end_character":18},"updated":"2019-08-15 13:39:09.000000000","message":"no need to handle this separately, just put the self.driver call in the manager also inside the try block.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":1495,"context_line":"            expected_task_state \u003d task_states.POWERING_OFF"},{"line_number":1496,"context_line":"        try:"},{"line_number":1497,"context_line":"            instance.save(expected_task_state\u003dexpected_task_state)"},{"line_number":1498,"context_line":"        except exception.UnexpectedTaskStateError as e:"},{"line_number":1499,"context_line":"            LOG.info(\"The power-update event was possibly preempted: %s \""},{"line_number":1500,"context_line":"                     \"for instance\", e.format_message(), instance\u003dinstance)"},{"line_number":1501,"context_line":"            return"},{"line_number":1502,"context_line":""},{"line_number":1503,"context_line":"    def trigger_crash_dump(self, instance):"},{"line_number":1504,"context_line":"        \"\"\"Trigger crash dump mechanism on the given instance."}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_b347b41d","line":1501,"range":{"start_line":1498,"start_character":8,"end_line":1501,"end_character":18},"in_reply_to":"7faddb67_38c16355","updated":"2019-08-15 16:05:59.000000000","message":"Done","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":1495,"context_line":"            expected_task_state \u003d task_states.POWERING_OFF"},{"line_number":1496,"context_line":"        try:"},{"line_number":1497,"context_line":"            instance.save(expected_task_state\u003dexpected_task_state)"},{"line_number":1498,"context_line":"        except exception.UnexpectedTaskStateError as e:"},{"line_number":1499,"context_line":"            LOG.info(\"The power-update event was possibly preempted: %s \""},{"line_number":1500,"context_line":"                     \"for instance\", e.format_message(), instance\u003dinstance)"},{"line_number":1501,"context_line":"            return"},{"line_number":1502,"context_line":""},{"line_number":1503,"context_line":"    def trigger_crash_dump(self, instance):"},{"line_number":1504,"context_line":"        \"\"\"Trigger crash dump mechanism on the given instance."}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_38c16355","line":1501,"range":{"start_line":1498,"start_character":8,"end_line":1501,"end_character":18},"in_reply_to":"7faddb67_6a44e1b8","updated":"2019-08-15 15:18:06.000000000","message":"Agree.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"}],"releasenotes/notes/bp-nova-support-instance-power-update-8328355a0f3fb508.yaml":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e31317cfa045027dca817dc7274eab432457520d","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    event. Currently it is only supported in the ironic driver and through"},{"line_number":7,"context_line":"    this event Ironic will send all \"power-on to power-off\" and"},{"line_number":8,"context_line":"    \"power-off to power-on\" type power state changes on a physical instance"},{"line_number":9,"context_line":"    to nova which will update it\u0027s database accordingly. This way nova will"},{"line_number":10,"context_line":"    not be able to enforce an incorrect power state on the physical instance"},{"line_number":11,"context_line":"    during the periodic ``_sync_power_states`` task. The changes to the power"},{"line_number":12,"context_line":"    state of an instance caused by this event can be viewed through"}],"source_content_type":"text/x-yaml","patch_set":7,"id":"7faddb67_d28d11d4","line":9,"range":{"start_line":9,"start_character":30,"end_line":9,"end_character":34},"updated":"2019-07-22 18:21:38.000000000","message":"its","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"4ac2886b977323d4f34a1f73f1acc808594899a8","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    event. Currently it is only supported in the ironic driver and through"},{"line_number":7,"context_line":"    this event Ironic will send all \"power-on to power-off\" and"},{"line_number":8,"context_line":"    \"power-off to power-on\" type power state changes on a physical instance"},{"line_number":9,"context_line":"    to nova which will update it\u0027s database accordingly. This way nova will"},{"line_number":10,"context_line":"    not be able to enforce an incorrect power state on the physical instance"},{"line_number":11,"context_line":"    during the periodic ``_sync_power_states`` task. The changes to the power"},{"line_number":12,"context_line":"    state of an instance caused by this event can be viewed through"}],"source_content_type":"text/x-yaml","patch_set":7,"id":"7faddb67_b8d11e5a","line":9,"range":{"start_line":9,"start_character":30,"end_line":9,"end_character":34},"in_reply_to":"7faddb67_d28d11d4","updated":"2019-07-25 15:19:21.000000000","message":"Done","commit_id":"05e026d4c8b603616e641aa196da369af074e05a"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"0d7fdd81ac739d30e5c263a3e7bcab0e7c3eae3e","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    It is now possible to signal and perform an update of an instance\u0027s power"},{"line_number":5,"context_line":"    state as of the 2.75 microversion using the ``power-update`` external"},{"line_number":6,"context_line":"    event. Currently it is only supported in the ironic driver and through"},{"line_number":7,"context_line":"    this event Ironic will send all \"power-on to power-off\" and"},{"line_number":8,"context_line":"    \"power-off to power-on\" type power state changes on a physical instance"},{"line_number":9,"context_line":"    to nova which will update its database accordingly. This way nova will"},{"line_number":10,"context_line":"    not be able to enforce an incorrect power state on the physical instance"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"7faddb67_1b9cd35b","line":7,"range":{"start_line":7,"start_character":60,"end_line":7,"end_character":63},"updated":"2019-07-27 05:39:53.000000000","message":"s/and/or\n\nChanges to the physical instance are unidirectional.","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"785017ff6e79a78c3e76f329a7971a4800c9a241","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    It is now possible to signal and perform an update of an instance\u0027s power"},{"line_number":5,"context_line":"    state as of the 2.75 microversion using the ``power-update`` external"},{"line_number":6,"context_line":"    event. Currently it is only supported in the ironic driver and through"},{"line_number":7,"context_line":"    this event Ironic will send all \"power-on to power-off\" and"},{"line_number":8,"context_line":"    \"power-off to power-on\" type power state changes on a physical instance"},{"line_number":9,"context_line":"    to nova which will update its database accordingly. This way nova will"},{"line_number":10,"context_line":"    not be able to enforce an incorrect power state on the physical instance"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"7faddb67_4d50460b","line":7,"range":{"start_line":7,"start_character":60,"end_line":7,"end_character":63},"in_reply_to":"7faddb67_1b9cd35b","updated":"2019-07-29 07:14:03.000000000","message":"\u003e s/and/or\n \u003e \n \u003e Changes to the physical instance are unidirectional.\n\nits actually changed from the physical instance. Also I am not sure I actually get the point here.","commit_id":"b311c07846ed3f381a6d1507d29006175d852fec"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9096350aabf6a876d9229a152214f435904d5906","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"7faddb67_59efb0e8","line":15,"updated":"2019-08-13 14:30:42.000000000","message":"As mentioned before, since the API isn\u0027t checking the compute service version before casting off, if we are doing a rolling upgrade and get this even for instances on a Stein compute we\u0027ll have those instances stuck with a task_state that will need to be manually reset. Therefore we should probably mention something about rolling upgrades in here, but I\u0027m not sure what the operator would do in this case because they first upgrade ironic, then the nova control plane, and now they can be getting the power-update event while all of their compute services are running Stein code...which would be bad. Is there a way to disable this functionality from the ironic side? If so, we should mention that you should do that until all of your nova-compute services are upgraded to Train.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a33586a463f04916ba3d769306d4a55aa8498846","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"7faddb67_d9e5e0dd","line":15,"in_reply_to":"7faddb67_59efb0e8","updated":"2019-08-13 14:36:21.000000000","message":"OK it looks like there is a configuration on the ironic side:\n\nhttps://review.opendev.org/#/c/664842/19/ironic/conf/nova.py\n\nWe should mention here with a \".. note::\" or add a separate upgrade reno saying that until your ironic compute services are all upgraded, you should disable ``[nova]/send_power_notifications`` in ironic.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6fc8d6271a0272a13c0e63fc4e3b82e7769c7831","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"7faddb67_bc1ed271","line":15,"in_reply_to":"7faddb67_79a5cc46","updated":"2019-08-13 15:24:37.000000000","message":"\u003e Should that caveat also be in the doc for the conf opt on the\n \u003e ironic side?\n\nDepends on if the compute API code changes, but I just left a comment in the ironic reno as well.","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"a8bf0cd32208a71f44d61593ed7cef221c804a90","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"7faddb67_517531cb","line":15,"in_reply_to":"7faddb67_d9e5e0dd","updated":"2019-08-14 14:28:54.000000000","message":"Done","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"22275973da5b68cbf5eb9d89e4db644d5ffab943","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"7faddb67_79a5cc46","line":15,"in_reply_to":"7faddb67_d9e5e0dd","updated":"2019-08-13 14:43:28.000000000","message":"Should that caveat also be in the doc for the conf opt on the ironic side?","commit_id":"12bf41499b552bb0205ee414cf2ff11ec0ede98d"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"77877dc4db005f6bf493ab325ceaa4cf499d01ed","unresolved":false,"context_lines":[{"line_number":15,"context_line":"upgrade:"},{"line_number":16,"context_line":"  - |"},{"line_number":17,"context_line":"    Until all the ``nova-compute`` services that run the ironic driver are"},{"line_number":18,"context_line":"    upgraded to the Stein code that handles the ``power-update`` callbacks from"},{"line_number":19,"context_line":"    ironic, the ``[nova]/send_power_notifications`` config option should not be"},{"line_number":20,"context_line":"    enabled in ironic."}],"source_content_type":"text/x-yaml","patch_set":12,"id":"7faddb67_ccd0a656","line":18,"range":{"start_line":18,"start_character":20,"end_line":18,"end_character":30},"updated":"2019-08-14 14:38:38.000000000","message":"dammit, its Train.","commit_id":"f7677c0bec4d3f350e07e04fb5518c622e641c4b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc3bd2259000b74559b289b4d208163571b1112f","unresolved":false,"context_lines":[{"line_number":12,"context_line":"    state of an instance caused by this event can be viewed through"},{"line_number":13,"context_line":"    ``GET /servers/{server_id}/os-instance-actions`` and"},{"line_number":14,"context_line":"    ``GET /servers/{server_id}/os-instance-actions/{request_id}``."},{"line_number":15,"context_line":"upgrade:"},{"line_number":16,"context_line":"  - |"},{"line_number":17,"context_line":"    Until all the ``nova-compute`` services that run the ironic driver are"},{"line_number":18,"context_line":"    upgraded to the Train code that handles the ``power-update`` callbacks from"}],"source_content_type":"text/x-yaml","patch_set":13,"id":"7faddb67_18a107aa","line":15,"updated":"2019-08-15 15:18:06.000000000","message":"Now that the API is no longer setting the task_state I think this is less of a concern. The only \"bad\" thing that could happen now is if ironic sends the event for an instance on an old compute, the API creates an action record, but casts to a Stein compute that doesn\u0027t \"complete\" the action, meaning doesn\u0027t hit anything with a @wrap_instance_event decorator to record a start/finish event on the action, but the worst that happens with that is you\u0027ve got a stop/start action in the API with no events under it. So you can leave this if you want, but it\u0027s less of a concern than leaving an instance stuck with a task_state that the admin has to reset.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"3dc51e845985a05ed077fdb4fa99dd331525d16e","unresolved":false,"context_lines":[{"line_number":12,"context_line":"    state of an instance caused by this event can be viewed through"},{"line_number":13,"context_line":"    ``GET /servers/{server_id}/os-instance-actions`` and"},{"line_number":14,"context_line":"    ``GET /servers/{server_id}/os-instance-actions/{request_id}``."},{"line_number":15,"context_line":"upgrade:"},{"line_number":16,"context_line":"  - |"},{"line_number":17,"context_line":"    Until all the ``nova-compute`` services that run the ironic driver are"},{"line_number":18,"context_line":"    upgraded to the Train code that handles the ``power-update`` callbacks from"}],"source_content_type":"text/x-yaml","patch_set":13,"id":"7faddb67_f3f3ec07","line":15,"in_reply_to":"7faddb67_18a107aa","updated":"2019-08-15 16:05:59.000000000","message":"\u003e Now that the API is no longer setting the task_state I think this\n \u003e is less of a concern. The only \"bad\" thing that could happen now is\n \u003e if ironic sends the event for an instance on an old compute, the\n \u003e API creates an action record, but casts to a Stein compute that\n \u003e doesn\u0027t \"complete\" the action, meaning doesn\u0027t hit anything with a\n \u003e @wrap_instance_event decorator to record a start/finish event on\n \u003e the action, but the worst that happens with that is you\u0027ve got a\n \u003e stop/start action in the API with no events under it. So you can\n \u003e leave this if you want, but it\u0027s less of a concern than leaving an\n \u003e instance stuck with a task_state that the admin has to reset.\n\nagreed, yea. I\u0027ll keep this here so that the ops can at least choose to set that option to false.","commit_id":"90a8bcbe38fca6524b93b7aa076a88c6bc1f4fdb"}]}
