)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ebe919f084e85f45c4b4a98e96c0877306671a38","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Prior commits added the RPC methods for sending updated instance"},{"line_number":10,"context_line":"information to the scheduler. This commit adds the logic in the"},{"line_number":11,"context_line":"HostManager class for processing these updates."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Partially-Implements: blueprint isolate-scheduler-db"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9a80dd14_b6559a51","line":11,"updated":"2015-03-07 17:55:13.000000000","message":"Should have a DocImpact if we end up using a new CONF option...","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"374a782af1ce7110c8fd68ca640b1aa28dc4a68c","unresolved":false,"context_lines":[{"line_number":11,"context_line":"Subsequent commits will add the RPC calls."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"DocImpact"},{"line_number":14,"context_line":"Need to document the new CONF option \u0027scheduler_tracks_instance_changes\u0027."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Partially-Implements: blueprint isolate-scheduler-db"},{"line_number":17,"context_line":"(https://blueprints.launchpad.net/nova/+spec/isolate-scheduler-db)"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"9a80dd14_5b14dee8","line":14,"updated":"2015-03-17 21:50:47.000000000","message":"Would be good to include here a very good description for our doc team regarding what this new option does, what it defaults to, and why it is important...\n\nBe Kind. Rewind. (for the doc team)","commit_id":"d5e99601691423b6494d523388a74d2e8c4ce6b2"}],"nova/scheduler/host_manager.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2d64cf566d9d3d5e60f4db190d7d1fbf557f445d","unresolved":false,"context_lines":[{"line_number":461,"context_line":"        the HostManager knows about. Also, each of the consumable resources"},{"line_number":462,"context_line":"        in HostState are pre-populated and adjusted based on data in the db."},{"line_number":463,"context_line":"        \"\"\""},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"        service_refs \u003d {service.host: service"},{"line_number":466,"context_line":"                        for service in objects.ServiceList.get_by_topic("},{"line_number":467,"context_line":"                            context, CONF.compute_topic)}"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_25cde485","side":"PARENT","line":464,"updated":"2015-03-08 00:47:22.000000000","message":"extra line we shouldn\u0027t touch","commit_id":"9ca937e1f8949c4d1765b1bee48cc5392dc831ec"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ebe919f084e85f45c4b4a98e96c0877306671a38","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"from nova.compute import task_states"},{"line_number":30,"context_line":"from nova.compute import vm_states"},{"line_number":31,"context_line":"from nova import context as context_module"},{"line_number":32,"context_line":"from nova import exception"},{"line_number":33,"context_line":"from nova.i18n import _, _LI, _LW"},{"line_number":34,"context_line":"from nova import objects"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_1644a6b5","line":31,"updated":"2015-03-07 17:55:13.000000000","message":"not really necessary as part of this patch, but OK...","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"05017f4117f2daa874414ab8715ba0590382aeed","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"from nova.compute import task_states"},{"line_number":30,"context_line":"from nova.compute import vm_states"},{"line_number":31,"context_line":"from nova import context as context_module"},{"line_number":32,"context_line":"from nova import exception"},{"line_number":33,"context_line":"from nova.i18n import _, _LI, _LW"},{"line_number":34,"context_line":"from nova import objects"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_5fe51407","line":31,"in_reply_to":"9a80dd14_1644a6b5","updated":"2015-03-09 22:56:11.000000000","message":"Yes, it is, as I need to create contexts, as does the recently-added aggregate code. The name \u0027context\u0027 is already used in the existing code for context parameters.","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ebe919f084e85f45c4b4a98e96c0877306671a38","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        # to those aggregates"},{"line_number":320,"context_line":"        self.host_aggregates_map \u003d collections.defaultdict(set)"},{"line_number":321,"context_line":"        self._init_aggregates()"},{"line_number":322,"context_line":"        self.tracks_instance_changes \u003d CONF.scheduler_tracks_instance_changes"},{"line_number":323,"context_line":"        # Dict of instances and status, keyed by host"},{"line_number":324,"context_line":"        self._instance_info \u003d {}"},{"line_number":325,"context_line":"        if self.tracks_instance_changes:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_36be0a66","line":322,"updated":"2015-03-07 17:55:13.000000000","message":"I\u0027m actually really not sold on the need for yet another CONF option for this.\n\nWouldn\u0027t the following work just as well?\n\n self.tracks_instance_changes \u003d any([\n     \u0027ServerGroupAffinityFilter\u0027 in self.default_filters,\n     \u0027ServerGroupAnitAffinityFilter\u0027 in self.default_filters])","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"05017f4117f2daa874414ab8715ba0590382aeed","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        # to those aggregates"},{"line_number":320,"context_line":"        self.host_aggregates_map \u003d collections.defaultdict(set)"},{"line_number":321,"context_line":"        self._init_aggregates()"},{"line_number":322,"context_line":"        self.tracks_instance_changes \u003d CONF.scheduler_tracks_instance_changes"},{"line_number":323,"context_line":"        # Dict of instances and status, keyed by host"},{"line_number":324,"context_line":"        self._instance_info \u003d {}"},{"line_number":325,"context_line":"        if self.tracks_instance_changes:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_dfa744bb","line":322,"in_reply_to":"9a80dd14_36be0a66","updated":"2015-03-09 22:56:11.000000000","message":"No, because some operators may wish to disable this new behavior, as it might run into memory issues with very large deployments. So even if they are using those filters, they can turn off the in-memory tracking of instances in the HostManager, in which case the code will revert to the current DB calls.","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dca366a622584f1911a3202ffe31c9fba964bf99","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        # to those aggregates"},{"line_number":320,"context_line":"        self.host_aggregates_map \u003d collections.defaultdict(set)"},{"line_number":321,"context_line":"        self._init_aggregates()"},{"line_number":322,"context_line":"        self.tracks_instance_changes \u003d CONF.scheduler_tracks_instance_changes"},{"line_number":323,"context_line":"        # Dict of instances and status, keyed by host"},{"line_number":324,"context_line":"        self._instance_info \u003d {}"},{"line_number":325,"context_line":"        if self.tracks_instance_changes:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_20fe09af","line":322,"in_reply_to":"9a80dd14_dfa744bb","updated":"2015-03-12 02:56:31.000000000","message":"What do you mean by \"in which case the code will revert to the current DB calls\"?","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2d64cf566d9d3d5e60f4db190d7d1fbf557f445d","unresolved":false,"context_lines":[{"line_number":370,"context_line":"                                     \"instances\": {},"},{"line_number":371,"context_line":"                                     \"updated\": False,"},{"line_number":372,"context_line":"                                     }"},{"line_number":373,"context_line":"                               for host in hosts}"},{"line_number":374,"context_line":"        for instance in instances.objects:"},{"line_number":375,"context_line":"            inst_dict \u003d self._instance_info[instance.host][\"instances\"]"},{"line_number":376,"context_line":"            inst_dict[instance.uuid] \u003d instance"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_85a3f0b0","line":373,"updated":"2015-03-08 00:47:22.000000000","message":"We needn\u0027t iterate all the instances three times at here and line 374 and line 368. We can merge them into one.","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"05017f4117f2daa874414ab8715ba0590382aeed","unresolved":false,"context_lines":[{"line_number":370,"context_line":"                                     \"instances\": {},"},{"line_number":371,"context_line":"                                     \"updated\": False,"},{"line_number":372,"context_line":"                                     }"},{"line_number":373,"context_line":"                               for host in hosts}"},{"line_number":374,"context_line":"        for instance in instances.objects:"},{"line_number":375,"context_line":"            inst_dict \u003d self._instance_info[instance.host][\"instances\"]"},{"line_number":376,"context_line":"            inst_dict[instance.uuid] \u003d instance"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_1fd47cbb","line":373,"in_reply_to":"9a80dd14_85a3f0b0","updated":"2015-03-09 22:56:11.000000000","message":"Done","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"6ec90c14844396acc4faef2d68de88913b5b1951","unresolved":false,"context_lines":[{"line_number":548,"context_line":"            # Too old"},{"line_number":549,"context_line":"            instances \u003d objects.InstanceList.get_by_host(context, host_name)"},{"line_number":550,"context_line":"            inst_dict \u003d {instance.uuid: instance for instance in instances}"},{"line_number":551,"context_line":"        host_state.instances \u003d inst_dict"},{"line_number":552,"context_line":""},{"line_number":553,"context_line":"    def _recreate_instance_info(self, context, host_name):"},{"line_number":554,"context_line":"        \"\"\"Get the InstanceList for the specified host, and store it in the"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_e5866cda","line":551,"updated":"2015-03-08 01:09:34.000000000","message":"I\u0027m thinking of there may have problem when iterate this dict in filter and add/del item at here concurrently","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"76b333664ebdb0d9bd5b0ede80d3daca3e3a3dcb","unresolved":false,"context_lines":[{"line_number":548,"context_line":"            # Too old"},{"line_number":549,"context_line":"            instances \u003d objects.InstanceList.get_by_host(context, host_name)"},{"line_number":550,"context_line":"            inst_dict \u003d {instance.uuid: instance for instance in instances}"},{"line_number":551,"context_line":"        host_state.instances \u003d inst_dict"},{"line_number":552,"context_line":""},{"line_number":553,"context_line":"    def _recreate_instance_info(self, context, host_name):"},{"line_number":554,"context_line":"        \"\"\"Get the InstanceList for the specified host, and store it in the"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_258884c4","line":551,"in_reply_to":"9a80dd14_e5866cda","updated":"2015-03-08 01:23:21.000000000","message":"I submitted a patch for aggregate https://review.openstack.org/#/c/162438/","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"05017f4117f2daa874414ab8715ba0590382aeed","unresolved":false,"context_lines":[{"line_number":548,"context_line":"            # Too old"},{"line_number":549,"context_line":"            instances \u003d objects.InstanceList.get_by_host(context, host_name)"},{"line_number":550,"context_line":"            inst_dict \u003d {instance.uuid: instance for instance in instances}"},{"line_number":551,"context_line":"        host_state.instances \u003d inst_dict"},{"line_number":552,"context_line":""},{"line_number":553,"context_line":"    def _recreate_instance_info(self, context, host_name):"},{"line_number":554,"context_line":"        \"\"\"Get the InstanceList for the specified host, and store it in the"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_ff6c080a","line":551,"in_reply_to":"9a80dd14_e5866cda","updated":"2015-03-09 22:56:11.000000000","message":"That makes sense, but I\u0027m wondering... the filters use this as a read-only value, so if there is a concurrent change, that is actually making the instance list more accurate. If we make the copy() that you propose, they will guarantee that the list doesn\u0027t change, but that it might also be stale.","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2d64cf566d9d3d5e60f4db190d7d1fbf557f445d","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        inst_dict \u003d {instance.uuid: instance for instance in instances}"},{"line_number":559,"context_line":"        host_info \u003d self._instance_info[host_name] \u003d {}"},{"line_number":560,"context_line":"        host_info[\"instances\"] \u003d inst_dict"},{"line_number":561,"context_line":"        host_info[\"updated\"] \u003d False"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    def update_instance_info(self, context, host_name, instance_info):"},{"line_number":564,"context_line":"        \"\"\"Receives a new instance object from a compute node when an instance"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_c50a4878","line":561,"updated":"2015-03-08 00:47:22.000000000","message":"Set as True? This is trigger by update/sync/delete.","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"05017f4117f2daa874414ab8715ba0590382aeed","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        inst_dict \u003d {instance.uuid: instance for instance in instances}"},{"line_number":559,"context_line":"        host_info \u003d self._instance_info[host_name] \u003d {}"},{"line_number":560,"context_line":"        host_info[\"instances\"] \u003d inst_dict"},{"line_number":561,"context_line":"        host_info[\"updated\"] \u003d False"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    def update_instance_info(self, context, host_name, instance_info):"},{"line_number":564,"context_line":"        \"\"\"Receives a new instance object from a compute node when an instance"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_3f286099","line":561,"in_reply_to":"9a80dd14_c50a4878","updated":"2015-03-09 22:56:11.000000000","message":"We discussed this at the midcycle: we always assume that the compute node is not actively updating until we receive a positive connection from them. This is a method called when something is wrong, so we want at least one good call before we use the data.","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2d64cf566d9d3d5e60f4db190d7d1fbf557f445d","unresolved":false,"context_lines":[{"line_number":585,"context_line":"            inst_dict \u003d host_info.get(\"instances\")"},{"line_number":586,"context_line":"            # Remove the existing Instance object, if any"},{"line_number":587,"context_line":"            inst_dict.pop(instance_info.uuid, None)"},{"line_number":588,"context_line":"            inst_dict[instance_info.uuid] \u003d instance_info"},{"line_number":589,"context_line":"            host_info[\"updated\"] \u003d True"},{"line_number":590,"context_line":"        else:"},{"line_number":591,"context_line":"            LOG.info(_LI(\"Received an update from an unknown host \u0027%s\u0027. \""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_65ed1cb7","line":588,"updated":"2015-03-08 00:47:22.000000000","message":"why need pop it first at previous line? at this line we can overwrite it directly.","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"05017f4117f2daa874414ab8715ba0590382aeed","unresolved":false,"context_lines":[{"line_number":585,"context_line":"            inst_dict \u003d host_info.get(\"instances\")"},{"line_number":586,"context_line":"            # Remove the existing Instance object, if any"},{"line_number":587,"context_line":"            inst_dict.pop(instance_info.uuid, None)"},{"line_number":588,"context_line":"            inst_dict[instance_info.uuid] \u003d instance_info"},{"line_number":589,"context_line":"            host_info[\"updated\"] \u003d True"},{"line_number":590,"context_line":"        else:"},{"line_number":591,"context_line":"            LOG.info(_LI(\"Received an update from an unknown host \u0027%s\u0027. \""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_df1e646f","line":588,"in_reply_to":"9a80dd14_65ed1cb7","updated":"2015-03-09 22:56:11.000000000","message":"Carried over from the old method that was changed in this PS. Done.","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2d64cf566d9d3d5e60f4db190d7d1fbf557f445d","unresolved":false,"context_lines":[{"line_number":589,"context_line":"            host_info[\"updated\"] \u003d True"},{"line_number":590,"context_line":"        else:"},{"line_number":591,"context_line":"            LOG.info(_LI(\"Received an update from an unknown host \u0027%s\u0027. \""},{"line_number":592,"context_line":"                         \"Re-creating its InstanceList.\") % host_name)"},{"line_number":593,"context_line":"            self._recreate_instance_info(context, host_name)"},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"    @utils.synchronized(HOST_INSTANCE_SEMAPHORE)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_253ec428","line":592,"updated":"2015-03-08 00:47:22.000000000","message":"we should use \u0027LOG.info(_LI(......), host_name)\u0027,  use \u0027,\u0027 instead of \u0027%\u0027","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"05017f4117f2daa874414ab8715ba0590382aeed","unresolved":false,"context_lines":[{"line_number":589,"context_line":"            host_info[\"updated\"] \u003d True"},{"line_number":590,"context_line":"        else:"},{"line_number":591,"context_line":"            LOG.info(_LI(\"Received an update from an unknown host \u0027%s\u0027. \""},{"line_number":592,"context_line":"                         \"Re-creating its InstanceList.\") % host_name)"},{"line_number":593,"context_line":"            self._recreate_instance_info(context, host_name)"},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"    @utils.synchronized(HOST_INSTANCE_SEMAPHORE)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_1b11ef51","line":592,"in_reply_to":"9a80dd14_253ec428","updated":"2015-03-09 22:56:11.000000000","message":"Done","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2d64cf566d9d3d5e60f4db190d7d1fbf557f445d","unresolved":false,"context_lines":[{"line_number":610,"context_line":"                         \"Re-creating its InstanceList.\") % host_name)"},{"line_number":611,"context_line":"            self._recreate_instance_info(context, host_name)"},{"line_number":612,"context_line":""},{"line_number":613,"context_line":"    @utils.synchronized(HOST_INSTANCE_SEMAPHORE)"},{"line_number":614,"context_line":"    def sync_instance_info(self, context, host_name, instance_uuids):"},{"line_number":615,"context_line":"        \"\"\"Receives the uuids of the instances on a host."},{"line_number":616,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_e50f4c86","line":613,"updated":"2015-03-08 00:47:22.000000000","message":"emm...not sure we need this. we are safe to update dict concurrently, right?","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"05017f4117f2daa874414ab8715ba0590382aeed","unresolved":false,"context_lines":[{"line_number":610,"context_line":"                         \"Re-creating its InstanceList.\") % host_name)"},{"line_number":611,"context_line":"            self._recreate_instance_info(context, host_name)"},{"line_number":612,"context_line":""},{"line_number":613,"context_line":"    @utils.synchronized(HOST_INSTANCE_SEMAPHORE)"},{"line_number":614,"context_line":"    def sync_instance_info(self, context, host_name, instance_uuids):"},{"line_number":615,"context_line":"        \"\"\"Receives the uuids of the instances on a host."},{"line_number":616,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a80dd14_db7037a6","line":613,"in_reply_to":"9a80dd14_e50f4c86","updated":"2015-03-09 22:56:11.000000000","message":"No, because a new instance could be created just after the sync call is made, and if the two calls arrive at the same time, the update could happen before the uuids are compared, and we\u0027ll get a false negative.","commit_id":"6c2498ba10189df0aa55b77446d62478e4620ae0"},{"author":{"_account_id":8412,"name":"Mike Durnosvistov","email":"glacierr.dev@gmail.com","username":"mdurnosvistov"},"change_message_id":"6e88b6b50404ed2ab103ea08e19e9776d0a07feb","unresolved":false,"context_lines":[{"line_number":460,"context_line":"        the HostManager knows about. Also, each of the consumable resources"},{"line_number":461,"context_line":"        in HostState are pre-populated and adjusted based on data in the db."},{"line_number":462,"context_line":"        \"\"\""},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        service_refs \u003d {service.host: service"},{"line_number":465,"context_line":"                        for service in objects.ServiceList.get_by_binary("},{"line_number":466,"context_line":"                            context, \u0027nova-compute\u0027)}"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_20af172d","side":"PARENT","line":463,"updated":"2015-03-11 10:35:07.000000000","message":"Unrelated changes. Please remove it in next spin.","commit_id":"984ac26411fb71fcf33b1a3b66186ad6f710d3b4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"6336e1324189e8808b6c4debfee497d598a22a53","unresolved":false,"context_lines":[{"line_number":460,"context_line":"        the HostManager knows about. Also, each of the consumable resources"},{"line_number":461,"context_line":"        in HostState are pre-populated and adjusted based on data in the db."},{"line_number":462,"context_line":"        \"\"\""},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        service_refs \u003d {service.host: service"},{"line_number":465,"context_line":"                        for service in objects.ServiceList.get_by_binary("},{"line_number":466,"context_line":"                            context, \u0027nova-compute\u0027)}"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_c7762c3f","side":"PARENT","line":463,"in_reply_to":"9a80dd14_20af172d","updated":"2015-03-11 22:40:57.000000000","message":"Done","commit_id":"984ac26411fb71fcf33b1a3b66186ad6f710d3b4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"163cd46e883d30eaa54edc078cc7c47c873269ef","unresolved":false,"context_lines":[{"line_number":65,"context_line":"               default\u003dTrue,"},{"line_number":66,"context_line":"               help\u003d\u0027Determines if the Scheduler tracks changes to instances \u0027"},{"line_number":67,"context_line":"                    \u0027to help with its filtering decisions.\u0027),"},{"line_number":68,"context_line":"]"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"CONF \u003d cfg.CONF"},{"line_number":71,"context_line":"CONF.register_opts(host_manager_opts)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_116659ed","line":68,"updated":"2015-03-13 17:52:38.000000000","message":"I don\u0027t remember that we agreed during the spec review on having a flag for maintaining old behaviour ?","commit_id":"c400835bb710dfa1b5066cdde749534f97da1aee"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a9c52b5f41831de4224133d23041b11a0ad1ebeb","unresolved":false,"context_lines":[{"line_number":65,"context_line":"               default\u003dTrue,"},{"line_number":66,"context_line":"               help\u003d\u0027Determines if the Scheduler tracks changes to instances \u0027"},{"line_number":67,"context_line":"                    \u0027to help with its filtering decisions.\u0027),"},{"line_number":68,"context_line":"]"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"CONF \u003d cfg.CONF"},{"line_number":71,"context_line":"CONF.register_opts(host_manager_opts)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a80dd14_25e792ad","line":68,"updated":"2015-03-13 21:46:04.000000000","message":"I don\u0027t remember that we agreed during the spec review on having a flag for maintaining old behaviour ?","commit_id":"14d40295b4794c52d1e589f9301253e8e711e467"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0333ced8961f1fd2d54e6e7a8ebebbd93db2747f","unresolved":false,"context_lines":[{"line_number":370,"context_line":"            if host not in self._instance_info:"},{"line_number":371,"context_line":"                self._instance_info[host] \u003d {\"instances\": {}, \"updated\": False}"},{"line_number":372,"context_line":"            inst_dict \u003d self._instance_info[host]"},{"line_number":373,"context_line":"            inst_dict[\"instances\"][instance.uuid] \u003d instance"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"    def _choose_host_filters(self, filter_cls_names):"},{"line_number":376,"context_line":"        \"\"\"Since the caller may specify which filters to use we need"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_99cb10a3","line":373,"updated":"2015-03-16 15:19:09.000000000","message":"For a large cloud (especially a non-cells-ed one, this is a ton of data to pull in a single request at startup, right? I mean, it wouldn\u0027t surprise me if people deployed kilo and suddenly found their scheduler OOMing on startup because of this with the same set of resources that worked in Juno.\n\nMemory aside, isn\u0027t this potentially going to make what should be a quick scheduler restart take a really long time?\n\nSeems like we need to be able to break this up somehow. Maybe some DB person could step in here, but it seems to me like it might make more sense to query by compute node in a loop that completes asynchronously. So, we start up the scheduler and it immediately has no resources, but spawns a thread to do it and resources start filling in as it marches through the compute nodes.","commit_id":"1c73aea861e12dd3f05c1f7dd2b5cd8577f5007d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"411600dbf3c15b17694602684c01cb71f54ed567","unresolved":false,"context_lines":[{"line_number":370,"context_line":"            if host not in self._instance_info:"},{"line_number":371,"context_line":"                self._instance_info[host] \u003d {\"instances\": {}, \"updated\": False}"},{"line_number":372,"context_line":"            inst_dict \u003d self._instance_info[host]"},{"line_number":373,"context_line":"            inst_dict[\"instances\"][instance.uuid] \u003d instance"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"    def _choose_host_filters(self, filter_cls_names):"},{"line_number":376,"context_line":"        \"\"\"Since the caller may specify which filters to use we need"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_b00d3e38","line":373,"in_reply_to":"9a80dd14_99cb10a3","updated":"2015-03-16 17:46:41.000000000","message":"Re-working this to run async.","commit_id":"1c73aea861e12dd3f05c1f7dd2b5cd8577f5007d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0333ced8961f1fd2d54e6e7a8ebebbd93db2747f","unresolved":false,"context_lines":[{"line_number":539,"context_line":"        \"\"\""},{"line_number":540,"context_line":"        host_name \u003d compute.host"},{"line_number":541,"context_line":"        host_info \u003d self._instance_info.get(host_name)"},{"line_number":542,"context_line":"        if host_info and host_info.get(\"updated\"):"},{"line_number":543,"context_line":"            inst_dict \u003d host_info[\"instances\"]"},{"line_number":544,"context_line":"        else:"},{"line_number":545,"context_line":"            # Too old"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_9613df63","line":542,"updated":"2015-03-16 15:19:09.000000000","message":"We only set updated\u003dTrue if we\u0027re update via RPC right? So if that is disabled, or not happening because of how old the compute nodes are, we will *always* re-query the full list by hostname when we run this method, right? I\u0027m not sure where all get_all_host_states() is called from, but that seems maybe a little too heavy?","commit_id":"1c73aea861e12dd3f05c1f7dd2b5cd8577f5007d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"411600dbf3c15b17694602684c01cb71f54ed567","unresolved":false,"context_lines":[{"line_number":539,"context_line":"        \"\"\""},{"line_number":540,"context_line":"        host_name \u003d compute.host"},{"line_number":541,"context_line":"        host_info \u003d self._instance_info.get(host_name)"},{"line_number":542,"context_line":"        if host_info and host_info.get(\"updated\"):"},{"line_number":543,"context_line":"            inst_dict \u003d host_info[\"instances\"]"},{"line_number":544,"context_line":"        else:"},{"line_number":545,"context_line":"            # Too old"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_b0629ed7","line":542,"in_reply_to":"9a80dd14_9613df63","updated":"2015-03-16 17:46:41.000000000","message":"That\u0027s actually what is done currently, only it\u0027s running in each filter that uses instance criteria, and running for each host for each scheduling request. So this is similar to the current behavior, and perhaps a bit more efficient.","commit_id":"1c73aea861e12dd3f05c1f7dd2b5cd8577f5007d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0333ced8961f1fd2d54e6e7a8ebebbd93db2747f","unresolved":false,"context_lines":[{"line_number":575,"context_line":"        else:"},{"line_number":576,"context_line":"            LOG.info(_LI(\"Received an update from an unknown host \u0027%s\u0027. \""},{"line_number":577,"context_line":"                         \"Re-creating its InstanceList.\"), host_name)"},{"line_number":578,"context_line":"            self._recreate_instance_info(context, host_name)"},{"line_number":579,"context_line":""},{"line_number":580,"context_line":"    @utils.synchronized(HOST_INSTANCE_SEMAPHORE)"},{"line_number":581,"context_line":"    def delete_instance_info(self, context, host_name, instance_uuid):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_96e91f81","line":578,"updated":"2015-03-16 15:19:09.000000000","message":"Is it safe to say that if len(instance_info) is more than one, that it\u0027s the at-startup sync and thus we can skip hitting the DB *again* to look up the full list, since it was passed to us in this call?\n\nFurther, if we get a single-shot instance update from a host we don\u0027t know about, that\u0027d be really strange, since we missed the at-startup sync, so maybe we should just log the abnormality and move on?","commit_id":"1c73aea861e12dd3f05c1f7dd2b5cd8577f5007d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"411600dbf3c15b17694602684c01cb71f54ed567","unresolved":false,"context_lines":[{"line_number":575,"context_line":"        else:"},{"line_number":576,"context_line":"            LOG.info(_LI(\"Received an update from an unknown host \u0027%s\u0027. \""},{"line_number":577,"context_line":"                         \"Re-creating its InstanceList.\"), host_name)"},{"line_number":578,"context_line":"            self._recreate_instance_info(context, host_name)"},{"line_number":579,"context_line":""},{"line_number":580,"context_line":"    @utils.synchronized(HOST_INSTANCE_SEMAPHORE)"},{"line_number":581,"context_line":"    def delete_instance_info(self, context, host_name, instance_uuid):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_8dc74546","line":578,"in_reply_to":"9a80dd14_96e91f81","updated":"2015-03-16 17:46:41.000000000","message":"Yes, that makes sense, since this could also be coming from a compute node\u0027s init_host() when it starts up. If the compute node only has one instance we\u0027ll still end up making the second DB call, but that\u0027s a good trade-off.","commit_id":"1c73aea861e12dd3f05c1f7dd2b5cd8577f5007d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0333ced8961f1fd2d54e6e7a8ebebbd93db2747f","unresolved":false,"context_lines":[{"line_number":593,"context_line":"        else:"},{"line_number":594,"context_line":"            LOG.info(_LI(\"Received a delete update from an unknown host \u0027%s\u0027. \""},{"line_number":595,"context_line":"                         \"Re-creating its InstanceList.\"), host_name)"},{"line_number":596,"context_line":"            self._recreate_instance_info(context, host_name)"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":"    @utils.synchronized(HOST_INSTANCE_SEMAPHORE)"},{"line_number":599,"context_line":"    def sync_instance_info(self, context, host_name, instance_uuids):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_569a4714","line":596,"updated":"2015-03-16 15:19:09.000000000","message":"Same here.","commit_id":"1c73aea861e12dd3f05c1f7dd2b5cd8577f5007d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"411600dbf3c15b17694602684c01cb71f54ed567","unresolved":false,"context_lines":[{"line_number":593,"context_line":"        else:"},{"line_number":594,"context_line":"            LOG.info(_LI(\"Received a delete update from an unknown host \u0027%s\u0027. \""},{"line_number":595,"context_line":"                         \"Re-creating its InstanceList.\"), host_name)"},{"line_number":596,"context_line":"            self._recreate_instance_info(context, host_name)"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":"    @utils.synchronized(HOST_INSTANCE_SEMAPHORE)"},{"line_number":599,"context_line":"    def sync_instance_info(self, context, host_name, instance_uuids):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_cd55bd1f","line":596,"in_reply_to":"9a80dd14_569a4714","updated":"2015-03-16 17:46:41.000000000","message":"I don\u0027t see how this is the same. We\u0027re getting a single UUID from a host we don\u0027t know about. There isn\u0027t anything useful for creating the _instance_info.","commit_id":"1c73aea861e12dd3f05c1f7dd2b5cd8577f5007d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0333ced8961f1fd2d54e6e7a8ebebbd93db2747f","unresolved":false,"context_lines":[{"line_number":619,"context_line":"        else:"},{"line_number":620,"context_line":"            LOG.info(_LI(\"Received a sync request from an unknown host \u0027%s\u0027. \""},{"line_number":621,"context_line":"                         \"Re-creating its InstanceList.\"), host_name)"},{"line_number":622,"context_line":"            self._recreate_instance_info(context, host_name)"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_566887f4","line":622,"updated":"2015-03-16 15:19:09.000000000","message":"Kinda the same question here i think.","commit_id":"1c73aea861e12dd3f05c1f7dd2b5cd8577f5007d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"411600dbf3c15b17694602684c01cb71f54ed567","unresolved":false,"context_lines":[{"line_number":619,"context_line":"        else:"},{"line_number":620,"context_line":"            LOG.info(_LI(\"Received a sync request from an unknown host \u0027%s\u0027. \""},{"line_number":621,"context_line":"                         \"Re-creating its InstanceList.\"), host_name)"},{"line_number":622,"context_line":"            self._recreate_instance_info(context, host_name)"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_ad06c91f","line":622,"in_reply_to":"9a80dd14_566887f4","updated":"2015-03-16 17:46:41.000000000","message":"Again, this is a list of UUIDs, not instances. We need more than just UUIDs.","commit_id":"1c73aea861e12dd3f05c1f7dd2b5cd8577f5007d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0f922ef94429efeef89f0b1b8c03cc9c66d72f3d","unresolved":false,"context_lines":[{"line_number":394,"context_line":"                                                     \"updated\": False}"},{"line_number":395,"context_line":"                    inst_dict \u003d self._instance_info[host]"},{"line_number":396,"context_line":"                    inst_dict[\"instances\"][instance.uuid] \u003d instance"},{"line_number":397,"context_line":"                greenthread.sleep(0)"},{"line_number":398,"context_line":""},{"line_number":399,"context_line":"        # Run this async so that we don\u0027t block the scheduler start-up"},{"line_number":400,"context_line":"        utils.spawn_n(_async_init_instance_info)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_bc90b597","line":397,"updated":"2015-03-16 19:14:07.000000000","message":"Just use time.sleep() here. It\u0027s monkeypatched and more recognizable I think. Also, probably worth a comment about why it\u0027s there so that nobody removes it, thinking it\u0027s dead code.","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":394,"context_line":"                                                     \"updated\": False}"},{"line_number":395,"context_line":"                    inst_dict \u003d self._instance_info[host]"},{"line_number":396,"context_line":"                    inst_dict[\"instances\"][instance.uuid] \u003d instance"},{"line_number":397,"context_line":"                greenthread.sleep(0)"},{"line_number":398,"context_line":""},{"line_number":399,"context_line":"        # Run this async so that we don\u0027t block the scheduler start-up"},{"line_number":400,"context_line":"        utils.spawn_n(_async_init_instance_info)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_86a8ffdc","line":397,"in_reply_to":"9a80dd14_bc90b597","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":609,"context_line":"                host_info[\"updated\"] \u003d True"},{"line_number":610,"context_line":"            else:"},{"line_number":611,"context_line":"                LOG.info(_LI(\"Received an update from an unknown host \u0027%s\u0027. \""},{"line_number":612,"context_line":"                             \"Re-creating its InstanceList.\"), host_name)"},{"line_number":613,"context_line":"                self._recreate_instance_info(context, host_name)"},{"line_number":614,"context_line":""},{"line_number":615,"context_line":"    @utils.synchronized(HOST_INSTANCE_SEMAPHORE)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_10f7e55a","line":612,"updated":"2015-03-16 20:02:23.000000000","message":"INFO level log messages should really be for successful completion of units of work. Here and below, I\u0027d advise moving these to *below* the call to _recreate_instance_info() and changing the text to \"Recreated the InstanceList.\"","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":609,"context_line":"                host_info[\"updated\"] \u003d True"},{"line_number":610,"context_line":"            else:"},{"line_number":611,"context_line":"                LOG.info(_LI(\"Received an update from an unknown host \u0027%s\u0027. \""},{"line_number":612,"context_line":"                             \"Re-creating its InstanceList.\"), host_name)"},{"line_number":613,"context_line":"                self._recreate_instance_info(context, host_name)"},{"line_number":614,"context_line":""},{"line_number":615,"context_line":"    @utils.synchronized(HOST_INSTANCE_SEMAPHORE)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_e6b61b3e","line":612,"in_reply_to":"9a80dd14_10f7e55a","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":649,"context_line":"                self._recreate_instance_info(context, host_name)"},{"line_number":650,"context_line":"                return"},{"line_number":651,"context_line":"            host_info[\"updated\"] \u003d True"},{"line_number":652,"context_line":"            LOG.debug(\"Successfully synced instances from host \u0027%s\u0027.\","},{"line_number":653,"context_line":"                      host_name)"},{"line_number":654,"context_line":"        else:"},{"line_number":655,"context_line":"            LOG.info(_LI(\"Received a sync request from an unknown host \u0027%s\u0027. \""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_9001156d","line":652,"updated":"2015-03-16 20:02:23.000000000","message":"Should be an INFO level log message. And don\u0027t forget the _LI() :)","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":649,"context_line":"                self._recreate_instance_info(context, host_name)"},{"line_number":650,"context_line":"                return"},{"line_number":651,"context_line":"            host_info[\"updated\"] \u003d True"},{"line_number":652,"context_line":"            LOG.debug(\"Successfully synced instances from host \u0027%s\u0027.\","},{"line_number":653,"context_line":"                      host_name)"},{"line_number":654,"context_line":"        else:"},{"line_number":655,"context_line":"            LOG.info(_LI(\"Received a sync request from an unknown host \u0027%s\u0027. \""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_06b40f34","line":652,"in_reply_to":"9a80dd14_9001156d","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"f7424f4e92b6e434f5c389d82346cb88f2d0081e","unresolved":false,"context_lines":[{"line_number":375,"context_line":""},{"line_number":376,"context_line":"        def _async_init_instance_info():"},{"line_number":377,"context_line":"            context \u003d context_module.get_admin_context()"},{"line_number":378,"context_line":"            LOG.debug(\"START:_async_init_instance_info\")"},{"line_number":379,"context_line":"            self._instance_info \u003d {}"},{"line_number":380,"context_line":"            compute_nodes \u003d objects.ComputeNodeList.get_all(context).objects"},{"line_number":381,"context_line":"            LOG.debug(\"Total number of compute nodes: %s\", len(compute_nodes))"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a80dd14_48498031","line":378,"updated":"2015-03-17 18:03:00.000000000","message":"I don\u0027t think it\u0027s necessary. Probably a miss before uploading ?","commit_id":"d5e99601691423b6494d523388a74d2e8c4ce6b2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c1cdba0e3443e99dc62004423660763e2fc2ef33","unresolved":false,"context_lines":[{"line_number":375,"context_line":""},{"line_number":376,"context_line":"        def _async_init_instance_info():"},{"line_number":377,"context_line":"            context \u003d context_module.get_admin_context()"},{"line_number":378,"context_line":"            LOG.debug(\"START:_async_init_instance_info\")"},{"line_number":379,"context_line":"            self._instance_info \u003d {}"},{"line_number":380,"context_line":"            compute_nodes \u003d objects.ComputeNodeList.get_all(context).objects"},{"line_number":381,"context_line":"            LOG.debug(\"Total number of compute nodes: %s\", len(compute_nodes))"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a80dd14_6f39e9a2","line":378,"in_reply_to":"9a80dd14_48498031","updated":"2015-03-17 18:28:15.000000000","message":"I asked for it. Since it\u0027s async and could take a long time, I think it\u0027s good to be very verbose (at debug level) about what is going on.","commit_id":"d5e99601691423b6494d523388a74d2e8c4ce6b2"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"f7424f4e92b6e434f5c389d82346cb88f2d0081e","unresolved":false,"context_lines":[{"line_number":403,"context_line":"                    inst_dict \u003d self._instance_info[host]"},{"line_number":404,"context_line":"                    inst_dict[\"instances\"][instance.uuid] \u003d instance"},{"line_number":405,"context_line":"                # Call sleep() to cooperatively yield"},{"line_number":406,"context_line":"                time.sleep(0)"},{"line_number":407,"context_line":"            LOG.debug(\"END:_async_init_instance_info\")"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"        # Run this async so that we don\u0027t block the scheduler start-up"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a80dd14_88745837","line":406,"updated":"2015-03-17 18:03:00.000000000","message":"why not yielding the result using a Generator ?","commit_id":"d5e99601691423b6494d523388a74d2e8c4ce6b2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c1cdba0e3443e99dc62004423660763e2fc2ef33","unresolved":false,"context_lines":[{"line_number":403,"context_line":"                    inst_dict \u003d self._instance_info[host]"},{"line_number":404,"context_line":"                    inst_dict[\"instances\"][instance.uuid] \u003d instance"},{"line_number":405,"context_line":"                # Call sleep() to cooperatively yield"},{"line_number":406,"context_line":"                time.sleep(0)"},{"line_number":407,"context_line":"            LOG.debug(\"END:_async_init_instance_info\")"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"        # Run this async so that we don\u0027t block the scheduler start-up"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a80dd14_ef6b1984","line":406,"in_reply_to":"9a80dd14_88745837","updated":"2015-03-17 18:28:15.000000000","message":"We don\u0027t need to, we\u0027re updating persistent state, which the scheduler will see as soon as we add it. The sleep is just to avoid doing this in a tight loop and starving other greenthreads.","commit_id":"d5e99601691423b6494d523388a74d2e8c4ce6b2"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"f7424f4e92b6e434f5c389d82346cb88f2d0081e","unresolved":false,"context_lines":[{"line_number":582,"context_line":"            # Host is running old version, or updates aren\u0027t flowing."},{"line_number":583,"context_line":"            inst_list \u003d objects.InstanceList.get_by_host(context, host_name)"},{"line_number":584,"context_line":"            inst_dict \u003d {instance.uuid: instance"},{"line_number":585,"context_line":"                         for instance in inst_list.objects}"},{"line_number":586,"context_line":"        host_state.instances \u003d inst_dict"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"    def _recreate_instance_info(self, context, host_name):"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a80dd14_086ce807","line":585,"updated":"2015-03-17 18:03:00.000000000","message":"I know that\u0027s in the spec, but why the logic couldn\u0027t be in the filter, ie. if it\u0027s not updated, then do the InstanceList.get_by_host() call ?","commit_id":"d5e99601691423b6494d523388a74d2e8c4ce6b2"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"a729946ff976f8346659faf65a301f00efb676a4","unresolved":false,"context_lines":[{"line_number":582,"context_line":"            # Host is running old version, or updates aren\u0027t flowing."},{"line_number":583,"context_line":"            inst_list \u003d objects.InstanceList.get_by_host(context, host_name)"},{"line_number":584,"context_line":"            inst_dict \u003d {instance.uuid: instance"},{"line_number":585,"context_line":"                         for instance in inst_list.objects}"},{"line_number":586,"context_line":"        host_state.instances \u003d inst_dict"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"    def _recreate_instance_info(self, context, host_name):"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a80dd14_af14c14d","line":585,"in_reply_to":"9a80dd14_086ce807","updated":"2015-03-17 18:39:22.000000000","message":"The filters should be getting all the information they need to make their decisions from host_state. That is the goal of this series. In the future the data for this will live in a Scheduler-owned DB, but until then we will be in a transition phase, where the scheduler keeps this info in memory. Since the update to compute nodes may not happen at once, this logic needs to be here until the scheduler owns the data.","commit_id":"d5e99601691423b6494d523388a74d2e8c4ce6b2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c1cdba0e3443e99dc62004423660763e2fc2ef33","unresolved":false,"context_lines":[{"line_number":582,"context_line":"            # Host is running old version, or updates aren\u0027t flowing."},{"line_number":583,"context_line":"            inst_list \u003d objects.InstanceList.get_by_host(context, host_name)"},{"line_number":584,"context_line":"            inst_dict \u003d {instance.uuid: instance"},{"line_number":585,"context_line":"                         for instance in inst_list.objects}"},{"line_number":586,"context_line":"        host_state.instances \u003d inst_dict"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"    def _recreate_instance_info(self, context, host_name):"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a80dd14_af284134","line":585,"in_reply_to":"9a80dd14_086ce807","updated":"2015-03-17 18:28:15.000000000","message":"The point of this I think is to avoid doing it in the filter long-term, once all the hosts are reporting this themselves, right?","commit_id":"d5e99601691423b6494d523388a74d2e8c4ce6b2"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"374a782af1ce7110c8fd68ca640b1aa28dc4a68c","unresolved":false,"context_lines":[{"line_number":582,"context_line":"            # Host is running old version, or updates aren\u0027t flowing."},{"line_number":583,"context_line":"            inst_list \u003d objects.InstanceList.get_by_host(context, host_name)"},{"line_number":584,"context_line":"            inst_dict \u003d {instance.uuid: instance"},{"line_number":585,"context_line":"                         for instance in inst_list.objects}"},{"line_number":586,"context_line":"        host_state.instances \u003d inst_dict"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"    def _recreate_instance_info(self, context, host_name):"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a80dd14_7bc60218","line":585,"in_reply_to":"9a80dd14_af14c14d","updated":"2015-03-17 21:50:47.000000000","message":"Agreed with Ed and Dan on this one. The filters should be dumb... just get passed data and either pass or fail some host based on conditions.","commit_id":"d5e99601691423b6494d523388a74d2e8c4ce6b2"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"f7424f4e92b6e434f5c389d82346cb88f2d0081e","unresolved":false,"context_lines":[{"line_number":637,"context_line":"            inst_dict.pop(instance_uuid, None)"},{"line_number":638,"context_line":"            host_info[\"updated\"] \u003d True"},{"line_number":639,"context_line":"        else:"},{"line_number":640,"context_line":"            self._recreate_instance_info(context, host_name)"},{"line_number":641,"context_line":"            LOG.info(_LI(\"Received a delete update from an unknown host \u0027%s\u0027. \""},{"line_number":642,"context_line":"                         \"Re-created its InstanceList.\"), host_name)"},{"line_number":643,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a80dd14_0843086d","line":640,"updated":"2015-03-17 18:03:00.000000000","message":"same comment as above, I don\u0027t think we need to repopulate HostState if that\u0027s incorrect unless it\u0027s within sync_instance_info()","commit_id":"d5e99601691423b6494d523388a74d2e8c4ce6b2"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"a729946ff976f8346659faf65a301f00efb676a4","unresolved":false,"context_lines":[{"line_number":637,"context_line":"            inst_dict.pop(instance_uuid, None)"},{"line_number":638,"context_line":"            host_info[\"updated\"] \u003d True"},{"line_number":639,"context_line":"        else:"},{"line_number":640,"context_line":"            self._recreate_instance_info(context, host_name)"},{"line_number":641,"context_line":"            LOG.info(_LI(\"Received a delete update from an unknown host \u0027%s\u0027. \""},{"line_number":642,"context_line":"                         \"Re-created its InstanceList.\"), host_name)"},{"line_number":643,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a80dd14_0fe4edaa","line":640,"in_reply_to":"9a80dd14_0843086d","updated":"2015-03-17 18:39:22.000000000","message":"The situation here is that we got a message from a host that one of its instances has been deleted, yet we have no information that that host even exists. Why wait for the sync call? Things are wrong; fix them. When the next sync happens, it will match up.","commit_id":"d5e99601691423b6494d523388a74d2e8c4ce6b2"}],"nova/tests/unit/scheduler/test_filter_scheduler.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"070da30a20039b78f07d810997f0cc9977601442","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        self.assertEqual(len(hosts), 1)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_all\u0027,"},{"line_number":186,"context_line":"                return_value\u003dobjects.instance.InstanceList())"},{"line_number":187,"context_line":"    @mock.patch(\u0027nova.objects.ServiceList.get_by_binary\u0027,"},{"line_number":188,"context_line":"                return_value\u003dfakes.SERVICES)"},{"line_number":189,"context_line":"    @mock.patch(\u0027nova.objects.ComputeNodeList.get_all\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_4ee11029","line":186,"updated":"2015-03-13 17:35:23.000000000","message":"I don\u0027t see why it\u0027s necessary as the TestCase is inheriting from the test_scheduler global TestCase which also mocks that.","commit_id":"c400835bb710dfa1b5066cdde749534f97da1aee"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    @mock.patch(\u0027nova.objects.ServiceList.get_by_binary\u0027,"},{"line_number":41,"context_line":"                return_value\u003dfakes.SERVICES)"},{"line_number":42,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_by_host\u0027,"},{"line_number":43,"context_line":"                )"},{"line_number":44,"context_line":"    @mock.patch(\u0027nova.objects.ComputeNodeList.get_all\u0027,"},{"line_number":45,"context_line":"                return_value\u003dfakes.COMPUTE_NODES)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_f09091ef","line":42,"updated":"2015-03-16 20:02:23.000000000","message":"Would you mind removing the unnecessary comma and newline here?","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    @mock.patch(\u0027nova.objects.ServiceList.get_by_binary\u0027,"},{"line_number":41,"context_line":"                return_value\u003dfakes.SERVICES)"},{"line_number":42,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_by_host\u0027,"},{"line_number":43,"context_line":"                )"},{"line_number":44,"context_line":"    @mock.patch(\u0027nova.objects.ComputeNodeList.get_all\u0027,"},{"line_number":45,"context_line":"                return_value\u003dfakes.COMPUTE_NODES)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_a69343a3","line":42,"in_reply_to":"9a80dd14_f09091ef","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":120,"context_line":"    @mock.patch(\u0027nova.objects.ServiceList.get_by_binary\u0027,"},{"line_number":121,"context_line":"                return_value\u003dfakes.SERVICES)"},{"line_number":122,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_by_host\u0027,"},{"line_number":123,"context_line":"                )"},{"line_number":124,"context_line":"    @mock.patch(\u0027nova.objects.ComputeNodeList.get_all\u0027,"},{"line_number":125,"context_line":"                return_value\u003dfakes.COMPUTE_NODES)"},{"line_number":126,"context_line":"    @mock.patch(\u0027nova.db.instance_extra_get_by_instance_uuid\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_30ba2972","line":123,"updated":"2015-03-16 20:02:23.000000000","message":"ditto","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":120,"context_line":"    @mock.patch(\u0027nova.objects.ServiceList.get_by_binary\u0027,"},{"line_number":121,"context_line":"                return_value\u003dfakes.SERVICES)"},{"line_number":122,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_by_host\u0027,"},{"line_number":123,"context_line":"                )"},{"line_number":124,"context_line":"    @mock.patch(\u0027nova.objects.ComputeNodeList.get_all\u0027,"},{"line_number":125,"context_line":"                return_value\u003dfakes.COMPUTE_NODES)"},{"line_number":126,"context_line":"    @mock.patch(\u0027nova.db.instance_extra_get_by_instance_uuid\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_c6903799","line":123,"in_reply_to":"9a80dd14_30ba2972","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":155,"context_line":"    @mock.patch(\u0027nova.objects.ServiceList.get_by_binary\u0027,"},{"line_number":156,"context_line":"                return_value\u003dfakes.SERVICES)"},{"line_number":157,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_by_host\u0027,"},{"line_number":158,"context_line":"                )"},{"line_number":159,"context_line":"    @mock.patch(\u0027nova.objects.ComputeNodeList.get_all\u0027,"},{"line_number":160,"context_line":"                return_value\u003dfakes.COMPUTE_NODES)"},{"line_number":161,"context_line":"    @mock.patch(\u0027nova.db.instance_extra_get_by_instance_uuid\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_70b4a182","line":158,"updated":"2015-03-16 20:02:23.000000000","message":"ditto","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":155,"context_line":"    @mock.patch(\u0027nova.objects.ServiceList.get_by_binary\u0027,"},{"line_number":156,"context_line":"                return_value\u003dfakes.SERVICES)"},{"line_number":157,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_by_host\u0027,"},{"line_number":158,"context_line":"                )"},{"line_number":159,"context_line":"    @mock.patch(\u0027nova.objects.ComputeNodeList.get_all\u0027,"},{"line_number":160,"context_line":"                return_value\u003dfakes.COMPUTE_NODES)"},{"line_number":161,"context_line":"    @mock.patch(\u0027nova.db.instance_extra_get_by_instance_uuid\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_068b2f69","line":158,"in_reply_to":"9a80dd14_70b4a182","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        filter_properties \u003d {}"},{"line_number":231,"context_line":"        self.mox.ReplayAll()"},{"line_number":232,"context_line":"        with mock.patch.object(nova.scheduler.host_manager.HostManager,"},{"line_number":233,"context_line":"                               \u0027_add_instance_info\u0027):"},{"line_number":234,"context_line":"            hosts \u003d self.driver._schedule(self.context, request_spec,"},{"line_number":235,"context_line":"                    filter_properties\u003dfilter_properties)"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_b05b7954","line":233,"updated":"2015-03-16 20:02:23.000000000","message":"Can you add this as a decorator @mock.patch() call instead, to be consistent with the other mocks on this method?","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        filter_properties \u003d {}"},{"line_number":231,"context_line":"        self.mox.ReplayAll()"},{"line_number":232,"context_line":"        with mock.patch.object(nova.scheduler.host_manager.HostManager,"},{"line_number":233,"context_line":"                               \u0027_add_instance_info\u0027):"},{"line_number":234,"context_line":"            hosts \u003d self.driver._schedule(self.context, request_spec,"},{"line_number":235,"context_line":"                    filter_properties\u003dfilter_properties)"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_660dcbe8","line":233,"in_reply_to":"9a80dd14_b05b7954","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":242,"context_line":"    @mock.patch(\u0027nova.objects.ServiceList.get_by_binary\u0027,"},{"line_number":243,"context_line":"                return_value\u003dfakes.SERVICES)"},{"line_number":244,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_by_host\u0027,"},{"line_number":245,"context_line":"                )"},{"line_number":246,"context_line":"    @mock.patch(\u0027nova.objects.ComputeNodeList.get_all\u0027,"},{"line_number":247,"context_line":"                return_value\u003dfakes.COMPUTE_NODES)"},{"line_number":248,"context_line":"    @mock.patch(\u0027nova.db.instance_extra_get_by_instance_uuid\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_302f89a9","line":245,"updated":"2015-03-16 20:02:23.000000000","message":"ditto comment from above about unnecessary comma and newline...","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":242,"context_line":"    @mock.patch(\u0027nova.objects.ServiceList.get_by_binary\u0027,"},{"line_number":243,"context_line":"                return_value\u003dfakes.SERVICES)"},{"line_number":244,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_by_host\u0027,"},{"line_number":245,"context_line":"                )"},{"line_number":246,"context_line":"    @mock.patch(\u0027nova.objects.ComputeNodeList.get_all\u0027,"},{"line_number":247,"context_line":"                return_value\u003dfakes.COMPUTE_NODES)"},{"line_number":248,"context_line":"    @mock.patch(\u0027nova.db.instance_extra_get_by_instance_uuid\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_462fe73e","line":245,"in_reply_to":"9a80dd14_302f89a9","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"}],"nova/tests/unit/scheduler/test_host_manager.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"070da30a20039b78f07d810997f0cc9977601442","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                                                        \u0027FakeFilterClass2\u0027]])"},{"line_number":63,"context_line":"        self.flags(scheduler_default_filters\u003d[\u0027FakeFilterClass1\u0027])"},{"line_number":64,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"},{"line_number":65,"context_line":"            with mock.patch.object(nova.objects.InstanceList, \u0027get_all\u0027"},{"line_number":66,"context_line":"                    ) as mock_get_all:"},{"line_number":67,"context_line":"                mock_get_all.return_value \u003d objects.instance.InstanceList()"},{"line_number":68,"context_line":"                self.host_manager \u003d host_manager.HostManager()"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_dab85b77","line":65,"updated":"2015-03-13 17:35:23.000000000","message":"ditto with next files...","commit_id":"c400835bb710dfa1b5066cdde749534f97da1aee"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"070da30a20039b78f07d810997f0cc9977601442","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        agg_get_all.return_value \u003d []"},{"line_number":98,"context_line":"        with mock.patch.object(nova.objects.InstanceList, \u0027get_all\u0027"},{"line_number":99,"context_line":"                ) as mock_get_all:"},{"line_number":100,"context_line":"            mock_get_all.return_value \u003d objects.instance.InstanceList()"},{"line_number":101,"context_line":"            self.host_manager \u003d host_manager.HostManager()"},{"line_number":102,"context_line":"        self.assertEqual({}, self.host_manager.aggs_by_id)"},{"line_number":103,"context_line":"        self.assertEqual({}, self.host_manager.host_aggregates_map)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_4e8af064","line":100,"updated":"2015-03-13 17:35:23.000000000","message":"sounds like your nested mocks have a problem, because you could only need to mock once the init_instance_info() in setUp() and you wouldn\u0027t require to also mock that in there","commit_id":"c400835bb710dfa1b5066cdde749534f97da1aee"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a9c52b5f41831de4224133d23041b11a0ad1ebeb","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                                                        \u0027FakeFilterClass2\u0027]])"},{"line_number":63,"context_line":"        self.flags(scheduler_default_filters\u003d[\u0027FakeFilterClass1\u0027])"},{"line_number":64,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"},{"line_number":65,"context_line":"            with mock.patch.object(nova.objects.InstanceList, \u0027get_all\u0027"},{"line_number":66,"context_line":"                    ) as mock_get_all:"},{"line_number":67,"context_line":"                mock_get_all.return_value \u003d objects.instance.InstanceList()"},{"line_number":68,"context_line":"                self.host_manager \u003d host_manager.HostManager()"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a80dd14_e51ada7b","line":65,"updated":"2015-03-13 21:46:04.000000000","message":"as said in the previous version, you should rather mock _init_instance_info()\n\nAlso a nit would be to have two context managers nested that way :\n\n  with mock.patch() as a, mock.patch() as b:\n    do()...","commit_id":"14d40295b4794c52d1e589f9301253e8e711e467"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a9c52b5f41831de4224133d23041b11a0ad1ebeb","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            self.assertIsInstance(fake_info[\"instances\"].values()[0],"},{"line_number":87,"context_line":"                                  objects.Instance)"},{"line_number":88,"context_line":"            self.assertEqual(len(fake_info[\"instances\"]), 1)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def test_default_filters(self):"},{"line_number":91,"context_line":"        default_filters \u003d self.host_manager.default_filters"},{"line_number":92,"context_line":"        self.assertEqual(1, len(default_filters))"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a80dd14_a5046218","line":89,"updated":"2015-03-13 21:46:04.000000000","message":"I don\u0027t see an unittest covering a negative result, could you please add it ?","commit_id":"14d40295b4794c52d1e589f9301253e8e711e467"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a9c52b5f41831de4224133d23041b11a0ad1ebeb","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    @mock.patch.object(objects.AggregateList, \u0027get_all\u0027)"},{"line_number":96,"context_line":"    def test_init_aggregates_no_aggs(self, agg_get_all):"},{"line_number":97,"context_line":"        agg_get_all.return_value \u003d []"},{"line_number":98,"context_line":"        with mock.patch.object(nova.objects.InstanceList, \u0027get_all\u0027"},{"line_number":99,"context_line":"                ) as mock_get_all:"},{"line_number":100,"context_line":"            mock_get_all.return_value \u003d objects.instance.InstanceList()"},{"line_number":101,"context_line":"            self.host_manager \u003d host_manager.HostManager()"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a80dd14_e89d4fbd","line":98,"updated":"2015-03-13 21:46:04.000000000","message":"as said, I would rather mock _init_instance_info()","commit_id":"14d40295b4794c52d1e589f9301253e8e711e467"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"},{"line_number":65,"context_line":"            with mock.patch.object(host_manager.HostManager,"},{"line_number":66,"context_line":"                                   \u0027_init_instance_info\u0027):"},{"line_number":67,"context_line":"                self.host_manager \u003d host_manager.HostManager()"},{"line_number":68,"context_line":"        self.fake_hosts \u003d [host_manager.HostState(\u0027fake_host%s\u0027 % x,"},{"line_number":69,"context_line":"                \u0027fake-node\u0027) for x in xrange(1, 5)]"},{"line_number":70,"context_line":"        self.fake_hosts +\u003d [host_manager.HostState(\u0027fake_multihost\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_b310e350","line":67,"updated":"2015-03-16 20:02:23.000000000","message":"You could move the use of both above nested mocks to be @mock.patch decorators on the setUp() method... might make things a bit more readable.","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"},{"line_number":65,"context_line":"            with mock.patch.object(host_manager.HostManager,"},{"line_number":66,"context_line":"                                   \u0027_init_instance_info\u0027):"},{"line_number":67,"context_line":"                self.host_manager \u003d host_manager.HostManager()"},{"line_number":68,"context_line":"        self.fake_hosts \u003d [host_manager.HostState(\u0027fake_host%s\u0027 % x,"},{"line_number":69,"context_line":"                \u0027fake-node\u0027) for x in xrange(1, 5)]"},{"line_number":70,"context_line":"        self.fake_hosts +\u003d [host_manager.HostState(\u0027fake_multihost\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_06496fb7","line":67,"in_reply_to":"9a80dd14_b310e350","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        fake_info \u003d hm._instance_info[\u0027host1\u0027]"},{"line_number":92,"context_line":"        self.assertIn(\u0027uuid1\u0027, fake_info[\u0027instances\u0027])"},{"line_number":93,"context_line":"        self.assertIn(\u0027uuid2\u0027, fake_info[\u0027instances\u0027])"},{"line_number":94,"context_line":"        self.assertNotIn(\u0027uuid3\u0027, fake_info[\u0027instances\u0027])"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def test_default_filters(self):"},{"line_number":97,"context_line":"        default_filters \u003d self.host_manager.default_filters"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_13b44f34","line":94,"updated":"2015-03-16 20:02:23.000000000","message":"Please add a test that has a batch size \u003e 10 to test the batching code in the _init_instance_info() method. Alternately, just override the batch size in the host manager object and reset it back afterwards using a fixture?","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        fake_info \u003d hm._instance_info[\u0027host1\u0027]"},{"line_number":92,"context_line":"        self.assertIn(\u0027uuid1\u0027, fake_info[\u0027instances\u0027])"},{"line_number":93,"context_line":"        self.assertIn(\u0027uuid2\u0027, fake_info[\u0027instances\u0027])"},{"line_number":94,"context_line":"        self.assertNotIn(\u0027uuid3\u0027, fake_info[\u0027instances\u0027])"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def test_default_filters(self):"},{"line_number":97,"context_line":"        default_filters \u003d self.host_manager.default_filters"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_a99314a3","line":94,"in_reply_to":"9a80dd14_13b44f34","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    @mock.patch.object(objects.AggregateList, \u0027get_all\u0027)"},{"line_number":102,"context_line":"    def test_init_aggregates_no_aggs(self, agg_get_all):"},{"line_number":103,"context_line":"        agg_get_all.return_value \u003d []"},{"line_number":104,"context_line":"        with mock.patch.object(host_manager.HostManager,"},{"line_number":105,"context_line":"                               \u0027_init_instance_info\u0027):"},{"line_number":106,"context_line":"            self.host_manager \u003d host_manager.HostManager()"},{"line_number":107,"context_line":"        self.assertEqual({}, self.host_manager.aggs_by_id)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_737aeb78","line":104,"updated":"2015-03-16 20:02:23.000000000","message":"For consistency reasons, please use the decorator @mock.patch as the other mocks use in this method and below.","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    @mock.patch.object(objects.AggregateList, \u0027get_all\u0027)"},{"line_number":102,"context_line":"    def test_init_aggregates_no_aggs(self, agg_get_all):"},{"line_number":103,"context_line":"        agg_get_all.return_value \u003d []"},{"line_number":104,"context_line":"        with mock.patch.object(host_manager.HostManager,"},{"line_number":105,"context_line":"                               \u0027_init_instance_info\u0027):"},{"line_number":106,"context_line":"            self.host_manager \u003d host_manager.HostManager()"},{"line_number":107,"context_line":"        self.assertEqual({}, self.host_manager.aggs_by_id)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_e9698c8d","line":104,"in_reply_to":"9a80dd14_737aeb78","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":478,"context_line":"        with mock.patch.object(self.host_manager, \u0027_add_instance_info\u0027"},{"line_number":479,"context_line":"                ) as mock_add_info:"},{"line_number":480,"context_line":"            self.host_manager.get_all_host_states(context)"},{"line_number":481,"context_line":"            self.assertTrue(mock_add_info.call_count)"},{"line_number":482,"context_line":""},{"line_number":483,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_by_host\u0027)"},{"line_number":484,"context_line":"    def test_recreate_instance_info(self, mock_get_by_host):"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_f3009bad","line":481,"updated":"2015-03-16 20:02:23.000000000","message":"What is this asserting? Please make it more assertive :)","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":478,"context_line":"        with mock.patch.object(self.host_manager, \u0027_add_instance_info\u0027"},{"line_number":479,"context_line":"                ) as mock_add_info:"},{"line_number":480,"context_line":"            self.host_manager.get_all_host_states(context)"},{"line_number":481,"context_line":"            self.assertTrue(mock_add_info.call_count)"},{"line_number":482,"context_line":""},{"line_number":483,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_by_host\u0027)"},{"line_number":484,"context_line":"    def test_recreate_instance_info(self, mock_get_by_host):"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_ffaa1a70","line":481,"in_reply_to":"9a80dd14_f3009bad","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":634,"context_line":"        super(HostManagerChangedNodesTestCase, self).setUp()"},{"line_number":635,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"},{"line_number":636,"context_line":"            with mock.patch.object(host_manager.HostManager,"},{"line_number":637,"context_line":"                                   \u0027_init_instance_info\u0027):"},{"line_number":638,"context_line":"                self.host_manager \u003d host_manager.HostManager()"},{"line_number":639,"context_line":"        self.fake_hosts \u003d ["},{"line_number":640,"context_line":"              host_manager.HostState(\u0027host1\u0027, \u0027node1\u0027),"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_b3cb8372","line":637,"updated":"2015-03-16 20:02:23.000000000","message":"Ditto comment from above..","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":634,"context_line":"        super(HostManagerChangedNodesTestCase, self).setUp()"},{"line_number":635,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"},{"line_number":636,"context_line":"            with mock.patch.object(host_manager.HostManager,"},{"line_number":637,"context_line":"                                   \u0027_init_instance_info\u0027):"},{"line_number":638,"context_line":"                self.host_manager \u003d host_manager.HostManager()"},{"line_number":639,"context_line":"        self.fake_hosts \u003d ["},{"line_number":640,"context_line":"              host_manager.HostState(\u0027host1\u0027, \u0027node1\u0027),"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_3fdbd222","line":637,"in_reply_to":"9a80dd14_b3cb8372","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"}],"nova/tests/unit/scheduler/test_ironic_host_manager.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"070da30a20039b78f07d810997f0cc9977601442","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        self.context \u003d context_module.get_admin_context()"},{"line_number":50,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"},{"line_number":51,"context_line":"            self.host_manager \u003d ironic_host_manager.IronicHostManager()"},{"line_number":52,"context_line":"            with mock.patch.object(nova.objects.InstanceList,"},{"line_number":53,"context_line":"                    \u0027get_by_host\u0027) as mock_get_by_host:"},{"line_number":54,"context_line":"                with mock.patch.object(nova.objects.InstanceList,"},{"line_number":55,"context_line":"                        \u0027get_all\u0027) as mock_get_all:"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_5abe2baf","line":52,"updated":"2015-03-13 17:35:23.000000000","message":"erm you should nest the mocks correctly (see the next file)","commit_id":"c400835bb710dfa1b5066cdde749534f97da1aee"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"070da30a20039b78f07d810997f0cc9977601442","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        self.mox.StubOutWithMock(objects.ServiceList, \u0027get_by_binary\u0027)"},{"line_number":76,"context_line":"        self.mox.StubOutWithMock(objects.ComputeNodeList, \u0027get_all\u0027)"},{"line_number":77,"context_line":"        objects.ServiceList.get_by_binary("},{"line_number":78,"context_line":"            self.context, \u0027nova-compute\u0027).AndReturn(ironic_fakes.SERVICES)"},{"line_number":79,"context_line":"        objects.ComputeNodeList.get_all(self.context).AndReturn("},{"line_number":80,"context_line":"            ironic_fakes.COMPUTE_NODES)"},{"line_number":81,"context_line":"        self.mox.ReplayAll()"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_9a0a6388","line":78,"updated":"2015-03-13 17:35:23.000000000","message":"not necesary","commit_id":"c400835bb710dfa1b5066cdde749534f97da1aee"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            with mock.patch.object(nova.objects.InstanceList,"},{"line_number":52,"context_line":"                    \u0027get_by_host\u0027) as mock_get_by_host:"},{"line_number":53,"context_line":"                with mock.patch.object(nova.objects.InstanceList,"},{"line_number":54,"context_line":"                        \u0027get_all\u0027) as mock_get_all:"},{"line_number":55,"context_line":"                    mock_get_by_host.return_value \u003d objects.InstanceList()"},{"line_number":56,"context_line":"                    mock_get_all.return_value \u003d objects.InstanceList()"},{"line_number":57,"context_line":"                    self.host_manager \u003d ironic_host_manager.IronicHostManager()"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_139a8f6e","line":54,"updated":"2015-03-16 20:02:23.000000000","message":"Should no longer need this mock for a get_all() call. Perhaps you meant nova.objects.ComputeNodeList.get_all()?\n\nPlus, consider moving all of these to be decorator @mock.patch() calls to avoid the use of nested withs.","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            with mock.patch.object(nova.objects.InstanceList,"},{"line_number":52,"context_line":"                    \u0027get_by_host\u0027) as mock_get_by_host:"},{"line_number":53,"context_line":"                with mock.patch.object(nova.objects.InstanceList,"},{"line_number":54,"context_line":"                        \u0027get_all\u0027) as mock_get_all:"},{"line_number":55,"context_line":"                    mock_get_by_host.return_value \u003d objects.InstanceList()"},{"line_number":56,"context_line":"                    mock_get_all.return_value \u003d objects.InstanceList()"},{"line_number":57,"context_line":"                    self.host_manager \u003d ironic_host_manager.IronicHostManager()"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_5f7c06ec","line":54,"in_reply_to":"9a80dd14_139a8f6e","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027)"},{"line_number":60,"context_line":"    def test_manager_public_api_signatures(self, mock_init_aggs):"},{"line_number":61,"context_line":"        with mock.patch.object(nova.objects.InstanceList, \u0027get_all\u0027):"},{"line_number":62,"context_line":"            self.assertPublicAPISignatures(host_manager.HostManager(),"},{"line_number":63,"context_line":"                                           self.host_manager)"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_73974b3b","line":61,"updated":"2015-03-16 20:02:23.000000000","message":"decorator pls.","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027)"},{"line_number":60,"context_line":"    def test_manager_public_api_signatures(self, mock_init_aggs):"},{"line_number":61,"context_line":"        with mock.patch.object(nova.objects.InstanceList, \u0027get_all\u0027):"},{"line_number":62,"context_line":"            self.assertPublicAPISignatures(host_manager.HostManager(),"},{"line_number":63,"context_line":"                                           self.host_manager)"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_5fca461b","line":61,"in_reply_to":"9a80dd14_73974b3b","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            with mock.patch.object(nova.objects.InstanceList,"},{"line_number":112,"context_line":"                    \u0027get_by_host\u0027) as mock_get_by_host:"},{"line_number":113,"context_line":"                with mock.patch.object(nova.objects.InstanceList,"},{"line_number":114,"context_line":"                        \u0027get_all\u0027) as mock_get_all:"},{"line_number":115,"context_line":"                    mock_get_by_host.return_value \u003d objects.InstanceList()"},{"line_number":116,"context_line":"                    mock_get_all.return_value \u003d objects.InstanceList()"},{"line_number":117,"context_line":"                    self.host_manager \u003d ironic_host_manager.IronicHostManager()"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_939cbf5f","line":114,"updated":"2015-03-16 20:02:23.000000000","message":"Ditto from above.","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            with mock.patch.object(nova.objects.InstanceList,"},{"line_number":112,"context_line":"                    \u0027get_by_host\u0027) as mock_get_by_host:"},{"line_number":113,"context_line":"                with mock.patch.object(nova.objects.InstanceList,"},{"line_number":114,"context_line":"                        \u0027get_all\u0027) as mock_get_all:"},{"line_number":115,"context_line":"                    mock_get_by_host.return_value \u003d objects.InstanceList()"},{"line_number":116,"context_line":"                    mock_get_all.return_value \u003d objects.InstanceList()"},{"line_number":117,"context_line":"                    self.host_manager \u003d ironic_host_manager.IronicHostManager()"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_3fecb292","line":114,"in_reply_to":"9a80dd14_939cbf5f","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        with mock.patch.object(nova.objects.InstanceList, \u0027get_by_host\u0027):"},{"line_number":167,"context_line":"            self.host_manager.get_all_host_states(self.context)"},{"line_number":168,"context_line":"            self.host_manager.get_all_host_states(self.context)"},{"line_number":169,"context_line":"        host_states_map \u003d self.host_manager.host_state_map"},{"line_number":170,"context_line":"        self.assertEqual(3, len(host_states_map))"},{"line_number":171,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_93383f3f","line":168,"updated":"2015-03-16 20:02:23.000000000","message":"I don\u0027t see how any of the changes in this test are related to the code in this patch?","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        with mock.patch.object(nova.objects.InstanceList, \u0027get_by_host\u0027):"},{"line_number":167,"context_line":"            self.host_manager.get_all_host_states(self.context)"},{"line_number":168,"context_line":"            self.host_manager.get_all_host_states(self.context)"},{"line_number":169,"context_line":"        host_states_map \u003d self.host_manager.host_state_map"},{"line_number":170,"context_line":"        self.assertEqual(3, len(host_states_map))"},{"line_number":171,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_5a07b481","line":168,"in_reply_to":"9a80dd14_93383f3f","updated":"2015-03-16 21:59:07.000000000","message":"It was for consistency\u0027s sake - I needed a self.context that was a real context, and not a string, so I updated the rest to be consistent. As mentioned in IRC, I found a work-around, so I\u0027ll revert these.","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        with mock.patch.object(nova.objects.InstanceList, \u0027get_by_host\u0027):"},{"line_number":187,"context_line":"            self.host_manager.get_all_host_states(self.context)"},{"line_number":188,"context_line":"            self.host_manager.get_all_host_states(self.context)"},{"line_number":189,"context_line":"        host_states_map \u003d self.host_manager.host_state_map"},{"line_number":190,"context_line":"        self.assertEqual(0, len(host_states_map))"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_d339d740","line":188,"updated":"2015-03-16 20:02:23.000000000","message":"I don\u0027t see how any of the changes in this test are related to the code in this patch?","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":250,"context_line":"            with mock.patch.object(nova.objects.InstanceList,"},{"line_number":251,"context_line":"                    \u0027get_by_host\u0027) as mock_get_by_host:"},{"line_number":252,"context_line":"                with mock.patch.object(nova.objects.InstanceList,"},{"line_number":253,"context_line":"                        \u0027get_all\u0027) as mock_get_all:"},{"line_number":254,"context_line":"                    mock_get_by_host.return_value \u003d objects.InstanceList()"},{"line_number":255,"context_line":"                    mock_get_all.return_value \u003d objects.InstanceList()"},{"line_number":256,"context_line":"                    self.host_manager \u003d ironic_host_manager.IronicHostManager()"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_f31dfbbf","line":253,"updated":"2015-03-16 20:02:23.000000000","message":"Same comment as top of this code file...","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":250,"context_line":"            with mock.patch.object(nova.objects.InstanceList,"},{"line_number":251,"context_line":"                    \u0027get_by_host\u0027) as mock_get_by_host:"},{"line_number":252,"context_line":"                with mock.patch.object(nova.objects.InstanceList,"},{"line_number":253,"context_line":"                        \u0027get_all\u0027) as mock_get_all:"},{"line_number":254,"context_line":"                    mock_get_by_host.return_value \u003d objects.InstanceList()"},{"line_number":255,"context_line":"                    mock_get_all.return_value \u003d objects.InstanceList()"},{"line_number":256,"context_line":"                    self.host_manager \u003d ironic_host_manager.IronicHostManager()"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_faef88af","line":253,"in_reply_to":"9a80dd14_f31dfbbf","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"}],"nova/tests/unit/scheduler/test_scheduler.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"070da30a20039b78f07d810997f0cc9977601442","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        super(SchedulerManagerTestCase, self).setUp()"},{"line_number":43,"context_line":"        self.flags(scheduler_driver\u003dself.driver_cls_name)"},{"line_number":44,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"},{"line_number":45,"context_line":"            with mock.patch.object(nova.objects.InstanceList, \u0027get_all\u0027"},{"line_number":46,"context_line":"                    ) as mock_get_all:"},{"line_number":47,"context_line":"                mock_get_all.return_value \u003d objects.instance.InstanceList()"},{"line_number":48,"context_line":"                self.manager \u003d self.manager_cls()"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_ba96473c","line":45,"updated":"2015-03-13 17:35:23.000000000","message":"you should rather nest the mocks that way :\n\n with mock.patch() as a, mock.patch() as b:\n   do()","commit_id":"c400835bb710dfa1b5066cdde749534f97da1aee"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"070da30a20039b78f07d810997f0cc9977601442","unresolved":false,"context_lines":[{"line_number":45,"context_line":"            with mock.patch.object(nova.objects.InstanceList, \u0027get_all\u0027"},{"line_number":46,"context_line":"                    ) as mock_get_all:"},{"line_number":47,"context_line":"                mock_get_all.return_value \u003d objects.instance.InstanceList()"},{"line_number":48,"context_line":"                self.manager \u003d self.manager_cls()"},{"line_number":49,"context_line":"        self.topic \u003d \u0027fake_topic\u0027"},{"line_number":50,"context_line":"        self.fake_args \u003d (1, 2, 3)"},{"line_number":51,"context_line":"        self.fake_kwargs \u003d {\u0027cat\u0027: \u0027meow\u0027, \u0027dog\u0027: \u0027woof\u0027}"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_5ac2ab53","line":48,"updated":"2015-03-13 17:35:23.000000000","message":"I would rather mock the entire init_instance_info() method so we would make sure we could isolate the testing of it and not rework all unittests if we would add another object call later","commit_id":"c400835bb710dfa1b5066cdde749534f97da1aee"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a9c52b5f41831de4224133d23041b11a0ad1ebeb","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    # So we can subclass this test and re-use tests if we need."},{"line_number":101,"context_line":"    driver_cls \u003d driver.Scheduler"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    @mock.patch(\u0027nova.db.instance_get_all\u0027)"},{"line_number":104,"context_line":"    def setUp(self, mock_get_all):"},{"line_number":105,"context_line":"        super(SchedulerTestCase, self).setUp()"},{"line_number":106,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a80dd14_e8d2af5a","line":103,"updated":"2015-03-13 21:46:04.000000000","message":"please don\u0027t mock a setUp method that way but rather use a context manager for the method you want to fake an internal call","commit_id":"14d40295b4794c52d1e589f9301253e8e711e467"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a9c52b5f41831de4224133d23041b11a0ad1ebeb","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        self.mox.StubOutWithMock(db, \u0027service_get_all_by_topic\u0027)"},{"line_number":119,"context_line":"        self.mox.StubOutWithMock(servicegroup.API, \u0027service_is_up\u0027)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        db.service_get_all_by_topic(elevated, self.topic).AndReturn(services)"},{"line_number":122,"context_line":"        self.servicegroup_api.service_is_up(service1).AndReturn(False)"},{"line_number":123,"context_line":"        self.servicegroup_api.service_is_up(service2).AndReturn(True)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"9a80dd14_886f7391","line":121,"updated":"2015-03-13 21:46:04.000000000","message":"why do you need to elevate the context here ? I maybe missed something...","commit_id":"14d40295b4794c52d1e589f9301253e8e711e467"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.flags(scheduler_driver\u003dself.driver_cls_name)"},{"line_number":44,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"},{"line_number":45,"context_line":"            with mock.patch.object(host_manager.HostManager,"},{"line_number":46,"context_line":"                    \u0027_init_instance_info\u0027):"},{"line_number":47,"context_line":"                self.manager \u003d self.manager_cls()"},{"line_number":48,"context_line":"        self.topic \u003d \u0027fake_topic\u0027"},{"line_number":49,"context_line":"        self.fake_args \u003d (1, 2, 3)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_b36aa319","line":46,"updated":"2015-03-16 20:02:23.000000000","message":"Same comment from previous test case files about moving these to be @mock.patch decorators...","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.flags(scheduler_driver\u003dself.driver_cls_name)"},{"line_number":44,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"},{"line_number":45,"context_line":"            with mock.patch.object(host_manager.HostManager,"},{"line_number":46,"context_line":"                    \u0027_init_instance_info\u0027):"},{"line_number":47,"context_line":"                self.manager \u003d self.manager_cls()"},{"line_number":48,"context_line":"        self.topic \u003d \u0027fake_topic\u0027"},{"line_number":49,"context_line":"        self.fake_args \u003d (1, 2, 3)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_fa55c81e","line":46,"in_reply_to":"9a80dd14_b36aa319","updated":"2015-03-16 21:59:07.000000000","message":"Done","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    def setUp(self):"},{"line_number":81,"context_line":"        super(SchedulerV3PassthroughTestCase, self).setUp()"},{"line_number":82,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"},{"line_number":83,"context_line":"            with mock.patch.object(nova.objects.InstanceList, \u0027get_all\u0027"},{"line_number":84,"context_line":"                    ) as mock_get_all:"},{"line_number":85,"context_line":"                mock_get_all.return_value \u003d objects.instance.InstanceList()"},{"line_number":86,"context_line":"                self.manager \u003d manager.SchedulerManager()"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_73582b8b","line":83,"updated":"2015-03-16 20:02:23.000000000","message":"Is this what you intended to mock out?","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        super(SchedulerTestCase, self).setUp()"},{"line_number":104,"context_line":"        with mock.patch.object(host_manager.HostManager, \u0027_init_aggregates\u0027):"},{"line_number":105,"context_line":"            with mock.patch.object(host_manager.HostManager,"},{"line_number":106,"context_line":"                                   \u0027_init_instance_info\u0027):"},{"line_number":107,"context_line":"                self.driver \u003d self.driver_cls()"},{"line_number":108,"context_line":"        self.context \u003d context.RequestContext(\u0027fake_user\u0027, \u0027fake_project\u0027)"},{"line_number":109,"context_line":"        self.topic \u003d \u0027fake_topic\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_d34e37c2","line":106,"updated":"2015-03-16 20:02:23.000000000","message":"ditto comment about @mock.patch decorators.","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3905bb89935e1dff70c701e58100ecde9829a0","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        self.mox.StubOutWithMock(db, \u0027service_get_all_by_topic\u0027)"},{"line_number":119,"context_line":"        self.mox.StubOutWithMock(servicegroup.API, \u0027service_is_up\u0027)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        db.service_get_all_by_topic(elevated, self.topic).AndReturn(services)"},{"line_number":122,"context_line":"        self.servicegroup_api.service_is_up(service1).AndReturn(False)"},{"line_number":123,"context_line":"        self.servicegroup_api.service_is_up(service2).AndReturn(True)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_d3d557b8","line":121,"updated":"2015-03-16 20:02:23.000000000","message":"How are these changes related to this patch?","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"01fb78b7642eecf8288a954d45e0a5fd3321c531","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        self.mox.StubOutWithMock(db, \u0027service_get_all_by_topic\u0027)"},{"line_number":119,"context_line":"        self.mox.StubOutWithMock(servicegroup.API, \u0027service_is_up\u0027)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        db.service_get_all_by_topic(elevated, self.topic).AndReturn(services)"},{"line_number":122,"context_line":"        self.servicegroup_api.service_is_up(service1).AndReturn(False)"},{"line_number":123,"context_line":"        self.servicegroup_api.service_is_up(service2).AndReturn(True)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_9a3e8cd9","line":121,"in_reply_to":"9a80dd14_d3d557b8","updated":"2015-03-16 21:59:07.000000000","message":"Same response as in previous file. Fixed.","commit_id":"ef15487da1a29c4750498a73618c049b7411b4bd"}]}
