)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8ea942e38374b4f2f142b84454718d9ba23307c1","unresolved":false,"context_lines":[{"line_number":39,"context_line":"a clean shutdown to compute.manager.stop()."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"Subsequent patches will:"},{"line_number":42,"context_line":"-\tAdd clean shutdown to Shelve"},{"line_number":43,"context_line":"-\tAdd clean shutdown to Rescue"},{"line_number":44,"context_line":"-\tAdd clean shutdown to Terminate"},{"line_number":45,"context_line":"-\tConvert soft_reboot to use the same approach"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"AAAAUH%2F%2BXyo%3D","line":42,"updated":"2014-01-27 16:21:45.000000000","message":"whitespace","commit_id":"10f50dc467fbf99f345fafe36309a41c9adaf018"}],"nova/compute/manager.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"cc3d93f5fa40b478178d7b65dd06b9f04ad90f60","unresolved":false,"context_lines":[{"line_number":2195,"context_line":"        \"\"\"Get the timing configuration for powering down this instance.\"\"\""},{"line_number":2196,"context_line":"        if clean_shutdown:"},{"line_number":2197,"context_line":"            timeout \u003d compute_utils.get_value_from_system_metadata(instance,"},{"line_number":2198,"context_line":"                          \u0027image_shutdown_timeout\u0027, int, CONF.shutdown_timeout)"},{"line_number":2199,"context_line":"            retry_interval \u003d SHUTDOWN_RETRY_INTERVAL"},{"line_number":2200,"context_line":"        else:"},{"line_number":2201,"context_line":"            timeout \u003d 0"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_e9dfda36","line":2198,"updated":"2014-07-29 10:44:32.000000000","message":"IIUC, this is looking up \u0027image_shutdown_timeout\u0027 against the image metadata properties ?  If so, we have a general convention of using either an \u0027os_\u0027 or \u0027hw_\u0027 prefix on property names depending on whether they affect the guest operating system operation, or virtual hardware configuration respectively. Adding \u0027image_\u0027 as a prefix is somewhat redundant too, so I think this would fit with a name of \u0027os_shutdown_timeout\u0027 pretty well.","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"48c422fffa93e49dd39cd4b9d521aa54f9eeb1ab","unresolved":false,"context_lines":[{"line_number":2195,"context_line":"        \"\"\"Get the timing configuration for powering down this instance.\"\"\""},{"line_number":2196,"context_line":"        if clean_shutdown:"},{"line_number":2197,"context_line":"            timeout \u003d compute_utils.get_value_from_system_metadata(instance,"},{"line_number":2198,"context_line":"                          \u0027image_shutdown_timeout\u0027, int, CONF.shutdown_timeout)"},{"line_number":2199,"context_line":"            retry_interval \u003d SHUTDOWN_RETRY_INTERVAL"},{"line_number":2200,"context_line":"        else:"},{"line_number":2201,"context_line":"            timeout \u003d 0"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_51a50446","line":2198,"in_reply_to":"baada198_43007766","updated":"2014-08-04 10:36:25.000000000","message":"Done","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"b3df80b1384dbf3ddd07b43a477e345fccd67b70","unresolved":false,"context_lines":[{"line_number":2195,"context_line":"        \"\"\"Get the timing configuration for powering down this instance.\"\"\""},{"line_number":2196,"context_line":"        if clean_shutdown:"},{"line_number":2197,"context_line":"            timeout \u003d compute_utils.get_value_from_system_metadata(instance,"},{"line_number":2198,"context_line":"                          \u0027image_shutdown_timeout\u0027, int, CONF.shutdown_timeout)"},{"line_number":2199,"context_line":"            retry_interval \u003d SHUTDOWN_RETRY_INTERVAL"},{"line_number":2200,"context_line":"        else:"},{"line_number":2201,"context_line":"            timeout \u003d 0"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_43007766","line":2198,"in_reply_to":"baada198_76eab378","updated":"2014-07-30 09:00:22.000000000","message":"Ok, this makes more sense now, so yes we should go for \u0027image_os_shutdown_timeout\u0027 I reckon.","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"ff32c075075971591bd050a075809f8958f9fcfe","unresolved":false,"context_lines":[{"line_number":2195,"context_line":"        \"\"\"Get the timing configuration for powering down this instance.\"\"\""},{"line_number":2196,"context_line":"        if clean_shutdown:"},{"line_number":2197,"context_line":"            timeout \u003d compute_utils.get_value_from_system_metadata(instance,"},{"line_number":2198,"context_line":"                          \u0027image_shutdown_timeout\u0027, int, CONF.shutdown_timeout)"},{"line_number":2199,"context_line":"            retry_interval \u003d SHUTDOWN_RETRY_INTERVAL"},{"line_number":2200,"context_line":"        else:"},{"line_number":2201,"context_line":"            timeout \u003d 0"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_76eab378","line":2198,"in_reply_to":"baada198_e9dfda36","updated":"2014-07-29 18:00:32.000000000","message":"The \"image_\" prefix is added by Nova for all metadata values that come from the image:\nhttps://github.com/openstack/nova/blob/master/nova/utils.py#L100\nhttps://github.com/openstack/nova/blob/master/nova/utils.py#L1087-L1109\n\nSo should the value in Glance be \"os_shutdown_timeout\" which would map into Nova as \"image_os_shutdown_timeout\" ?","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"5c60cb9632c914f94ce3d339a354981910646e5a","unresolved":false,"context_lines":[{"line_number":193,"context_line":"               default\u003d0,"},{"line_number":194,"context_line":"               help\u003d\"Automatically confirm resizes after N seconds. \""},{"line_number":195,"context_line":"                    \"Set to 0 to disable.\"),"},{"line_number":196,"context_line":"    cfg.IntOpt(\"shutdown_timeout\","},{"line_number":197,"context_line":"               default\u003d60,"},{"line_number":198,"context_line":"               help\u003d\"Total amount of time to wait in seconds for an instance \""},{"line_number":199,"context_line":"                    \"to perform a clean shutdown.\"),"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_611ee55f","line":196,"updated":"2014-08-10 05:45:38.000000000","message":"i have a problem with this global variable. why do we not have this as part of an image property? that would be the most robust solution - that is, an admin will know what the libvirt behavior is per guest os and configure accord;y.","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"e5d31728b2ae729e84131fe2c9a593f27be5dcc6","unresolved":false,"context_lines":[{"line_number":193,"context_line":"               default\u003d0,"},{"line_number":194,"context_line":"               help\u003d\"Automatically confirm resizes after N seconds. \""},{"line_number":195,"context_line":"                    \"Set to 0 to disable.\"),"},{"line_number":196,"context_line":"    cfg.IntOpt(\"shutdown_timeout\","},{"line_number":197,"context_line":"               default\u003d60,"},{"line_number":198,"context_line":"               help\u003d\"Total amount of time to wait in seconds for an instance \""},{"line_number":199,"context_line":"                    \"to perform a clean shutdown.\"),"}],"source_content_type":"text/x-python","patch_set":29,"id":"1abeadc6_3355a9c6","line":196,"in_reply_to":"baada198_25194ed2","updated":"2014-08-18 14:33:51.000000000","message":"Correct - as per the approved spec the value can be set per image, and there is a global default.","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"693aaf55c96b5d3652a2a56123d398d18fb8e6fd","unresolved":false,"context_lines":[{"line_number":193,"context_line":"               default\u003d0,"},{"line_number":194,"context_line":"               help\u003d\"Automatically confirm resizes after N seconds. \""},{"line_number":195,"context_line":"                    \"Set to 0 to disable.\"),"},{"line_number":196,"context_line":"    cfg.IntOpt(\"shutdown_timeout\","},{"line_number":197,"context_line":"               default\u003d60,"},{"line_number":198,"context_line":"               help\u003d\"Total amount of time to wait in seconds for an instance \""},{"line_number":199,"context_line":"                    \"to perform a clean shutdown.\"),"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_25194ed2","line":196,"in_reply_to":"baada198_611ee55f","updated":"2014-08-11 05:30:18.000000000","message":"guess 2201--2203 already cover the case, the global value is only used for the image specific value not set...","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"}],"nova/compute/utils.py":[{"author":{"_account_id":8412,"name":"Mike Durnosvistov","email":"glacierr.dev@gmail.com","username":"mdurnosvistov"},"change_message_id":"21cab2e76f84394cf81d35ae75881f73a8de2954","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    try:"},{"line_number":232,"context_line":"        return type(value)"},{"line_number":233,"context_line":"    except ValueError:"},{"line_number":234,"context_line":"        LOG.warning(_LW(\"Metadata value %(value)s for %(key)s is not of \""},{"line_number":235,"context_line":"                        \"type %(type)s. Using default value %(default)s.\"),"},{"line_number":236,"context_line":"                    {\u0027value\u0027: value, \u0027key\u0027: key, \u0027type\u0027: type,"},{"line_number":237,"context_line":"                     \u0027default\u0027: default}, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_5709df29","line":234,"range":{"start_line":234,"start_character":8,"end_line":234,"end_character":19},"updated":"2014-08-07 19:42:00.000000000","message":"This should be LOG.warn(_LW(...","commit_id":"8e3ff3be2ea488e8c71361ea649cbbf7a407fc5a"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"c33c1b19c10d8785a7e313413272ed42f4d1ef02","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    try:"},{"line_number":232,"context_line":"        return type(value)"},{"line_number":233,"context_line":"    except ValueError:"},{"line_number":234,"context_line":"        LOG.warning(_LW(\"Metadata value %(value)s for %(key)s is not of \""},{"line_number":235,"context_line":"                        \"type %(type)s. Using default value %(default)s.\"),"},{"line_number":236,"context_line":"                    {\u0027value\u0027: value, \u0027key\u0027: key, \u0027type\u0027: type,"},{"line_number":237,"context_line":"                     \u0027default\u0027: default}, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_4e513730","line":234,"in_reply_to":"baada198_5709df29","updated":"2014-08-08 10:44:38.000000000","message":"I think its \"LOG.warn\" that\u0027s been depicated in favor of LOG.warning:\n\nwarn() maps to warning():  https://github.com/openstack/nova/blob/master/nova/openstack/common/log.py#L251\n\nSee also: http://bugs.python.org/issue13235","commit_id":"8e3ff3be2ea488e8c71361ea649cbbf7a407fc5a"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"693aaf55c96b5d3652a2a56123d398d18fb8e6fd","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    \"\"\"Get a value of a specified type from image metadata."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    @param instance: The instance object"},{"line_number":226,"context_line":"    @param key: The name of the property to get"},{"line_number":227,"context_line":"    @param default:  The value to return if the property is not set"},{"line_number":228,"context_line":"                     or is not an integet"},{"line_number":229,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_a592be47","line":226,"updated":"2014-08-11 05:30:18.000000000","message":"considering we have comments for all other 3, add type here might be better","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"e5d31728b2ae729e84131fe2c9a593f27be5dcc6","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    \"\"\"Get a value of a specified type from image metadata."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    @param instance: The instance object"},{"line_number":226,"context_line":"    @param key: The name of the property to get"},{"line_number":227,"context_line":"    @param default:  The value to return if the property is not set"},{"line_number":228,"context_line":"                     or is not an integet"},{"line_number":229,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":29,"id":"1abeadc6_b38299fe","line":226,"in_reply_to":"baada198_a592be47","updated":"2014-08-18 14:33:51.000000000","message":"Done","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"693aaf55c96b5d3652a2a56123d398d18fb8e6fd","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    try:"},{"line_number":232,"context_line":"        return type(value)"},{"line_number":233,"context_line":"    except ValueError:"},{"line_number":234,"context_line":"        LOG.warning(_LW(\"Metadata value %(value)s for %(key)s is not of \""},{"line_number":235,"context_line":"                        \"type %(type)s. Using default value %(default)s.\"),"},{"line_number":236,"context_line":"                    {\u0027value\u0027: value, \u0027key\u0027: key, \u0027type\u0027: type,"},{"line_number":237,"context_line":"                     \u0027default\u0027: default}, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_25422eac","line":234,"updated":"2014-08-11 05:30:18.000000000","message":"A INFO might be better ? IMHO ...","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"}],"nova/tests/compute/test_compute_utils.py":[{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"d4f25440ea10a38c52db615d485209a69088667e","unresolved":false,"context_lines":[{"line_number":743,"context_line":""},{"line_number":744,"context_line":"        result \u003d compute_utils.get_value_from_system_metadata("},{"line_number":745,"context_line":"                   instance, \u0027not_int\u0027, int, 0)"},{"line_number":746,"context_line":"        self.assertEqual(0, result)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":""},{"line_number":749,"context_line":"class ComputeUtilsGetNWInfo(test.TestCase):"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_fc373aad","line":746,"updated":"2014-07-31 11:04:54.000000000","message":"Just a little suggestion, i think it would be a little bit neater if you had something like this:\nkey_vals \u003d zip(system_meta.keys(), [1, 2, 0])\nfor key, val in key_vals:\n    result \u003d compute_utils.get_value_from_system_metadata(\t736\n\t\t\tinstance, key, int, 0)\n    self.assertEqual(val, result)\n\nI think it is a more pythonesque way to do it.","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"48c422fffa93e49dd39cd4b9d521aa54f9eeb1ab","unresolved":false,"context_lines":[{"line_number":743,"context_line":""},{"line_number":744,"context_line":"        result \u003d compute_utils.get_value_from_system_metadata("},{"line_number":745,"context_line":"                   instance, \u0027not_int\u0027, int, 0)"},{"line_number":746,"context_line":"        self.assertEqual(0, result)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":""},{"line_number":749,"context_line":"class ComputeUtilsGetNWInfo(test.TestCase):"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_f1b45882","line":746,"in_reply_to":"baada198_fc373aad","updated":"2014-08-04 10:36:25.000000000","message":"Thanks for the suggestion, but you can\u0027t zip a dict and a list like this because the order of dick.keys() isn\u0027t defined.   \n\nI could build a list of expected results by hand, but I\u0027m not convinced it would make the test any easier to follow, and tests to me have a (small) role in showing how code is expected to be used.   So unless anyone else comments on this I\u0027m going to leave it as it is.","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"}],"nova/tests/virt/libvirt/test_driver.py":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"693aaf55c96b5d3652a2a56123d398d18fb8e6fd","unresolved":false,"context_lines":[{"line_number":6223,"context_line":"            mock_domain.info().AndReturn("},{"line_number":6224,"context_line":"                (libvirt_driver.VIR_DOMAIN_SHUTDOWN,) + info_tuple)"},{"line_number":6225,"context_line":""},{"line_number":6226,"context_line":"        self.mox.ReplayAll()"},{"line_number":6227,"context_line":""},{"line_number":6228,"context_line":"        def fake_lookup_by_name(instance_name):"},{"line_number":6229,"context_line":"            return mock_domain"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_6576e60d","line":6226,"updated":"2014-08-11 05:30:18.000000000","message":"new cases with mock is preferable","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"}],"nova/virt/driver.py":[{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"d4f25440ea10a38c52db615d485209a69088667e","unresolved":false,"context_lines":[{"line_number":595,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":596,"context_line":"        :param timeout: time to wait for GuestOS to shutdown"},{"line_number":597,"context_line":"        :param retry_interval: How often to signal guest while"},{"line_number":598,"context_line":"                               waitign for it to shutdown"},{"line_number":599,"context_line":"        \"\"\""},{"line_number":600,"context_line":"        raise NotImplementedError()"},{"line_number":601,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_79f09c92","line":598,"updated":"2014-07-31 11:04:54.000000000","message":"just a small typo - waiting instead of waitign","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"48c422fffa93e49dd39cd4b9d521aa54f9eeb1ab","unresolved":false,"context_lines":[{"line_number":595,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":596,"context_line":"        :param timeout: time to wait for GuestOS to shutdown"},{"line_number":597,"context_line":"        :param retry_interval: How often to signal guest while"},{"line_number":598,"context_line":"                               waitign for it to shutdown"},{"line_number":599,"context_line":"        \"\"\""},{"line_number":600,"context_line":"        raise NotImplementedError()"},{"line_number":601,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_517c24b6","line":598,"in_reply_to":"baada198_79f09c92","updated":"2014-08-04 10:36:25.000000000","message":"Done","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8ea942e38374b4f2f142b84454718d9ba23307c1","unresolved":false,"context_lines":[{"line_number":2109,"context_line":"                    return True"},{"line_number":2110,"context_line":""},{"line_number":2111,"context_line":"            if timeutils.is_older_than(attempt_start, retry_interval):"},{"line_number":2112,"context_line":"                LOG.debug(\"### Retry Shutdown\", instance\u003dinstance)"},{"line_number":2113,"context_line":"                attempt_start \u003d timeutils.utcnow()"},{"line_number":2114,"context_line":"                # Instance could shutdown at any time, in which case we"},{"line_number":2115,"context_line":"                # will get an exception when we call shutdown"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2BXzI%3D","line":2112,"updated":"2014-01-27 16:21:45.000000000","message":"please use the i18n support","commit_id":"10f50dc467fbf99f345fafe36309a41c9adaf018"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"f384182389ceb6464974cc94d1434b895d86b6ab","unresolved":false,"context_lines":[{"line_number":2059,"context_line":"        dom.resume()"},{"line_number":2060,"context_line":""},{"line_number":2061,"context_line":"    def _clean_shutdown(self, instance, timeout, retry_interval):"},{"line_number":2062,"context_line":"        \"\"\"Attempt to shutdown  the instance gracefully."},{"line_number":2063,"context_line":""},{"line_number":2064,"context_line":"        :returns: True if the shutdown succeeded"},{"line_number":2065,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2F1NI%3D","line":2062,"updated":"2014-02-10 14:51:43.000000000","message":"Can you document the method parameters - in particular I\u0027d like to see explicit units method for the timeout + retry_interval. Presumably they\u0027re measuring seconds, but nice to be clear about it.","commit_id":"ac2fec595203ed834a829326cebf9fdc11d9117a"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"b62ab8cbb3287b9387a12c09ac97e3b792919a61","unresolved":false,"context_lines":[{"line_number":2059,"context_line":"        dom.resume()"},{"line_number":2060,"context_line":""},{"line_number":2061,"context_line":"    def _clean_shutdown(self, instance, timeout, retry_interval):"},{"line_number":2062,"context_line":"        \"\"\"Attempt to shutdown  the instance gracefully."},{"line_number":2063,"context_line":""},{"line_number":2064,"context_line":"        :returns: True if the shutdown succeeded"},{"line_number":2065,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2Fp3Q%3D","line":2062,"in_reply_to":"AAAAUX%2F%2F1NI%3D","updated":"2014-02-11 18:29:22.000000000","message":"Yep - fair point","commit_id":"ac2fec595203ed834a829326cebf9fdc11d9117a"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"f384182389ceb6464974cc94d1434b895d86b6ab","unresolved":false,"context_lines":[{"line_number":2100,"context_line":"            new_domid \u003d dom.ID()"},{"line_number":2101,"context_line":""},{"line_number":2102,"context_line":"            # NOTE(ivoks): By checking domain IDs, we make sure we are"},{"line_number":2103,"context_line":"            #              not recreating domain that\u0027s already running."},{"line_number":2104,"context_line":"            if old_domid !\u003d new_domid:"},{"line_number":2105,"context_line":"                if state in [power_state.SHUTDOWN,"},{"line_number":2106,"context_line":"                             power_state.CRASHED]:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2F1Mk%3D","line":2103,"updated":"2014-02-10 14:51:43.000000000","message":"Not sure this comment is correct - we\u0027re not \u0027recreating\u0027 domains at all here - this is about shutdown. Copy+paste mistake i guess.","commit_id":"ac2fec595203ed834a829326cebf9fdc11d9117a"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"b62ab8cbb3287b9387a12c09ac97e3b792919a61","unresolved":false,"context_lines":[{"line_number":2100,"context_line":"            new_domid \u003d dom.ID()"},{"line_number":2101,"context_line":""},{"line_number":2102,"context_line":"            # NOTE(ivoks): By checking domain IDs, we make sure we are"},{"line_number":2103,"context_line":"            #              not recreating domain that\u0027s already running."},{"line_number":2104,"context_line":"            if old_domid !\u003d new_domid:"},{"line_number":2105,"context_line":"                if state in [power_state.SHUTDOWN,"},{"line_number":2106,"context_line":"                             power_state.CRASHED]:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2Fp2o%3D","line":2103,"in_reply_to":"AAAAUX%2F%2F1Mk%3D","updated":"2014-02-11 18:29:22.000000000","message":"Yep - came from soft reboot ;-(\nI\u0027ll update it","commit_id":"ac2fec595203ed834a829326cebf9fdc11d9117a"},{"author":{"_account_id":7746,"name":"Dan Genin","email":"daniel.genin@jhuapl.edu","username":"DiG"},"change_message_id":"ae88623a710dd267aa3db5da264c47e08bda225b","unresolved":false,"context_lines":[{"line_number":2100,"context_line":"            new_domid \u003d dom.ID()"},{"line_number":2101,"context_line":""},{"line_number":2102,"context_line":"            # NOTE(ivoks): By checking domain IDs, we make sure we are"},{"line_number":2103,"context_line":"            #              not recreating domain that\u0027s already running."},{"line_number":2104,"context_line":"            if old_domid !\u003d new_domid:"},{"line_number":2105,"context_line":"                if state in [power_state.SHUTDOWN,"},{"line_number":2106,"context_line":"                             power_state.CRASHED]:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2Fx2U%3D","line":2103,"in_reply_to":"AAAAUX%2F%2Fp2o%3D","updated":"2014-03-13 21:56:38.000000000","message":"I don\u0027t think the check old_domid !\u003d new_domid makes sense here. In _soft_reboot() it is necessary to make sure the newly booted instance is different from the old instance with the same name. Here we are only dealing with one instance, the one being shutdown, so this is dead code.","commit_id":"ac2fec595203ed834a829326cebf9fdc11d9117a"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"f384182389ceb6464974cc94d1434b895d86b6ab","unresolved":false,"context_lines":[{"line_number":2114,"context_line":"                # Instance could shutdown at any time, in which case we"},{"line_number":2115,"context_line":"                # will get an exception when we call shutdown"},{"line_number":2116,"context_line":"                try:"},{"line_number":2117,"context_line":"                    dom.shutdown()"},{"line_number":2118,"context_line":"                except libvirt.libvirtError:"},{"line_number":2119,"context_line":"                    # Assume this is beacuse its now shutdown, so loop"},{"line_number":2120,"context_line":"                    # one more time to clean up."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2F1Ks%3D","line":2117,"updated":"2014-02-10 14:51:43.000000000","message":"Repeatedly calling \u0027shutdown\u0027 in the body of the loop doesn\u0027t do anything useful IMHO.\n\nThe \u0027shutdown\u0027 method requires guest co-operation. if the guest is going to co-operate then the first invoke will be sufficient. If the guest is not going to co-operate,then additional invoking of shutdown won\u0027t make it change its mind.\n\nBasically just \u0027shutdown\u0027 once and then monitor its state until it is gone or you hit the timeout.","commit_id":"ac2fec595203ed834a829326cebf9fdc11d9117a"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"b62ab8cbb3287b9387a12c09ac97e3b792919a61","unresolved":false,"context_lines":[{"line_number":2114,"context_line":"                # Instance could shutdown at any time, in which case we"},{"line_number":2115,"context_line":"                # will get an exception when we call shutdown"},{"line_number":2116,"context_line":"                try:"},{"line_number":2117,"context_line":"                    dom.shutdown()"},{"line_number":2118,"context_line":"                except libvirt.libvirtError:"},{"line_number":2119,"context_line":"                    # Assume this is beacuse its now shutdown, so loop"},{"line_number":2120,"context_line":"                    # one more time to clean up."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2Fpzo%3D","line":2117,"in_reply_to":"AAAAUX%2F%2F1Ks%3D","updated":"2014-02-11 18:29:22.000000000","message":"I don\u0027t agreee, this is specifically the problem I had with the original version of this change that merged and then had to be reverted because it made gate take too long.\nThe problem is that Nova can\u0027t tell if the guest is ready to co-operate or not;  specifically if you try to stop a VM immediately after its gets to Active (which is a common pattern in Tempest) then the guestOS may not have yet reached the point where it will take notice, and so the shutdown request is effectively missed - and you end up waiting for the full timeout period.    Re-sending the shutdown every so often works around that problem.","commit_id":"ac2fec595203ed834a829326cebf9fdc11d9117a"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"76dd6ab9aac3b43e9f7b36cab163d68ca3351869","unresolved":false,"context_lines":[{"line_number":2114,"context_line":"                # Instance could shutdown at any time, in which case we"},{"line_number":2115,"context_line":"                # will get an exception when we call shutdown"},{"line_number":2116,"context_line":"                try:"},{"line_number":2117,"context_line":"                    dom.shutdown()"},{"line_number":2118,"context_line":"                except libvirt.libvirtError:"},{"line_number":2119,"context_line":"                    # Assume this is beacuse its now shutdown, so loop"},{"line_number":2120,"context_line":"                    # one more time to clean up."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2FkU4%3D","line":2117,"in_reply_to":"AAAAUX%2F%2Fpzo%3D","updated":"2014-02-12 09:53:47.000000000","message":"Ok, can you add a comment to this effect against this dom.shutdown call so it is clear to people that it isn\u0027t redundant.","commit_id":"ac2fec595203ed834a829326cebf9fdc11d9117a"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"f384182389ceb6464974cc94d1434b895d86b6ab","unresolved":false,"context_lines":[{"line_number":2128,"context_line":"            if timeutils.is_older_than(start_time, timeout):"},{"line_number":2129,"context_line":"                break"},{"line_number":2130,"context_line":""},{"line_number":2131,"context_line":"            greenthread.sleep(1)"},{"line_number":2132,"context_line":""},{"line_number":2133,"context_line":"        LOG.info(_(\"Instance failed to shutdown in %d seconds.\") %"},{"line_number":2134,"context_line":"                 timeout, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2F1KI%3D","line":2131,"updated":"2014-02-10 14:51:43.000000000","message":"Doesn\u0027t a normal \u0027time.sleep\u0027 get patched to call greenthread.sleep anyway ? If we can avoid directly calling greenthreads APIs, that\u0027s slightly nicer.","commit_id":"ac2fec595203ed834a829326cebf9fdc11d9117a"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"b62ab8cbb3287b9387a12c09ac97e3b792919a61","unresolved":false,"context_lines":[{"line_number":2128,"context_line":"            if timeutils.is_older_than(start_time, timeout):"},{"line_number":2129,"context_line":"                break"},{"line_number":2130,"context_line":""},{"line_number":2131,"context_line":"            greenthread.sleep(1)"},{"line_number":2132,"context_line":""},{"line_number":2133,"context_line":"        LOG.info(_(\"Instance failed to shutdown in %d seconds.\") %"},{"line_number":2134,"context_line":"                 timeout, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2FpwE%3D","line":2131,"in_reply_to":"AAAAUX%2F%2F1KI%3D","updated":"2014-02-11 18:29:22.000000000","message":"I\u0027m not sure - the Nova code (and this file) seems to use a mix of time.sleep() and greenthread.sleep().    This code was based on soft reboot which used greenthread.sleep - but of your confident they are the same I don\u0027t mind changing.  Can you point to where it gets patched ?","commit_id":"ac2fec595203ed834a829326cebf9fdc11d9117a"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"76dd6ab9aac3b43e9f7b36cab163d68ca3351869","unresolved":false,"context_lines":[{"line_number":2128,"context_line":"            if timeutils.is_older_than(start_time, timeout):"},{"line_number":2129,"context_line":"                break"},{"line_number":2130,"context_line":""},{"line_number":2131,"context_line":"            greenthread.sleep(1)"},{"line_number":2132,"context_line":""},{"line_number":2133,"context_line":"        LOG.info(_(\"Instance failed to shutdown in %d seconds.\") %"},{"line_number":2134,"context_line":"                 timeout, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2FkSY%3D","line":2131,"in_reply_to":"AAAAUX%2F%2FpwE%3D","updated":"2014-02-12 09:53:47.000000000","message":"Well nova/cmd/__init__.py calls  eventlet.monkey_patch(os\u003dFalse).  According to the eventlet docs this should result in the \"time\" module being patched http://eventlet.net/doc/patching.html and a test program confirms it\n\n  $ cat e.py\n  import eventlet\n  eventlet.monkey_patch(os\u003dFalse)\n  print eventlet.patcher.is_monkey_patched(\"time\")\n  $ python e.py \n  True","commit_id":"ac2fec595203ed834a829326cebf9fdc11d9117a"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"6281b4a7255d2c305c7c8dc844ffb9788c20a005","unresolved":false,"context_lines":[{"line_number":2140,"context_line":""},{"line_number":2141,"context_line":"        (state, _max_mem, _mem, _cpus, _t) \u003d dom.info()"},{"line_number":2142,"context_line":"        state \u003d LIBVIRT_POWER_STATE[state]"},{"line_number":2143,"context_line":"        LOG.debug(_(\"Shuting down instance from state %s\") % state,"},{"line_number":2144,"context_line":"                  instance\u003dinstance)"},{"line_number":2145,"context_line":"        if (state \u003d\u003d power_state.SHUTDOWN or"},{"line_number":2146,"context_line":"                state \u003d\u003d power_state.CRASHED):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXX%2F%2F1KU%3D","line":2143,"updated":"2014-04-25 22:54:37.000000000","message":"Shuting -\u003e Shutting","commit_id":"09b1be47383230237efe3fa1109fc860a7b524e8"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"70def70d862ecb019d32c610d950eefea79747c5","unresolved":false,"context_lines":[{"line_number":2140,"context_line":""},{"line_number":2141,"context_line":"        (state, _max_mem, _mem, _cpus, _t) \u003d dom.info()"},{"line_number":2142,"context_line":"        state \u003d LIBVIRT_POWER_STATE[state]"},{"line_number":2143,"context_line":"        LOG.debug(_(\"Shuting down instance from state %s\") % state,"},{"line_number":2144,"context_line":"                  instance\u003dinstance)"},{"line_number":2145,"context_line":"        if (state \u003d\u003d power_state.SHUTDOWN or"},{"line_number":2146,"context_line":"                state \u003d\u003d power_state.CRASHED):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad9bd40_b711b3ae","line":2143,"in_reply_to":"AAAAXX%2F%2F1KU%3D","updated":"2014-04-30 10:51:00.000000000","message":"Done","commit_id":"09b1be47383230237efe3fa1109fc860a7b524e8"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"6281b4a7255d2c305c7c8dc844ffb9788c20a005","unresolved":false,"context_lines":[{"line_number":2151,"context_line":"        dom.shutdown()"},{"line_number":2152,"context_line":"        retry_countdown \u003d retry_interval"},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"        for tick in xrange(timeout):"},{"line_number":2155,"context_line":""},{"line_number":2156,"context_line":"            dom \u003d self._lookup_by_name(instance[\"name\"])"},{"line_number":2157,"context_line":"            (state, _max_mem, _mem, _cpus, _t) \u003d dom.info()"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXX%2F%2F1KI%3D","line":2154,"updated":"2014-04-25 22:54:37.000000000","message":"xrange -\u003e six.moves.range (?)\n\nAnother idea, is it possible that this can be callback based instead of loop based? I\u0027m not sure if the api supports it, but instead of having a loop u could just tell libvirt to power-down and on-failure or on-success call a given function (the on-failure would then try the same api again, until it can\u0027t do it anymore). That way there isn\u0027t a greenthread/thread existing here until this is done.","commit_id":"09b1be47383230237efe3fa1109fc860a7b524e8"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"70def70d862ecb019d32c610d950eefea79747c5","unresolved":false,"context_lines":[{"line_number":2151,"context_line":"        dom.shutdown()"},{"line_number":2152,"context_line":"        retry_countdown \u003d retry_interval"},{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"        for tick in xrange(timeout):"},{"line_number":2155,"context_line":""},{"line_number":2156,"context_line":"            dom \u003d self._lookup_by_name(instance[\"name\"])"},{"line_number":2157,"context_line":"            (state, _max_mem, _mem, _cpus, _t) \u003d dom.info()"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad9bd40_b7d613c4","line":2154,"in_reply_to":"AAAAXX%2F%2F1KI%3D","updated":"2014-04-30 10:51:00.000000000","message":"I don\u0027t think a call back would work here - as we have to retry the shutdown at various intervals.    The overhead of polling here is very small (most of the time is spent in sleep) - and the code is really easy to follow.","commit_id":"09b1be47383230237efe3fa1109fc860a7b524e8"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"6281b4a7255d2c305c7c8dc844ffb9788c20a005","unresolved":false,"context_lines":[{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"        for tick in xrange(timeout):"},{"line_number":2155,"context_line":""},{"line_number":2156,"context_line":"            dom \u003d self._lookup_by_name(instance[\"name\"])"},{"line_number":2157,"context_line":"            (state, _max_mem, _mem, _cpus, _t) \u003d dom.info()"},{"line_number":2158,"context_line":"            state \u003d LIBVIRT_POWER_STATE[state]"},{"line_number":2159,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXX%2F%2F1I4%3D","line":2156,"updated":"2014-04-25 22:54:37.000000000","message":"Seems like this (these ~8 lines) could be small function inside this method that is shared with the code above.","commit_id":"09b1be47383230237efe3fa1109fc860a7b524e8"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"70def70d862ecb019d32c610d950eefea79747c5","unresolved":false,"context_lines":[{"line_number":2153,"context_line":""},{"line_number":2154,"context_line":"        for tick in xrange(timeout):"},{"line_number":2155,"context_line":""},{"line_number":2156,"context_line":"            dom \u003d self._lookup_by_name(instance[\"name\"])"},{"line_number":2157,"context_line":"            (state, _max_mem, _mem, _cpus, _t) \u003d dom.info()"},{"line_number":2158,"context_line":"            state \u003d LIBVIRT_POWER_STATE[state]"},{"line_number":2159,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad9bd40_17933ffb","line":2156,"in_reply_to":"AAAAXX%2F%2F1I4%3D","updated":"2014-04-30 10:51:00.000000000","message":"Not really convinced - the check is the same but the log message needs to be different - so by the time that\u0027s parametrised you\u0027re not really making much of a gain. \n\nHow about if I make the list of states a constant so the check becomes:\n\nif state in shutdown_states:","commit_id":"09b1be47383230237efe3fa1109fc860a7b524e8"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"6281b4a7255d2c305c7c8dc844ffb9788c20a005","unresolved":false,"context_lines":[{"line_number":2175,"context_line":"                try:"},{"line_number":2176,"context_line":"                    dom.shutdown()"},{"line_number":2177,"context_line":"                except libvirt.libvirtError:"},{"line_number":2178,"context_line":"                    # Assume this is beacuse its now shutdown, so loop"},{"line_number":2179,"context_line":"                    # one more time to clean up."},{"line_number":2180,"context_line":"                    with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":2181,"context_line":"                        ctxt.reraise \u003d False"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXX%2F%2F1JY%3D","line":2178,"updated":"2014-04-25 22:54:37.000000000","message":"beacuse -\u003e because","commit_id":"09b1be47383230237efe3fa1109fc860a7b524e8"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"70def70d862ecb019d32c610d950eefea79747c5","unresolved":false,"context_lines":[{"line_number":2175,"context_line":"                try:"},{"line_number":2176,"context_line":"                    dom.shutdown()"},{"line_number":2177,"context_line":"                except libvirt.libvirtError:"},{"line_number":2178,"context_line":"                    # Assume this is beacuse its now shutdown, so loop"},{"line_number":2179,"context_line":"                    # one more time to clean up."},{"line_number":2180,"context_line":"                    with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":2181,"context_line":"                        ctxt.reraise \u003d False"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad9bd40_b749b38d","line":2178,"in_reply_to":"AAAAXX%2F%2F1JY%3D","updated":"2014-04-30 10:51:00.000000000","message":"Done","commit_id":"09b1be47383230237efe3fa1109fc860a7b524e8"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"d4f25440ea10a38c52db615d485209a69088667e","unresolved":false,"context_lines":[{"line_number":2175,"context_line":"        dom.resume()"},{"line_number":2176,"context_line":""},{"line_number":2177,"context_line":"    def _clean_shutdown(self, instance, timeout, retry_interval):"},{"line_number":2178,"context_line":"        \"\"\"Attempt to shutdown  the instance gracefully."},{"line_number":2179,"context_line":""},{"line_number":2180,"context_line":"        :param instance: The instance to be shutdown"},{"line_number":2181,"context_line":"        :param timeout: How long to wait in seconds for the instance to"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_1c0dcee8","line":2178,"updated":"2014-07-31 11:04:54.000000000","message":"there are 2 spaces between \u0027shutdown\u0027 and \u0027the\u0027.","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"48c422fffa93e49dd39cd4b9d521aa54f9eeb1ab","unresolved":false,"context_lines":[{"line_number":2175,"context_line":"        dom.resume()"},{"line_number":2176,"context_line":""},{"line_number":2177,"context_line":"    def _clean_shutdown(self, instance, timeout, retry_interval):"},{"line_number":2178,"context_line":"        \"\"\"Attempt to shutdown  the instance gracefully."},{"line_number":2179,"context_line":""},{"line_number":2180,"context_line":"        :param instance: The instance to be shutdown"},{"line_number":2181,"context_line":"        :param timeout: How long to wait in seconds for the instance to"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_115d4c48","line":2178,"in_reply_to":"baada198_1c0dcee8","updated":"2014-08-04 10:36:25.000000000","message":"Done","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"cc3d93f5fa40b478178d7b65dd06b9f04ad90f60","unresolved":false,"context_lines":[{"line_number":2238,"context_line":"                    # Assume this is because its now shutdown, so loop"},{"line_number":2239,"context_line":"                    # one more time to clean up."},{"line_number":2240,"context_line":"                    with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":2241,"context_line":"                        ctxt.reraise \u003d False"},{"line_number":2242,"context_line":"                        LOG.debug(\"Ignoring libvirt exception from \""},{"line_number":2243,"context_line":"                                  \"dom,shutdown as during shutdown.\","},{"line_number":2244,"context_line":"                                  instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_09724e4a","line":2241,"updated":"2014-07-29 10:44:32.000000000","message":"This save_and_reraise_exception usage seems pretty pointless since we unconditionally ignore the exception.  We simply need\n\n   except libvirt.libvirtError\n      LOG.debug(....)\n      continue","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"ff32c075075971591bd050a075809f8958f9fcfe","unresolved":false,"context_lines":[{"line_number":2238,"context_line":"                    # Assume this is because its now shutdown, so loop"},{"line_number":2239,"context_line":"                    # one more time to clean up."},{"line_number":2240,"context_line":"                    with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":2241,"context_line":"                        ctxt.reraise \u003d False"},{"line_number":2242,"context_line":"                        LOG.debug(\"Ignoring libvirt exception from \""},{"line_number":2243,"context_line":"                                  \"dom,shutdown as during shutdown.\","},{"line_number":2244,"context_line":"                                  instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_8ab8027a","line":2241,"in_reply_to":"baada198_09724e4a","updated":"2014-07-29 18:00:32.000000000","message":"My understanding is that  you have to use save_and_reraise if you\u0027re going to call Log due to some issue around thread switching ?","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"48c422fffa93e49dd39cd4b9d521aa54f9eeb1ab","unresolved":false,"context_lines":[{"line_number":2238,"context_line":"                    # Assume this is because its now shutdown, so loop"},{"line_number":2239,"context_line":"                    # one more time to clean up."},{"line_number":2240,"context_line":"                    with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":2241,"context_line":"                        ctxt.reraise \u003d False"},{"line_number":2242,"context_line":"                        LOG.debug(\"Ignoring libvirt exception from \""},{"line_number":2243,"context_line":"                                  \"dom,shutdown as during shutdown.\","},{"line_number":2244,"context_line":"                                  instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_fc07cf14","line":2241,"in_reply_to":"baada198_6369fb25","updated":"2014-08-04 10:36:25.000000000","message":"Done","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"b3df80b1384dbf3ddd07b43a477e345fccd67b70","unresolved":false,"context_lines":[{"line_number":2238,"context_line":"                    # Assume this is because its now shutdown, so loop"},{"line_number":2239,"context_line":"                    # one more time to clean up."},{"line_number":2240,"context_line":"                    with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":2241,"context_line":"                        ctxt.reraise \u003d False"},{"line_number":2242,"context_line":"                        LOG.debug(\"Ignoring libvirt exception from \""},{"line_number":2243,"context_line":"                                  \"dom,shutdown as during shutdown.\","},{"line_number":2244,"context_line":"                                  instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_6369fb25","line":2241,"in_reply_to":"baada198_8ab8027a","updated":"2014-07-30 09:00:22.000000000","message":"I\u0027ve never heard of that need before and there are countless places in the libvirt driver and Nova code which call LOG.xxxx in a plain except block.","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"cc3d93f5fa40b478178d7b65dd06b9f04ad90f60","unresolved":false,"context_lines":[{"line_number":2240,"context_line":"                    with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":2241,"context_line":"                        ctxt.reraise \u003d False"},{"line_number":2242,"context_line":"                        LOG.debug(\"Ignoring libvirt exception from \""},{"line_number":2243,"context_line":"                                  \"dom,shutdown as during shutdown.\","},{"line_number":2244,"context_line":"                                  instance\u003dinstance)"},{"line_number":2245,"context_line":"                        continue"},{"line_number":2246,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_e9c6fa68","line":2243,"updated":"2014-07-29 10:44:32.000000000","message":"This debug message seems a little redundant, and there\u0027s a  typo in there too. How about simply  \"Ignoring exception from shutdown request\"","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"48c422fffa93e49dd39cd4b9d521aa54f9eeb1ab","unresolved":false,"context_lines":[{"line_number":2240,"context_line":"                    with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":2241,"context_line":"                        ctxt.reraise \u003d False"},{"line_number":2242,"context_line":"                        LOG.debug(\"Ignoring libvirt exception from \""},{"line_number":2243,"context_line":"                                  \"dom,shutdown as during shutdown.\","},{"line_number":2244,"context_line":"                                  instance\u003dinstance)"},{"line_number":2245,"context_line":"                        continue"},{"line_number":2246,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_dc04cb15","line":2243,"in_reply_to":"baada198_e9c6fa68","updated":"2014-08-04 10:36:25.000000000","message":"Done","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"ff32c075075971591bd050a075809f8958f9fcfe","unresolved":false,"context_lines":[{"line_number":2240,"context_line":"                    with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":2241,"context_line":"                        ctxt.reraise \u003d False"},{"line_number":2242,"context_line":"                        LOG.debug(\"Ignoring libvirt exception from \""},{"line_number":2243,"context_line":"                                  \"dom,shutdown as during shutdown.\","},{"line_number":2244,"context_line":"                                  instance\u003dinstance)"},{"line_number":2245,"context_line":"                        continue"},{"line_number":2246,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":20,"id":"baada198_eab7be83","line":2243,"in_reply_to":"baada198_e9c6fa68","updated":"2014-07-29 18:00:32.000000000","message":"Done","commit_id":"b852b463e97094b65fdb0df20ee6e32a008776a9"},{"author":{"_account_id":8412,"name":"Mike Durnosvistov","email":"glacierr.dev@gmail.com","username":"mdurnosvistov"},"change_message_id":"21cab2e76f84394cf81d35ae75881f73a8de2954","unresolved":false,"context_lines":[{"line_number":2207,"context_line":"        LOG.debug(\"Shutting down instance from state %s\", state,"},{"line_number":2208,"context_line":"                  instance\u003dinstance)"},{"line_number":2209,"context_line":"        if state in shutdown_states:"},{"line_number":2210,"context_line":"            LOG.info(_(\"Instance already shutdown.\"),"},{"line_number":2211,"context_line":"                     instance\u003dinstance)"},{"line_number":2212,"context_line":"            return True"},{"line_number":2213,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_576e3fc9","line":2210,"range":{"start_line":2210,"start_character":12,"end_line":2210,"end_character":23},"updated":"2014-08-07 19:42:00.000000000","message":"LOG.info(_LI(...","commit_id":"8e3ff3be2ea488e8c71361ea649cbbf7a407fc5a"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"c33c1b19c10d8785a7e313413272ed42f4d1ef02","unresolved":false,"context_lines":[{"line_number":2207,"context_line":"        LOG.debug(\"Shutting down instance from state %s\", state,"},{"line_number":2208,"context_line":"                  instance\u003dinstance)"},{"line_number":2209,"context_line":"        if state in shutdown_states:"},{"line_number":2210,"context_line":"            LOG.info(_(\"Instance already shutdown.\"),"},{"line_number":2211,"context_line":"                     instance\u003dinstance)"},{"line_number":2212,"context_line":"            return True"},{"line_number":2213,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_fce641ae","line":2210,"in_reply_to":"baada198_576e3fc9","updated":"2014-08-08 10:44:38.000000000","message":"Done","commit_id":"8e3ff3be2ea488e8c71361ea649cbbf7a407fc5a"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"3cc4c1b54dad02378ff5e6cffd1bafed2f1ae0e2","unresolved":false,"context_lines":[{"line_number":2214,"context_line":"        dom.shutdown()"},{"line_number":2215,"context_line":"        retry_countdown \u003d retry_interval"},{"line_number":2216,"context_line":""},{"line_number":2217,"context_line":"        for tick in six.moves.range(timeout):"},{"line_number":2218,"context_line":""},{"line_number":2219,"context_line":"            dom \u003d self._lookup_by_name(instance[\"name\"])"},{"line_number":2220,"context_line":"            (state, _max_mem, _mem, _cpus, _t) \u003d dom.info()"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_5da12439","line":2217,"updated":"2014-08-06 22:38:57.000000000","message":"In a similar patch for the Hyper-V driver jaypipes suggested to avoid retrying to shutdown: https://review.openstack.org/#/c/108662/\n\nCommenting here, as for the sake of consistency across drivers this should apply also to libvirt.","commit_id":"8e3ff3be2ea488e8c71361ea649cbbf7a407fc5a"},{"author":{"_account_id":8412,"name":"Mike Durnosvistov","email":"glacierr.dev@gmail.com","username":"mdurnosvistov"},"change_message_id":"21cab2e76f84394cf81d35ae75881f73a8de2954","unresolved":false,"context_lines":[{"line_number":2221,"context_line":"            state \u003d LIBVIRT_POWER_STATE[state]"},{"line_number":2222,"context_line":""},{"line_number":2223,"context_line":"            if state in shutdown_states:"},{"line_number":2224,"context_line":"                LOG.info(_(\"Instance shutdown successfully after %d \""},{"line_number":2225,"context_line":"                           \"seconds.\"), tick, instance\u003dinstance)"},{"line_number":2226,"context_line":"                return True"},{"line_number":2227,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_17820751","line":2224,"range":{"start_line":2224,"start_character":16,"end_line":2224,"end_character":27},"updated":"2014-08-07 19:42:00.000000000","message":"LOG.info(_LI(...","commit_id":"8e3ff3be2ea488e8c71361ea649cbbf7a407fc5a"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"c33c1b19c10d8785a7e313413272ed42f4d1ef02","unresolved":false,"context_lines":[{"line_number":2221,"context_line":"            state \u003d LIBVIRT_POWER_STATE[state]"},{"line_number":2222,"context_line":""},{"line_number":2223,"context_line":"            if state in shutdown_states:"},{"line_number":2224,"context_line":"                LOG.info(_(\"Instance shutdown successfully after %d \""},{"line_number":2225,"context_line":"                           \"seconds.\"), tick, instance\u003dinstance)"},{"line_number":2226,"context_line":"                return True"},{"line_number":2227,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_3cfc393f","line":2224,"in_reply_to":"baada198_17820751","updated":"2014-08-08 10:44:38.000000000","message":"Done","commit_id":"8e3ff3be2ea488e8c71361ea649cbbf7a407fc5a"},{"author":{"_account_id":8412,"name":"Mike Durnosvistov","email":"glacierr.dev@gmail.com","username":"mdurnosvistov"},"change_message_id":"21cab2e76f84394cf81d35ae75881f73a8de2954","unresolved":false,"context_lines":[{"line_number":2250,"context_line":""},{"line_number":2251,"context_line":"            time.sleep(1)"},{"line_number":2252,"context_line":""},{"line_number":2253,"context_line":"        LOG.info(_(\"Instance failed to shutdown in %d seconds.\") %"},{"line_number":2254,"context_line":"                 timeout, instance\u003dinstance)"},{"line_number":2255,"context_line":"        return False"},{"line_number":2256,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_b78cfb81","line":2253,"range":{"start_line":2253,"start_character":16,"end_line":2253,"end_character":19},"updated":"2014-08-07 19:42:00.000000000","message":"(_LI(","commit_id":"8e3ff3be2ea488e8c71361ea649cbbf7a407fc5a"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"c33c1b19c10d8785a7e313413272ed42f4d1ef02","unresolved":false,"context_lines":[{"line_number":2250,"context_line":""},{"line_number":2251,"context_line":"            time.sleep(1)"},{"line_number":2252,"context_line":""},{"line_number":2253,"context_line":"        LOG.info(_(\"Instance failed to shutdown in %d seconds.\") %"},{"line_number":2254,"context_line":"                 timeout, instance\u003dinstance)"},{"line_number":2255,"context_line":"        return False"},{"line_number":2256,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_ce0b872b","line":2253,"in_reply_to":"baada198_b78cfb81","updated":"2014-08-08 10:44:38.000000000","message":"Done","commit_id":"8e3ff3be2ea488e8c71361ea649cbbf7a407fc5a"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"5c60cb9632c914f94ce3d339a354981910646e5a","unresolved":false,"context_lines":[{"line_number":2195,"context_line":"        \"\"\""},{"line_number":2196,"context_line":""},{"line_number":2197,"context_line":"        # List of states that represent a shutdown instance"},{"line_number":2198,"context_line":"        shutdown_states \u003d [power_state.SHUTDOWN,"},{"line_number":2199,"context_line":"                           power_state.CRASHED]"},{"line_number":2200,"context_line":""},{"line_number":2201,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_a1339df5","line":2198,"updated":"2014-08-10 05:45:38.000000000","message":"this should be moved to line 2212 - no need to assign it here as the exception may be thrown below","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"e5d31728b2ae729e84131fe2c9a593f27be5dcc6","unresolved":false,"context_lines":[{"line_number":2195,"context_line":"        \"\"\""},{"line_number":2196,"context_line":""},{"line_number":2197,"context_line":"        # List of states that represent a shutdown instance"},{"line_number":2198,"context_line":"        shutdown_states \u003d [power_state.SHUTDOWN,"},{"line_number":2199,"context_line":"                           power_state.CRASHED]"},{"line_number":2200,"context_line":""},{"line_number":2201,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":29,"id":"1abeadc6_97e2e89d","line":2198,"in_reply_to":"baada198_a1339df5","updated":"2014-08-18 14:33:51.000000000","message":"The intention was that its a constant, which seemed to make more sense to declare at the start of the method.  I\u0027ll rename it to caps.","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"693aaf55c96b5d3652a2a56123d398d18fb8e6fd","unresolved":false,"context_lines":[{"line_number":2208,"context_line":"        (state, _max_mem, _mem, _cpus, _t) \u003d dom.info()"},{"line_number":2209,"context_line":"        state \u003d LIBVIRT_POWER_STATE[state]"},{"line_number":2210,"context_line":"        LOG.debug(\"Shutting down instance from state %s\", state,"},{"line_number":2211,"context_line":"                  instance\u003dinstance)"},{"line_number":2212,"context_line":"        if state in shutdown_states:"},{"line_number":2213,"context_line":"            LOG.info(_LI(\"Instance already shutdown.\"),"},{"line_number":2214,"context_line":"                     instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_65850609","line":2211,"updated":"2014-08-11 05:30:18.000000000","message":"move to line 2217 would be better","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"e5d31728b2ae729e84131fe2c9a593f27be5dcc6","unresolved":false,"context_lines":[{"line_number":2208,"context_line":"        (state, _max_mem, _mem, _cpus, _t) \u003d dom.info()"},{"line_number":2209,"context_line":"        state \u003d LIBVIRT_POWER_STATE[state]"},{"line_number":2210,"context_line":"        LOG.debug(\"Shutting down instance from state %s\", state,"},{"line_number":2211,"context_line":"                  instance\u003dinstance)"},{"line_number":2212,"context_line":"        if state in shutdown_states:"},{"line_number":2213,"context_line":"            LOG.info(_LI(\"Instance already shutdown.\"),"},{"line_number":2214,"context_line":"                     instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":29,"id":"1abeadc6_578690ba","line":2211,"in_reply_to":"baada198_65850609","updated":"2014-08-18 14:33:51.000000000","message":"Done","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"5c60cb9632c914f94ce3d339a354981910646e5a","unresolved":false,"context_lines":[{"line_number":2217,"context_line":"        dom.shutdown()"},{"line_number":2218,"context_line":"        retry_countdown \u003d retry_interval"},{"line_number":2219,"context_line":""},{"line_number":2220,"context_line":"        for tick in six.moves.range(timeout):"},{"line_number":2221,"context_line":""},{"line_number":2222,"context_line":"            dom \u003d self._lookup_by_name(instance[\"name\"])"},{"line_number":2223,"context_line":"            (state, _max_mem, _mem, _cpus, _t) \u003d dom.info()"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_c12c1197","line":2220,"updated":"2014-08-10 05:45:38.000000000","message":"tick is a little confusing where below you log that it is seconds","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"e5d31728b2ae729e84131fe2c9a593f27be5dcc6","unresolved":false,"context_lines":[{"line_number":2217,"context_line":"        dom.shutdown()"},{"line_number":2218,"context_line":"        retry_countdown \u003d retry_interval"},{"line_number":2219,"context_line":""},{"line_number":2220,"context_line":"        for tick in six.moves.range(timeout):"},{"line_number":2221,"context_line":""},{"line_number":2222,"context_line":"            dom \u003d self._lookup_by_name(instance[\"name\"])"},{"line_number":2223,"context_line":"            (state, _max_mem, _mem, _cpus, _t) \u003d dom.info()"}],"source_content_type":"text/x-python","patch_set":29,"id":"1abeadc6_da79e594","line":2220,"in_reply_to":"baada198_c12c1197","updated":"2014-08-18 14:33:51.000000000","message":"Done","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"5c60cb9632c914f94ce3d339a354981910646e5a","unresolved":false,"context_lines":[{"line_number":2254,"context_line":"            time.sleep(1)"},{"line_number":2255,"context_line":""},{"line_number":2256,"context_line":"        LOG.info(_LI(\"Instance failed to shutdown in %d seconds.\") %"},{"line_number":2257,"context_line":"                 timeout, instance\u003dinstance)"},{"line_number":2258,"context_line":"        return False"},{"line_number":2259,"context_line":""},{"line_number":2260,"context_line":"    def power_off(self, instance, timeout\u003d0, retry_interval\u003d0):"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_014a895a","line":2257,"updated":"2014-08-10 05:45:38.000000000","message":"please use a , instead of the %","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"e5d31728b2ae729e84131fe2c9a593f27be5dcc6","unresolved":false,"context_lines":[{"line_number":2254,"context_line":"            time.sleep(1)"},{"line_number":2255,"context_line":""},{"line_number":2256,"context_line":"        LOG.info(_LI(\"Instance failed to shutdown in %d seconds.\") %"},{"line_number":2257,"context_line":"                 timeout, instance\u003dinstance)"},{"line_number":2258,"context_line":"        return False"},{"line_number":2259,"context_line":""},{"line_number":2260,"context_line":"    def power_off(self, instance, timeout\u003d0, retry_interval\u003d0):"}],"source_content_type":"text/x-python","patch_set":29,"id":"1abeadc6_17bc1869","line":2257,"in_reply_to":"baada198_014a895a","updated":"2014-08-18 14:33:51.000000000","message":"Done","commit_id":"88777417001ef9ddf7ce9e6f8a0022dfd94567df"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"6a74461eab1c7b6eb4851e8539c985f6281e60e4","unresolved":false,"context_lines":[{"line_number":2230,"context_line":""},{"line_number":2231,"context_line":"            # Note(PhilD): We can\u0027t assume that the Guest was able to process"},{"line_number":2232,"context_line":"            #              any previous shutdown signal (for example it may"},{"line_number":2233,"context_line":"            #              have still been startingup, so within the overall"},{"line_number":2234,"context_line":"            #              timeout we re-trigger the shutdown every"},{"line_number":2235,"context_line":"            #              retry_interval"},{"line_number":2236,"context_line":"            if retry_countdown \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":32,"id":"1abeadc6_6ec0ea2a","line":2233,"updated":"2014-08-19 12:45:08.000000000","message":"If you have to re-spin for any other reason   s/startingup/starting up/","commit_id":"c07ed15415c0ec3c5862f437f440632eff1e94df"}]}
