)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"607bbf4e16b94bf8b06f74a3863de82cf1d185b9","unresolved":false,"context_lines":[{"line_number":7,"context_line":"\u003cVMWARE\u003e Add power state cache for host init and power state sync."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When initing host and syncing power state, VMWare driver has to"},{"line_number":10,"context_line":"fetch the instance power state one by one. If there are thousands"},{"line_number":11,"context_line":"instances in vCenter, it will be time exhausting. To reduce time,"},{"line_number":12,"context_line":"this change adds a power state cache for host init and for every"},{"line_number":13,"context_line":"power state syncing."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"bae84128_76b88a11","line":11,"range":{"start_line":10,"start_character":43,"end_line":11,"end_character":49},"updated":"2016-02-24 14:25:41.000000000","message":"I guess the point of this is to do a bulk query to the vCenter for all VMs and it\u0027s just asking for the uuid and power_state information back.  The bug report says:\n\n\"If there are thousands of VMs on OpenStack, there will be thousands of requests to vCenter, which is a big network burden.\"\n\nI think the network part is important information to have in the commit message.\n\nDo you have any data to backup how this would improve the time it takes to run init_host or the sync power states task before and after this change on a vCenter with several hundred/thousand VMs?","commit_id":"adbd5e77ac422f7e42abc807f8dada4dca46ac14"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"28f8244d09c9c1136f5b8104041aa3d23eaa3ca2","unresolved":false,"context_lines":[{"line_number":7,"context_line":"\u003cVMWARE\u003e Add power state cache for host init and power state sync."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When initing host and syncing power state, VMWare driver has to"},{"line_number":10,"context_line":"fetch the instance power state one by one. If there are thousands"},{"line_number":11,"context_line":"instances in vCenter, it will be time exhausting. To reduce time,"},{"line_number":12,"context_line":"this change adds a power state cache for host init and for every"},{"line_number":13,"context_line":"power state syncing."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"bae84128_9c98a16c","line":11,"range":{"start_line":10,"start_character":43,"end_line":11,"end_character":49},"in_reply_to":"bae84128_76b88a11","updated":"2016-02-25 06:30:13.000000000","message":"Yes, thanks for your remind, I will add the network burden stuff into the commit message.\n\nYes, we used to have a customer who has 2000+ VMs, and it needs 2+hours to start the nova-compute service because of host init process; and the instance deployment will take long time if it is in same time frame with power state sync process.\n\nWe already internally we fixed the host init issue in our product, and the compute start up only takes less than 10mins.\n\nThis commit will cover both host init and power sync.","commit_id":"adbd5e77ac422f7e42abc807f8dada4dca46ac14"}],"nova/compute/manager.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"eb0b8ccccac7712fa30225e7a53efabbe40a50bc","unresolved":false,"context_lines":[{"line_number":5991,"context_line":""},{"line_number":5992,"context_line":"            self._syncs_in_progress.pop(db_instance.uuid)"},{"line_number":5993,"context_line":""},{"line_number":5994,"context_line":"        self._power_state_cache \u003d self.driver.get_all_power_state()"},{"line_number":5995,"context_line":"        for db_instance in db_instances:"},{"line_number":5996,"context_line":"            # process syncs asynchronously - don\u0027t want instance locking to"},{"line_number":5997,"context_line":"            # block entire periodic task thread"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_d3781092","line":5994,"updated":"2015-11-22 12:17:23.000000000","message":"in the driver method you called this get_all_power_states","commit_id":"27bffa3fba4e402ac29befb4539e37ecfc9e4a1d"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"0a7d169773408ccefde79c1b79c849011b586910","unresolved":false,"context_lines":[{"line_number":5991,"context_line":""},{"line_number":5992,"context_line":"            self._syncs_in_progress.pop(db_instance.uuid)"},{"line_number":5993,"context_line":""},{"line_number":5994,"context_line":"        self._power_state_cache \u003d self.driver.get_all_power_state()"},{"line_number":5995,"context_line":"        for db_instance in db_instances:"},{"line_number":5996,"context_line":"            # process syncs asynchronously - don\u0027t want instance locking to"},{"line_number":5997,"context_line":"            # block entire periodic task thread"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_0944d847","line":5994,"in_reply_to":"ba8a016a_d3781092","updated":"2015-12-28 07:47:44.000000000","message":"So?","commit_id":"27bffa3fba4e402ac29befb4539e37ecfc9e4a1d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"eb0b8ccccac7712fa30225e7a53efabbe40a50bc","unresolved":false,"context_lines":[{"line_number":6002,"context_line":"                LOG.debug(\u0027Triggering sync for uuid %s\u0027 % uuid)"},{"line_number":6003,"context_line":"                self._syncs_in_progress[uuid] \u003d True"},{"line_number":6004,"context_line":"                self._sync_power_pool.spawn_n(_sync, db_instance,"},{"line_number":6005,"context_line":"                    self._power_state_cache.get(db_instance.uuid, None))"},{"line_number":6006,"context_line":""},{"line_number":6007,"context_line":"    def _query_driver_power_state_and_sync(self, context, db_instance,"},{"line_number":6008,"context_line":"                                           vm_power_state\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_736da4cb","line":6005,"updated":"2015-11-22 12:17:23.000000000","message":"by default get returns None","commit_id":"27bffa3fba4e402ac29befb4539e37ecfc9e4a1d"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"0a7d169773408ccefde79c1b79c849011b586910","unresolved":false,"context_lines":[{"line_number":6002,"context_line":"                LOG.debug(\u0027Triggering sync for uuid %s\u0027 % uuid)"},{"line_number":6003,"context_line":"                self._syncs_in_progress[uuid] \u003d True"},{"line_number":6004,"context_line":"                self._sync_power_pool.spawn_n(_sync, db_instance,"},{"line_number":6005,"context_line":"                    self._power_state_cache.get(db_instance.uuid, None))"},{"line_number":6006,"context_line":""},{"line_number":6007,"context_line":"    def _query_driver_power_state_and_sync(self, context, db_instance,"},{"line_number":6008,"context_line":"                                           vm_power_state\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_a954a4fe","line":6005,"in_reply_to":"ba8a016a_736da4cb","updated":"2015-12-28 07:47:44.000000000","message":"Done","commit_id":"27bffa3fba4e402ac29befb4539e37ecfc9e4a1d"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"04baea9af1840d9b3eb3ff61e20befb93afc542b","unresolved":false,"context_lines":[{"line_number":1048,"context_line":"            return"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":"        try_reboot, reboot_type \u003d self._retry_reboot(context, instance)"},{"line_number":1051,"context_line":"        current_power_state \u003d self._get_initial_power_state(context, instance)"},{"line_number":1052,"context_line":""},{"line_number":1053,"context_line":"        if try_reboot:"},{"line_number":1054,"context_line":"            LOG.debug(\"Instance in transitional state (%(task_state)s) at \""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_f7774000","line":1051,"range":{"start_line":1051,"start_character":35,"end_line":1051,"end_character":59},"updated":"2015-12-31 07:05:53.000000000","message":"When I write the original patch, I used to add a check in _get_power_state(), which read the function name from upper frame, in order to automatically build the cache data when it is called by _init_instance(). And we will not need to add your new function _get_inital_power_state(). Why don\u0027t you like that code?","commit_id":"fe913a8ebbf9ee709494800db8e330c558122d12"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"1b943afebef8f230c7892028e178f812b3d2bcb8","unresolved":false,"context_lines":[{"line_number":1048,"context_line":"            return"},{"line_number":1049,"context_line":""},{"line_number":1050,"context_line":"        try_reboot, reboot_type \u003d self._retry_reboot(context, instance)"},{"line_number":1051,"context_line":"        current_power_state \u003d self._get_initial_power_state(context, instance)"},{"line_number":1052,"context_line":""},{"line_number":1053,"context_line":"        if try_reboot:"},{"line_number":1054,"context_line":"            LOG.debug(\"Instance in transitional state (%(task_state)s) at \""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_badd2f16","line":1051,"range":{"start_line":1051,"start_character":35,"end_line":1051,"end_character":59},"in_reply_to":"fa69d971_f7774000","updated":"2015-12-31 07:40:34.000000000","message":"Because _get_power_state() is called by _init_instance() only one single time in one compute service session, but is constantly called by other methods. If I add upper caller checking, the checking will be taken every time it is called, even if the upper caller is not _init_instance(), and this brings some performance deduce.\nSo adding a new function, will leave the _get_power_state() as before, and will not interfere other functions.","commit_id":"fe913a8ebbf9ee709494800db8e330c558122d12"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"04baea9af1840d9b3eb3ff61e20befb93afc542b","unresolved":false,"context_lines":[{"line_number":5998,"context_line":"                        {\u0027num_db_instances\u0027: num_db_instances,"},{"line_number":5999,"context_line":"                         \u0027num_vm_instances\u0027: num_vm_instances})"},{"line_number":6000,"context_line":""},{"line_number":6001,"context_line":"        def _sync(db_instance, vm_power_state\u003dNone):"},{"line_number":6002,"context_line":"            # NOTE(melwitt): This must be synchronized as we query state from"},{"line_number":6003,"context_line":"            #                two separate sources, the driver and the database."},{"line_number":6004,"context_line":"            #                They are set (in stop_instance) and read, in sync."}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_f776603d","line":6001,"range":{"start_line":6001,"start_character":0,"end_line":6001,"end_character":52},"updated":"2015-12-31 07:05:53.000000000","message":"I think we need to input some annotation here to describe your vm_power_state parameter, so that other can easily understand you are attempting to sync state from cache and will not call hypervisor api.","commit_id":"fe913a8ebbf9ee709494800db8e330c558122d12"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"1b943afebef8f230c7892028e178f812b3d2bcb8","unresolved":false,"context_lines":[{"line_number":5998,"context_line":"                        {\u0027num_db_instances\u0027: num_db_instances,"},{"line_number":5999,"context_line":"                         \u0027num_vm_instances\u0027: num_vm_instances})"},{"line_number":6000,"context_line":""},{"line_number":6001,"context_line":"        def _sync(db_instance, vm_power_state\u003dNone):"},{"line_number":6002,"context_line":"            # NOTE(melwitt): This must be synchronized as we query state from"},{"line_number":6003,"context_line":"            #                two separate sources, the driver and the database."},{"line_number":6004,"context_line":"            #                They are set (in stop_instance) and read, in sync."}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_dae263d5","line":6001,"range":{"start_line":6001,"start_character":0,"end_line":6001,"end_character":52},"in_reply_to":"fa69d971_f776603d","updated":"2015-12-31 07:40:34.000000000","message":"Good catch.","commit_id":"fe913a8ebbf9ee709494800db8e330c558122d12"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a2846a6b85bf4076ea02bb890d54fbca9c6f581e","unresolved":false,"context_lines":[{"line_number":1342,"context_line":"        if not self._power_state_cache:"},{"line_number":1343,"context_line":"            self._power_state_cache \u003d self.driver.get_all_power_states()"},{"line_number":1344,"context_line":"        return (self._power_state_cache.get(instance[\u0027uuid\u0027]) or"},{"line_number":1345,"context_line":"                self._get_power_state(context, instance))"},{"line_number":1346,"context_line":""},{"line_number":1347,"context_line":"    def _get_power_state(self, context, instance):"},{"line_number":1348,"context_line":"        \"\"\"Retrieve the power state for the given instance.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"bae84128_30d0c9c8","line":1345,"range":{"start_line":1345,"start_character":16,"end_line":1345,"end_character":56},"updated":"2016-02-24 14:22:03.000000000","message":"Why wouldn\u0027t you set this in the cache?","commit_id":"adbd5e77ac422f7e42abc807f8dada4dca46ac14"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"28f8244d09c9c1136f5b8104041aa3d23eaa3ca2","unresolved":false,"context_lines":[{"line_number":1342,"context_line":"        if not self._power_state_cache:"},{"line_number":1343,"context_line":"            self._power_state_cache \u003d self.driver.get_all_power_states()"},{"line_number":1344,"context_line":"        return (self._power_state_cache.get(instance[\u0027uuid\u0027]) or"},{"line_number":1345,"context_line":"                self._get_power_state(context, instance))"},{"line_number":1346,"context_line":""},{"line_number":1347,"context_line":"    def _get_power_state(self, context, instance):"},{"line_number":1348,"context_line":"        \"\"\"Retrieve the power state for the given instance.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"bae84128_dcd069fa","line":1345,"range":{"start_line":1345,"start_character":16,"end_line":1345,"end_character":56},"in_reply_to":"bae84128_30d0c9c8","updated":"2016-02-25 06:30:13.000000000","message":"There is no need to set it in the cache, because the cache will be refreshed next time of host init or power sync.","commit_id":"adbd5e77ac422f7e42abc807f8dada4dca46ac14"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a2846a6b85bf4076ea02bb890d54fbca9c6f581e","unresolved":false,"context_lines":[{"line_number":6089,"context_line":"            :param vm_power_state: the current power state to be synced, this"},{"line_number":6090,"context_line":"                                   is usually fetched from vm state cache. If"},{"line_number":6091,"context_line":"                                   this value is None, a api call will be made"},{"line_number":6092,"context_line":"                                   to fetch power state from vSphere."},{"line_number":6093,"context_line":"            \"\"\""},{"line_number":6094,"context_line":"            # NOTE(melwitt): This must be synchronized as we query state from"},{"line_number":6095,"context_line":"            #                two separate sources, the driver and the database."}],"source_content_type":"text/x-python","patch_set":11,"id":"bae84128_9048b5b4","line":6092,"range":{"start_line":6092,"start_character":61,"end_line":6092,"end_character":68},"updated":"2016-02-24 14:22:03.000000000","message":"We shouldn\u0027t have virt-specific details in the compute manager.","commit_id":"adbd5e77ac422f7e42abc807f8dada4dca46ac14"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"28f8244d09c9c1136f5b8104041aa3d23eaa3ca2","unresolved":false,"context_lines":[{"line_number":6089,"context_line":"            :param vm_power_state: the current power state to be synced, this"},{"line_number":6090,"context_line":"                                   is usually fetched from vm state cache. If"},{"line_number":6091,"context_line":"                                   this value is None, a api call will be made"},{"line_number":6092,"context_line":"                                   to fetch power state from vSphere."},{"line_number":6093,"context_line":"            \"\"\""},{"line_number":6094,"context_line":"            # NOTE(melwitt): This must be synchronized as we query state from"},{"line_number":6095,"context_line":"            #                two separate sources, the driver and the database."}],"source_content_type":"text/x-python","patch_set":11,"id":"bae84128_dcf7c98a","line":6092,"range":{"start_line":6092,"start_character":61,"end_line":6092,"end_character":68},"in_reply_to":"bae84128_9048b5b4","updated":"2016-02-25 06:30:13.000000000","message":"Yes you are right, will fix it in next patch.","commit_id":"adbd5e77ac422f7e42abc807f8dada4dca46ac14"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a2846a6b85bf4076ea02bb890d54fbca9c6f581e","unresolved":false,"context_lines":[{"line_number":6110,"context_line":"            self._syncs_in_progress.pop(db_instance.uuid)"},{"line_number":6111,"context_line":""},{"line_number":6112,"context_line":"        # Get the power state cache of all the vms."},{"line_number":6113,"context_line":"        self._power_state_cache \u003d self.driver.get_all_power_states()"},{"line_number":6114,"context_line":"        for db_instance in db_instances:"},{"line_number":6115,"context_line":"            # process syncs asynchronously - don\u0027t want instance locking to"},{"line_number":6116,"context_line":"            # block entire periodic task thread"}],"source_content_type":"text/x-python","patch_set":11,"id":"bae84128_d036bd01","line":6113,"range":{"start_line":6113,"start_character":8,"end_line":6113,"end_character":68},"updated":"2016-02-24 14:22:03.000000000","message":"I guess this is where you refresh the cache...","commit_id":"adbd5e77ac422f7e42abc807f8dada4dca46ac14"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"28f8244d09c9c1136f5b8104041aa3d23eaa3ca2","unresolved":false,"context_lines":[{"line_number":6110,"context_line":"            self._syncs_in_progress.pop(db_instance.uuid)"},{"line_number":6111,"context_line":""},{"line_number":6112,"context_line":"        # Get the power state cache of all the vms."},{"line_number":6113,"context_line":"        self._power_state_cache \u003d self.driver.get_all_power_states()"},{"line_number":6114,"context_line":"        for db_instance in db_instances:"},{"line_number":6115,"context_line":"            # process syncs asynchronously - don\u0027t want instance locking to"},{"line_number":6116,"context_line":"            # block entire periodic task thread"}],"source_content_type":"text/x-python","patch_set":11,"id":"bae84128_1c777103","line":6113,"range":{"start_line":6113,"start_character":8,"end_line":6113,"end_character":68},"in_reply_to":"bae84128_d036bd01","updated":"2016-02-25 06:30:13.000000000","message":"Yes, we refresh the cache every time of power sync, so that the power state will not be outdated.","commit_id":"adbd5e77ac422f7e42abc807f8dada4dca46ac14"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a2846a6b85bf4076ea02bb890d54fbca9c6f581e","unresolved":false,"context_lines":[{"line_number":6146,"context_line":"        # No pending tasks. Now try to figure out the real vm_power_state."},{"line_number":6147,"context_line":"        try:"},{"line_number":6148,"context_line":"            if not vm_power_state:"},{"line_number":6149,"context_line":"                vm_instance \u003d self.driver.get_info(db_instance)"},{"line_number":6150,"context_line":"                vm_power_state \u003d vm_instance.state"},{"line_number":6151,"context_line":"        except exception.InstanceNotFound:"},{"line_number":6152,"context_line":"            vm_power_state \u003d power_state.NOSTATE"}],"source_content_type":"text/x-python","patch_set":11,"id":"bae84128_f065c11d","line":6149,"range":{"start_line":6149,"start_character":30,"end_line":6149,"end_character":63},"updated":"2016-02-24 14:22:03.000000000","message":"So for vCenter this actually has to go out and get all of the VMs from the vCenter just to get the one instance record? That seems like a bug in the vCenter API if that\u0027s the case.","commit_id":"adbd5e77ac422f7e42abc807f8dada4dca46ac14"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"28f8244d09c9c1136f5b8104041aa3d23eaa3ca2","unresolved":false,"context_lines":[{"line_number":6146,"context_line":"        # No pending tasks. Now try to figure out the real vm_power_state."},{"line_number":6147,"context_line":"        try:"},{"line_number":6148,"context_line":"            if not vm_power_state:"},{"line_number":6149,"context_line":"                vm_instance \u003d self.driver.get_info(db_instance)"},{"line_number":6150,"context_line":"                vm_power_state \u003d vm_instance.state"},{"line_number":6151,"context_line":"        except exception.InstanceNotFound:"},{"line_number":6152,"context_line":"            vm_power_state \u003d power_state.NOSTATE"}],"source_content_type":"text/x-python","patch_set":11,"id":"bae84128_dcafc929","line":6149,"range":{"start_line":6149,"start_character":30,"end_line":6149,"end_character":63},"in_reply_to":"bae84128_f065c11d","updated":"2016-02-25 06:30:13.000000000","message":"I don\u0027t think it\u0027s a bug. vmware driver could get the info of a single VM.","commit_id":"adbd5e77ac422f7e42abc807f8dada4dca46ac14"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f72b139af6916ff8c8fea497fa0ef5e9a1b7d97c","unresolved":false,"context_lines":[{"line_number":702,"context_line":"        self._resource_tracker_dict \u003d {}"},{"line_number":703,"context_line":"        self.instance_events \u003d InstanceEvents()"},{"line_number":704,"context_line":"        self._sync_power_pool \u003d eventlet.GreenPool()"},{"line_number":705,"context_line":"        self._power_state_cache \u003d None"},{"line_number":706,"context_line":"        self._syncs_in_progress \u003d {}"},{"line_number":707,"context_line":"        self.send_instance_updates \u003d CONF.scheduler_tracks_instance_changes"},{"line_number":708,"context_line":"        if CONF.max_concurrent_builds !\u003d 0:"}],"source_content_type":"text/x-python","patch_set":14,"id":"3afc51ec_99d37e38","line":705,"updated":"2016-03-13 12:31:03.000000000","message":"why do we need the global variable? why not just use a local variable returned from the driver?","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"d0bf7cdd74da62e2e1dc85bf4ab2b0fc1e4a6760","unresolved":false,"context_lines":[{"line_number":702,"context_line":"        self._resource_tracker_dict \u003d {}"},{"line_number":703,"context_line":"        self.instance_events \u003d InstanceEvents()"},{"line_number":704,"context_line":"        self._sync_power_pool \u003d eventlet.GreenPool()"},{"line_number":705,"context_line":"        self._power_state_cache \u003d None"},{"line_number":706,"context_line":"        self._syncs_in_progress \u003d {}"},{"line_number":707,"context_line":"        self.send_instance_updates \u003d CONF.scheduler_tracks_instance_changes"},{"line_number":708,"context_line":"        if CONF.max_concurrent_builds !\u003d 0:"}],"source_content_type":"text/x-python","patch_set":14,"id":"3afc51ec_1ed4621e","line":705,"in_reply_to":"3afc51ec_99d37e38","updated":"2016-03-14 09:50:33.000000000","message":"Because we need it to be global, it is used at L1344, in method _get_initial_power_state.\n _get_initial_power_state is called in more than one places, so we need this variable to be global.\n\nIs this explanation OK for you?","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f72b139af6916ff8c8fea497fa0ef5e9a1b7d97c","unresolved":false,"context_lines":[{"line_number":1343,"context_line":"        \"\"\"Retrieve the initial power state for the given instance.\"\"\""},{"line_number":1344,"context_line":"        if not self._power_state_cache:"},{"line_number":1345,"context_line":"            self._power_state_cache \u003d self.driver.get_all_power_states()"},{"line_number":1346,"context_line":"        return (self._power_state_cache.get(instance[\u0027uuid\u0027]) or"},{"line_number":1347,"context_line":"                self._get_power_state(context, instance))"},{"line_number":1348,"context_line":""},{"line_number":1349,"context_line":"    def _get_power_state(self, context, instance):"}],"source_content_type":"text/x-python","patch_set":14,"id":"3afc51ec_b9e2ba01","line":1346,"updated":"2016-03-13 12:31:03.000000000","message":"instance should be an object. instance.uuid","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"d0bf7cdd74da62e2e1dc85bf4ab2b0fc1e4a6760","unresolved":false,"context_lines":[{"line_number":1343,"context_line":"        \"\"\"Retrieve the initial power state for the given instance.\"\"\""},{"line_number":1344,"context_line":"        if not self._power_state_cache:"},{"line_number":1345,"context_line":"            self._power_state_cache \u003d self.driver.get_all_power_states()"},{"line_number":1346,"context_line":"        return (self._power_state_cache.get(instance[\u0027uuid\u0027]) or"},{"line_number":1347,"context_line":"                self._get_power_state(context, instance))"},{"line_number":1348,"context_line":""},{"line_number":1349,"context_line":"    def _get_power_state(self, context, instance):"}],"source_content_type":"text/x-python","patch_set":14,"id":"3afc51ec_1e890227","line":1346,"in_reply_to":"3afc51ec_b9e2ba01","updated":"2016-03-14 09:50:33.000000000","message":"Will do.","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"},{"author":{"_account_id":16929,"name":"Giridhar Jayavelu","email":"gjayavelu@vmware.com","username":"gjayavelu"},"change_message_id":"626cc035e34e188f6344e449a67999e4f0410a36","unresolved":false,"context_lines":[{"line_number":6177,"context_line":"            return"},{"line_number":6178,"context_line":"        # No pending tasks. Now try to figure out the real vm_power_state."},{"line_number":6179,"context_line":"        try:"},{"line_number":6180,"context_line":"            if not vm_power_state:"},{"line_number":6181,"context_line":"                vm_instance \u003d self.driver.get_info(db_instance)"},{"line_number":6182,"context_line":"                vm_power_state \u003d vm_instance.state"},{"line_number":6183,"context_line":"        except exception.InstanceNotFound:"}],"source_content_type":"text/x-python","patch_set":14,"id":"5aef4532_47f17dcc","line":6180,"updated":"2016-03-10 09:38:16.000000000","message":"can this block be replaced by _get_initial_power_state()?\nthis is anyways a dup of _get_power_state.","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"d0bf7cdd74da62e2e1dc85bf4ab2b0fc1e4a6760","unresolved":false,"context_lines":[{"line_number":6177,"context_line":"            return"},{"line_number":6178,"context_line":"        # No pending tasks. Now try to figure out the real vm_power_state."},{"line_number":6179,"context_line":"        try:"},{"line_number":6180,"context_line":"            if not vm_power_state:"},{"line_number":6181,"context_line":"                vm_instance \u003d self.driver.get_info(db_instance)"},{"line_number":6182,"context_line":"                vm_power_state \u003d vm_instance.state"},{"line_number":6183,"context_line":"        except exception.InstanceNotFound:"}],"source_content_type":"text/x-python","patch_set":14,"id":"3afc51ec_f43a7597","line":6180,"in_reply_to":"5aef4532_47f17dcc","updated":"2016-03-14 09:50:33.000000000","message":"Hi, this block could not be replaced by _get_initial_power_state, but it could be replaced by _get_power_state.\n\nBut I don\u0027t want to do that, and prefer just keep it as it is.","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"},{"author":{"_account_id":16929,"name":"Giridhar Jayavelu","email":"gjayavelu@vmware.com","username":"gjayavelu"},"change_message_id":"d7608f02aa6db36ece2aae67b0b925d4ec04c533","unresolved":false,"context_lines":[{"line_number":6235,"context_line":"        \"\"\"Query the power state of the given instance, and sync it."},{"line_number":6236,"context_line":""},{"line_number":6237,"context_line":"        If a power state cache is given, sync it with the cache; if not,"},{"line_number":6238,"context_line":"        query the power state from vCenter, and sync it."},{"line_number":6239,"context_line":""},{"line_number":6240,"context_line":"        :param context: security context."},{"line_number":6241,"context_line":"        :param db_instance: the instance to be synced."}],"source_content_type":"text/x-python","patch_set":16,"id":"9abb7d3a_410f74e1","line":6238,"updated":"2016-05-27 12:23:38.000000000","message":"s/vcenter/nova-compute/ to be generic.","commit_id":"feddf766f3d2a7c6fd393f7b8b92c19f4ca523e7"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":16929,"name":"Giridhar Jayavelu","email":"gjayavelu@vmware.com","username":"gjayavelu"},"change_message_id":"626cc035e34e188f6344e449a67999e4f0410a36","unresolved":false,"context_lines":[{"line_number":563,"context_line":"            self.compute._init_instance(self.context, instance)"},{"line_number":564,"context_line":"            set_error_state.assert_called_once_with(self.context, instance)"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"    def test__get_initial_power_state(self):"},{"line_number":567,"context_line":"        instance \u003d fake_instance.fake_instance_obj("},{"line_number":568,"context_line":"                self.context,"},{"line_number":569,"context_line":"                uuid\u003d\u0027fake-uuid\u0027,"}],"source_content_type":"text/x-python","patch_set":14,"id":"5aef4532_0745b544","line":566,"updated":"2016-03-10 09:38:16.000000000","message":"change test__ to test_ (single underscore)","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"d0bf7cdd74da62e2e1dc85bf4ab2b0fc1e4a6760","unresolved":false,"context_lines":[{"line_number":563,"context_line":"            self.compute._init_instance(self.context, instance)"},{"line_number":564,"context_line":"            set_error_state.assert_called_once_with(self.context, instance)"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"    def test__get_initial_power_state(self):"},{"line_number":567,"context_line":"        instance \u003d fake_instance.fake_instance_obj("},{"line_number":568,"context_line":"                self.context,"},{"line_number":569,"context_line":"                uuid\u003d\u0027fake-uuid\u0027,"}],"source_content_type":"text/x-python","patch_set":14,"id":"3afc51ec_3487bdd8","line":566,"in_reply_to":"5aef4532_0745b544","updated":"2016-03-14 09:50:33.000000000","message":"Thanks, will do.","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"},{"author":{"_account_id":16929,"name":"Giridhar Jayavelu","email":"gjayavelu@vmware.com","username":"gjayavelu"},"change_message_id":"d7608f02aa6db36ece2aae67b0b925d4ec04c533","unresolved":false,"context_lines":[{"line_number":579,"context_line":"        instance \u003d fake_instance.fake_instance_obj("},{"line_number":580,"context_line":"                self.context,"},{"line_number":581,"context_line":"                uuid\u003d\u0027fake-uuid\u0027,"},{"line_number":582,"context_line":"                power_state\u003dpower_state.RUNNING)"},{"line_number":583,"context_line":"        self.compute._power_state_cache \u003d {}"},{"line_number":584,"context_line":"        with mock.patch.object(self.compute,"},{"line_number":585,"context_line":"                               \u0027_get_power_state\u0027) as mock_get_power_state:"}],"source_content_type":"text/x-python","patch_set":16,"id":"9abb7d3a_01128cb4","line":582,"updated":"2016-05-27 12:23:38.000000000","message":"shouldn\u0027t this be power_state.SHUTDOWN to match with L586? or if this value is not really used, then it can be removed.","commit_id":"feddf766f3d2a7c6fd393f7b8b92c19f4ca523e7"}],"nova/virt/driver.py":[{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"04baea9af1840d9b3eb3ff61e20befb93afc542b","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        \"\"\"Get the power state of all the existing VMs on hypervisor."},{"line_number":201,"context_line":"        Return a dict of power states indexed by instance uuid"},{"line_number":202,"context_line":"        \"\"\""},{"line_number":203,"context_line":"        return {}"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def get_num_instances(self):"},{"line_number":206,"context_line":"        \"\"\"Return the total number of virtual machines."}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_b7bc686d","line":203,"range":{"start_line":203,"start_character":15,"end_line":203,"end_character":17},"updated":"2015-12-31 07:05:53.000000000","message":"Return an empty set is ok. Is it better to use NotImplementedError, so that the code can easily distinguish which hypervisor driver can support this performance enhancement? Just a personal idea. I am also not sure if that is useful in the future.","commit_id":"fe913a8ebbf9ee709494800db8e330c558122d12"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"84e846fce38d94bb12e98ab8c8d8d7811ee1f671","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        \"\"\"Get the power state of all the existing VMs on hypervisor."},{"line_number":201,"context_line":"        Return a dict of power states indexed by instance uuid"},{"line_number":202,"context_line":"        \"\"\""},{"line_number":203,"context_line":"        return {}"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def get_num_instances(self):"},{"line_number":206,"context_line":"        \"\"\"Return the total number of virtual machines."}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_bd0529c3","line":203,"range":{"start_line":203,"start_character":15,"end_line":203,"end_character":17},"in_reply_to":"fa69d971_3a405fa5","updated":"2015-12-31 08:15:04.000000000","message":"We will be able handle NotImplementedError, and continue your procedure. Just consider if we will need to let all drivers implement this method...","commit_id":"fe913a8ebbf9ee709494800db8e330c558122d12"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"167eb32c8c1f80789dbe4b4b6452ac7d9c644926","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        \"\"\"Get the power state of all the existing VMs on hypervisor."},{"line_number":201,"context_line":"        Return a dict of power states indexed by instance uuid"},{"line_number":202,"context_line":"        \"\"\""},{"line_number":203,"context_line":"        return {}"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def get_num_instances(self):"},{"line_number":206,"context_line":"        \"\"\"Return the total number of virtual machines."}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_3a405fa5","line":203,"range":{"start_line":203,"start_character":15,"end_line":203,"end_character":17},"in_reply_to":"fa69d971_b7bc686d","updated":"2015-12-31 07:45:18.000000000","message":"Hi, if it raises NotImplementedError, it will break other hypervisors like KVM, because KVM does not implements this methods.","commit_id":"fe913a8ebbf9ee709494800db8e330c558122d12"},{"author":{"_account_id":16929,"name":"Giridhar Jayavelu","email":"gjayavelu@vmware.com","username":"gjayavelu"},"change_message_id":"626cc035e34e188f6344e449a67999e4f0410a36","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        Return a dict of power states indexed by instance uuid."},{"line_number":172,"context_line":"        \"\"\""},{"line_number":173,"context_line":"        return {}"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def get_num_instances(self):"},{"line_number":176,"context_line":"        \"\"\"Return the total number of virtual machines."}],"source_content_type":"text/x-python","patch_set":14,"id":"5aef4532_c708ed2a","line":173,"updated":"2016-03-10 09:38:16.000000000","message":"you can raise NotImplementedError() and return {} in libvirt, xenapi drivers.","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"d0bf7cdd74da62e2e1dc85bf4ab2b0fc1e4a6760","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        Return a dict of power states indexed by instance uuid."},{"line_number":172,"context_line":"        \"\"\""},{"line_number":173,"context_line":"        return {}"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def get_num_instances(self):"},{"line_number":176,"context_line":"        \"\"\"Return the total number of virtual machines."}],"source_content_type":"text/x-python","patch_set":14,"id":"3afc51ec_7485c5ab","line":173,"in_reply_to":"5aef4532_c708ed2a","updated":"2016-03-14 09:50:33.000000000","message":"I am not sure if other hypervisors need this. \nSo I would prefer not implement this in other drivers.\nI think someone else will do it if this is needed by other hyperviors in the future.","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"}],"nova/virt/vmwareapi/vmops.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"eb0b8ccccac7712fa30225e7a53efabbe40a50bc","unresolved":false,"context_lines":[{"line_number":1450,"context_line":""},{"line_number":1451,"context_line":"    def get_all_power_state(self):"},{"line_number":1452,"context_line":"        \"\"\"Return power state of all the VM instances.\"\"\""},{"line_number":1453,"context_line":"        lst_properties \u003d [\"name\", \"runtime.powerState\"]"},{"line_number":1454,"context_line":"        results \u003d self._session._call_method(vim_util, \"get_objects\","},{"line_number":1455,"context_line":"                                             \"VirtualMachine\", lst_properties)"},{"line_number":1456,"context_line":"        power_states \u003d {}"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_937288ac","line":1453,"updated":"2015-11-22 12:17:23.000000000","message":"This will clash with patch https://review.openstack.org/#/c/166608/\n\nPlease look at _get_valid_vms_from_retrieve_result in the above patch for a better way of getting all of the openstack instances and not relying on the name","commit_id":"27bffa3fba4e402ac29befb4539e37ecfc9e4a1d"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"0a7d169773408ccefde79c1b79c849011b586910","unresolved":false,"context_lines":[{"line_number":1450,"context_line":""},{"line_number":1451,"context_line":"    def get_all_power_state(self):"},{"line_number":1452,"context_line":"        \"\"\"Return power state of all the VM instances.\"\"\""},{"line_number":1453,"context_line":"        lst_properties \u003d [\"name\", \"runtime.powerState\"]"},{"line_number":1454,"context_line":"        results \u003d self._session._call_method(vim_util, \"get_objects\","},{"line_number":1455,"context_line":"                                             \"VirtualMachine\", lst_properties)"},{"line_number":1456,"context_line":"        power_states \u003d {}"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_c93250f2","line":1453,"in_reply_to":"ba8a016a_937288ac","updated":"2015-12-28 07:47:44.000000000","message":"Thank you, garyk.\nDone.","commit_id":"27bffa3fba4e402ac29befb4539e37ecfc9e4a1d"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"703d933aab21f0c4c4096496d5344b2dbf347b4f","unresolved":false,"context_lines":[{"line_number":1460,"context_line":"        power_states \u003d {}"},{"line_number":1461,"context_line":"        while results:"},{"line_number":1462,"context_line":"            for vm in results.objects:"},{"line_number":1463,"context_line":"                for prop in vm.propSet:"},{"line_number":1464,"context_line":"                    if prop.name \u003d \u0027runtime.powerState\u0027:"},{"line_number":1465,"context_line":"                        state \u003d prop.val"},{"line_number":1466,"context_line":"                    if prop.name \u003d \u0027config.extraConfig[\"nvp.vm-uuid\"]\u0027:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_fa4967d1","line":1463,"range":{"start_line":1463,"start_character":25,"end_line":1463,"end_character":27},"updated":"2015-12-31 07:46:09.000000000","message":"You just query 2 properties. Is that necessary to use a \u0027for\u0027 loop to extract their values?","commit_id":"fe913a8ebbf9ee709494800db8e330c558122d12"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"b2f6a6e555c8f29c627ffff94120599028f82f54","unresolved":false,"context_lines":[{"line_number":1460,"context_line":"        power_states \u003d {}"},{"line_number":1461,"context_line":"        while results:"},{"line_number":1462,"context_line":"            for vm in results.objects:"},{"line_number":1463,"context_line":"                for prop in vm.propSet:"},{"line_number":1464,"context_line":"                    if prop.name \u003d \u0027runtime.powerState\u0027:"},{"line_number":1465,"context_line":"                        state \u003d prop.val"},{"line_number":1466,"context_line":"                    if prop.name \u003d \u0027config.extraConfig[\"nvp.vm-uuid\"]\u0027:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_5a52f368","line":1463,"range":{"start_line":1463,"start_character":25,"end_line":1463,"end_character":27},"in_reply_to":"fa69d971_fa4967d1","updated":"2015-12-31 07:49:34.000000000","message":"Good catch, will use direct index in later patch.","commit_id":"fe913a8ebbf9ee709494800db8e330c558122d12"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"81dfe661d382e2156e62b66a9f3bb300b58734f9","unresolved":false,"context_lines":[{"line_number":1461,"context_line":"        while results:"},{"line_number":1462,"context_line":"            for vm in results.objects:"},{"line_number":1463,"context_line":"                for prop in vm.propSet:"},{"line_number":1464,"context_line":"                    if prop.name \u003d \u0027runtime.powerState\u0027:"},{"line_number":1465,"context_line":"                        state \u003d prop.val"},{"line_number":1466,"context_line":"                    if prop.name \u003d \u0027config.extraConfig[\"nvp.vm-uuid\"]\u0027:"},{"line_number":1467,"context_line":"                        uuid \u003d prop.val.value"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_9a2b8b30","line":1464,"range":{"start_line":1464,"start_character":34,"end_line":1464,"end_character":35},"updated":"2015-12-31 07:30:18.000000000","message":"I feel \u003d\u003d should be easily detected by pep8...","commit_id":"fe913a8ebbf9ee709494800db8e330c558122d12"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"167eb32c8c1f80789dbe4b4b6452ac7d9c644926","unresolved":false,"context_lines":[{"line_number":1461,"context_line":"        while results:"},{"line_number":1462,"context_line":"            for vm in results.objects:"},{"line_number":1463,"context_line":"                for prop in vm.propSet:"},{"line_number":1464,"context_line":"                    if prop.name \u003d \u0027runtime.powerState\u0027:"},{"line_number":1465,"context_line":"                        state \u003d prop.val"},{"line_number":1466,"context_line":"                    if prop.name \u003d \u0027config.extraConfig[\"nvp.vm-uuid\"]\u0027:"},{"line_number":1467,"context_line":"                        uuid \u003d prop.val.value"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_ba120fb3","line":1464,"range":{"start_line":1464,"start_character":34,"end_line":1464,"end_character":35},"in_reply_to":"fa69d971_9a2b8b30","updated":"2015-12-31 07:45:18.000000000","message":"Yes, good catch. Thanks.","commit_id":"fe913a8ebbf9ee709494800db8e330c558122d12"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"20abdcf92023714606e6585047066bbe6638d56f","unresolved":false,"context_lines":[{"line_number":1468,"context_line":"                        uuid \u003d prop.val.value"},{"line_number":1469,"context_line":"                    if uuid:"},{"line_number":1470,"context_line":"                        power_states[uuid] \u003d\u003d VMWARE_POWER_STATES[state]"},{"line_number":1471,"context_line":"            if token:"},{"line_number":1472,"context_line":"                results \u003d self._session._call_method(vim_util,"},{"line_number":1473,"context_line":"                              \"continue_to_get_objects\", results)"},{"line_number":1474,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa69d971_dd3c9d95","line":1471,"range":{"start_line":1471,"start_character":15,"end_line":1471,"end_character":20},"updated":"2015-12-31 08:12:10.000000000","message":"I am not quite sure if this \u0027token\u0027 is still required. My original patch is made for Kilo. At that time, the code is copied from vm_util.py. Now I do not see it still exists. Need to look into change history.","commit_id":"24ded69552d66a0602d85cff1a5bd19df0a59cff"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"7d043c9c43b3a93cc8851b220b595ca482291661","unresolved":false,"context_lines":[{"line_number":1468,"context_line":"                        uuid \u003d prop.val.value"},{"line_number":1469,"context_line":"                    if uuid:"},{"line_number":1470,"context_line":"                        power_states[uuid] \u003d\u003d VMWARE_POWER_STATES[state]"},{"line_number":1471,"context_line":"            if token:"},{"line_number":1472,"context_line":"                results \u003d self._session._call_method(vim_util,"},{"line_number":1473,"context_line":"                              \"continue_to_get_objects\", results)"},{"line_number":1474,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa69d971_1dc6b567","line":1471,"range":{"start_line":1471,"start_character":15,"end_line":1471,"end_character":20},"in_reply_to":"fa69d971_dd3c9d95","updated":"2015-12-31 08:23:00.000000000","message":"No, it is not needed any more, will move it.","commit_id":"24ded69552d66a0602d85cff1a5bd19df0a59cff"},{"author":{"_account_id":16929,"name":"Giridhar Jayavelu","email":"gjayavelu@vmware.com","username":"gjayavelu"},"change_message_id":"626cc035e34e188f6344e449a67999e4f0410a36","unresolved":false,"context_lines":[{"line_number":1497,"context_line":"        \"\"\""},{"line_number":1498,"context_line":"        lst_properties \u003d [\u0027runtime.powerState\u0027,"},{"line_number":1499,"context_line":"                          \u0027config.extraConfig[\"nvp.vm-uuid\"]\u0027]"},{"line_number":1500,"context_line":"        results \u003d self._session._call_method(vim_util, \"get_objects\","},{"line_number":1501,"context_line":"                                             \"VirtualMachine\", lst_properties)"},{"line_number":1502,"context_line":"        power_states \u003d {}"},{"line_number":1503,"context_line":"        while results:"}],"source_content_type":"text/x-python","patch_set":14,"id":"5aef4532_c46c6b0a","line":1500,"updated":"2016-03-10 09:38:16.000000000","message":"can you use vutil (oslo_vmware) instead of vim_util?","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"a61d3a601bb9e4a6418a620edde9df909d10f572","unresolved":false,"context_lines":[{"line_number":1497,"context_line":"        \"\"\""},{"line_number":1498,"context_line":"        lst_properties \u003d [\u0027runtime.powerState\u0027,"},{"line_number":1499,"context_line":"                          \u0027config.extraConfig[\"nvp.vm-uuid\"]\u0027]"},{"line_number":1500,"context_line":"        results \u003d self._session._call_method(vim_util, \"get_objects\","},{"line_number":1501,"context_line":"                                             \"VirtualMachine\", lst_properties)"},{"line_number":1502,"context_line":"        power_states \u003d {}"},{"line_number":1503,"context_line":"        while results:"}],"source_content_type":"text/x-python","patch_set":14,"id":"3afc51ec_cf887f25","line":1500,"in_reply_to":"5aef4532_c46c6b0a","updated":"2016-03-14 12:13:29.000000000","message":"No, vm_util is a encapsulation of vutil.\nget_objects in vtuil has so many parameters:\ndef get_objects(vim, type_, max_objects,                   \n                properties_to_collect\u003dNone,\n                all_properties\u003dFalse)\n\nBut in vm_util, get_objects just make us only need to care about 3 parameters:\n\ndef get_objects(vim,\n                type,\n                properties_to_collect\u003dNone,\n                all\u003dFalse).\n\nBy the way, the other places in this .py file all use vim_util when calling \"get_objects\" method.","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"38e8d4018f8d28bbadf35eae7f7dfeb157690e60","unresolved":false,"context_lines":[{"line_number":1502,"context_line":"        power_states \u003d {}"},{"line_number":1503,"context_line":"        while results:"},{"line_number":1504,"context_line":"            for vm in results.objects:"},{"line_number":1505,"context_line":"                if len(vm.propSet) \u003d\u003d 2:"},{"line_number":1506,"context_line":"                    uuid \u003d vm.propSet[0].val.value"},{"line_number":1507,"context_line":"                    state \u003d vm.propSet[1].val"},{"line_number":1508,"context_line":"                    if uuid:"}],"source_content_type":"text/x-python","patch_set":14,"id":"3afc51ec_144d9a72","line":1505,"updated":"2016-03-11 16:06:40.000000000","message":"I am not sure if the assumed ordering of returned properties is guaranteed. IMHO we should check the property name before consuming the value returned. something like\nif vm.propSet[0].name \u003d\u003d \"runtime.powerState\":\n  state \u003d vm.propSet[0].val\n  uuid \u003d vm.propSet[1].val.value\nelse\n  state \u003d vm.propSet[1].val\n  uuid \u003d vm.propSet[0].val.value","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"d0bf7cdd74da62e2e1dc85bf4ab2b0fc1e4a6760","unresolved":false,"context_lines":[{"line_number":1502,"context_line":"        power_states \u003d {}"},{"line_number":1503,"context_line":"        while results:"},{"line_number":1504,"context_line":"            for vm in results.objects:"},{"line_number":1505,"context_line":"                if len(vm.propSet) \u003d\u003d 2:"},{"line_number":1506,"context_line":"                    uuid \u003d vm.propSet[0].val.value"},{"line_number":1507,"context_line":"                    state \u003d vm.propSet[1].val"},{"line_number":1508,"context_line":"                    if uuid:"}],"source_content_type":"text/x-python","patch_set":14,"id":"3afc51ec_5708962d","line":1505,"in_reply_to":"3afc51ec_144d9a72","updated":"2016-03-14 09:50:33.000000000","message":"Yes, this order is guaranteed.\nlst_properties \u003d [\u0027runtime.powerState\u0027,  \u0027config.extraConfig[\"nvp.vm-uuid\"]\u0027]\n\nThe returned propSet are in alphabet order by \"name\".","commit_id":"033d8efb6912455665ac715a48bac74e7f3ded6f"}]}
