)]}'
{"nova/compute/resource_tracker.py":[{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"10a381fe911763d6fe61c989bb5d211656f13ea5","unresolved":false,"context_lines":[{"line_number":360,"context_line":"        # NOTE(sbauza): PCI tracker is not persisting into compute_nodes"},{"line_number":361,"context_line":"        self._set_pci_tracker_compute_node_id(context, self.host,"},{"line_number":362,"context_line":"                                              self.nodename)"},{"line_number":363,"context_line":"        self._pci_update(context)"},{"line_number":364,"context_line":""},{"line_number":365,"context_line":"    def _set_pci_tracker_compute_node_id(self, context, service_name,"},{"line_number":366,"context_line":"                                         node_name):"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_2eedfeb7","line":363,"updated":"2014-05-23 03:38:58.000000000","message":"Why handle pci in nova compute but not scheduler client just like other compute node attributes?","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"41f1ef83e9122bf5b8b4335143b685cfa52504b1","unresolved":false,"context_lines":[{"line_number":360,"context_line":"        # NOTE(sbauza): PCI tracker is not persisting into compute_nodes"},{"line_number":361,"context_line":"        self._set_pci_tracker_compute_node_id(context, self.host,"},{"line_number":362,"context_line":"                                              self.nodename)"},{"line_number":363,"context_line":"        self._pci_update(context)"},{"line_number":364,"context_line":""},{"line_number":365,"context_line":"    def _set_pci_tracker_compute_node_id(self, context, service_name,"},{"line_number":366,"context_line":"                                         node_name):"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_01a565b4","line":363,"in_reply_to":"7adec928_2eedfeb7","updated":"2014-05-23 14:28:17.000000000","message":"because PCI has its own Tracker, but stats are part of the resources.\nIf you look at the PCI steps, you will only see I left the PCI Tracker, not the stats.","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"eac0e9af687903c2cb2f4bfea090766556af674d","unresolved":false,"context_lines":[{"line_number":446,"context_line":"        if \"service\" in self.compute_node:"},{"line_number":447,"context_line":"            del self.compute_node[\u0027service\u0027]"},{"line_number":448,"context_line":"        self.compute_node \u003d self.conductor_api.compute_node_update("},{"line_number":449,"context_line":"            context, self.compute_node, values)"},{"line_number":450,"context_line":"        if self.pci_tracker:"},{"line_number":451,"context_line":"            self.pci_tracker.save(context)"},{"line_number":452,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_d1e7dd10","side":"PARENT","line":449,"updated":"2014-06-02 15:15:31.000000000","message":"I guess I was only expecting calls to conductor_api.compute_node_update to get moved.","commit_id":"ae1803b62b0110daea5b142ead90c4e5635237ce"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"eac0e9af687903c2cb2f4bfea090766556af674d","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"scheduler_opts \u003d ["},{"line_number":55,"context_line":"    cfg.StrOpt(\u0027scheduler_client\u0027,"},{"line_number":56,"context_line":"               default\u003d\u0027nova.scheduler.client.SchedulerClient\u0027,"},{"line_number":57,"context_line":"               help\u003d\u0027Class that implements Scheduler client library\u0027)"},{"line_number":58,"context_line":"]"},{"line_number":59,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_f1e21900","line":56,"updated":"2014-06-02 15:15:31.000000000","message":"This should be an entry point, not just a random class name.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f5877d718f5f729eabab0867bca465ac6e3ad7","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"scheduler_opts \u003d ["},{"line_number":55,"context_line":"    cfg.StrOpt(\u0027scheduler_client\u0027,"},{"line_number":56,"context_line":"               default\u003d\u0027nova.scheduler.client.SchedulerClient\u0027,"},{"line_number":57,"context_line":"               help\u003d\u0027Class that implements Scheduler client library\u0027)"},{"line_number":58,"context_line":"]"},{"line_number":59,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_918a63bd","line":56,"in_reply_to":"1ae5cdf2_77a434a6","updated":"2014-06-04 12:10:09.000000000","message":"As discussed per IRC, will change it to hardcoded import","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0120c5dac953ab2288a94e7d9f4bba0ed57ab20b","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"scheduler_opts \u003d ["},{"line_number":55,"context_line":"    cfg.StrOpt(\u0027scheduler_client\u0027,"},{"line_number":56,"context_line":"               default\u003d\u0027nova.scheduler.client.SchedulerClient\u0027,"},{"line_number":57,"context_line":"               help\u003d\u0027Class that implements Scheduler client library\u0027)"},{"line_number":58,"context_line":"]"},{"line_number":59,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_77a434a6","line":56,"in_reply_to":"1ae5cdf2_f1e21900","updated":"2014-06-02 16:42:13.000000000","message":"OK, so you mean we should manage it thru a stevedore manager ?\nPlease precise your views.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":8690,"name":"Khanh-Toan TRAN","email":"khtoantran@gmail.com","username":"toan-tran"},"change_message_id":"4bb65e0bcbb990ee5f51bd2d8d78b34df1c59fd7","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        monitor_handler \u003d monitors.ResourceMonitorHandler()"},{"line_number":86,"context_line":"        self.monitors \u003d monitor_handler.choose_monitors(self)"},{"line_number":87,"context_line":"        self.notifier \u003d rpc.get_notifier()"},{"line_number":88,"context_line":"        self.scheduler \u003d importutils.import_object(CONF.scheduler_client)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    @utils.synchronized(COMPUTE_RESOURCE_SEMAPHORE)"},{"line_number":91,"context_line":"    def instance_claim(self, context, instance_ref, limits\u003dNone):"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_d8ed2327","line":88,"updated":"2014-06-03 07:50:31.000000000","message":"for clarification reason, please use scheduler_client instead of scheduler. This uses scheduler client calls, not actual scheduler\u0027s functionalities.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f5877d718f5f729eabab0867bca465ac6e3ad7","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        monitor_handler \u003d monitors.ResourceMonitorHandler()"},{"line_number":86,"context_line":"        self.monitors \u003d monitor_handler.choose_monitors(self)"},{"line_number":87,"context_line":"        self.notifier \u003d rpc.get_notifier()"},{"line_number":88,"context_line":"        self.scheduler \u003d importutils.import_object(CONF.scheduler_client)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    @utils.synchronized(COMPUTE_RESOURCE_SEMAPHORE)"},{"line_number":91,"context_line":"    def instance_claim(self, context, instance_ref, limits\u003dNone):"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_319c2f0f","line":88,"in_reply_to":"1ae5cdf2_d8ed2327","updated":"2014-06-04 12:10:09.000000000","message":"Done","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"eac0e9af687903c2cb2f4bfea090766556af674d","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        elevated \u003d context.elevated()"},{"line_number":138,"context_line":"        # persist changes to the compute node:"},{"line_number":139,"context_line":"        self.compute_node \u003d self.scheduler.update_resource_stats("},{"line_number":140,"context_line":"            elevated, self.host, self.compute_node)"},{"line_number":141,"context_line":"        return claim"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    @utils.synchronized(COMPUTE_RESOURCE_SEMAPHORE)"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_d1951d41","line":140,"updated":"2014-06-02 15:15:31.000000000","message":"Can we please just push this back into the update method? It should be much easer to reason about then.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0120c5dac953ab2288a94e7d9f4bba0ed57ab20b","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        elevated \u003d context.elevated()"},{"line_number":138,"context_line":"        # persist changes to the compute node:"},{"line_number":139,"context_line":"        self.compute_node \u003d self.scheduler.update_resource_stats("},{"line_number":140,"context_line":"            elevated, self.host, self.compute_node)"},{"line_number":141,"context_line":"        return claim"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    @utils.synchronized(COMPUTE_RESOURCE_SEMAPHORE)"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_979f0050","line":140,"in_reply_to":"1ae5cdf2_d1951d41","updated":"2014-06-02 16:42:13.000000000","message":"Will do","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"36d2bd8b7abbf0b95d854609363cb6a176f8dccb","unresolved":false,"context_lines":[{"line_number":352,"context_line":"            service \u003d self._get_service(context)"},{"line_number":353,"context_line":"            if not service:"},{"line_number":354,"context_line":"                # no service record, disable resource"},{"line_number":355,"context_line":"                return"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"            compute_node_refs \u003d service[\u0027compute_node\u0027]"},{"line_number":358,"context_line":"            if compute_node_refs:"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ae5cdf2_b380b58c","side":"PARENT","line":355,"updated":"2014-06-09 17:27:48.000000000","message":"The scheduler lib should probably not include this right? I feel very strongly that this code that check for the service should stay here.\n\nthat way you don\u0027t access the service_object at all inside the scheduler client lib.","commit_id":"049d110d2f62498cc66593ce19d0325d90b59e65"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"36d2bd8b7abbf0b95d854609363cb6a176f8dccb","unresolved":false,"context_lines":[{"line_number":429,"context_line":"        self.compute_node \u003d self.scheduler_client.update_resource_stats("},{"line_number":430,"context_line":"            context, (self.host, self.nodename), values)"},{"line_number":431,"context_line":"        if self.pci_tracker:"},{"line_number":432,"context_line":"            self.pci_tracker.save(context)"},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"    def _update_usage(self, resources, usage, sign\u003d1):"},{"line_number":435,"context_line":"        mem_usage \u003d usage[\u0027memory_mb\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ae5cdf2_535db1e8","line":432,"updated":"2014-06-09 17:27:48.000000000","message":"clearly the PCI tracker needs to change at some point to also call into the scheduler_client? is there a plan for that yet? For me moving it into the extensible resource scheduler work might be the best way forward. Need to check with SRIOV folks, they are changing this stuff too.","commit_id":"caf7b95e01fec22183d1ee5b88d5b8297aaa8c52"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"016b369165a720825e08c6483717afa829fcc3bb","unresolved":false,"context_lines":[{"line_number":429,"context_line":"        self.compute_node \u003d self.scheduler_client.update_resource_stats("},{"line_number":430,"context_line":"            context, (self.host, self.nodename), values)"},{"line_number":431,"context_line":"        if self.pci_tracker:"},{"line_number":432,"context_line":"            self.pci_tracker.save(context)"},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"    def _update_usage(self, resources, usage, sign\u003d1):"},{"line_number":435,"context_line":"        mem_usage \u003d usage[\u0027memory_mb\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ae5cdf2_b615fe4a","line":432,"in_reply_to":"1ae5cdf2_535db1e8","updated":"2014-06-09 20:02:34.000000000","message":"Right, I tried to put the line right with PCI as there is *another* tracker for PCI only stuff.\nSo, my proposal here is to send the PCI stats within the CN object, and leave the PCI tracker alone, waiting for a PCI refactoring thanks to SRIOV efforts.","commit_id":"caf7b95e01fec22183d1ee5b88d5b8297aaa8c52"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"23e7b059ff7d2c4c9e06ee00f96ed820bf83ce12","unresolved":false,"context_lines":[{"line_number":374,"context_line":""},{"line_number":375,"context_line":"        else:"},{"line_number":376,"context_line":"            # just update the record:"},{"line_number":377,"context_line":"            self._update(context, resources)"},{"line_number":378,"context_line":"            LOG.info(_(\u0027Compute_service record updated for %(host)s:%(node)s\u0027)"},{"line_number":379,"context_line":"                    % {\u0027host\u0027: self.host, \u0027node\u0027: self.nodename})"},{"line_number":380,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"1ae5cdf2_3cfc323f","side":"PARENT","line":377,"updated":"2014-06-18 11:02:58.000000000","message":"Why could you not leave the update call here? Why is it pulled outside of _sync_compute_node?","commit_id":"0ca98979da842f9accf0f8d8c4eb7d4f1f9eac7a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"23e7b059ff7d2c4c9e06ee00f96ed820bf83ce12","unresolved":false,"context_lines":[{"line_number":369,"context_line":"        if not self.compute_node:"},{"line_number":370,"context_line":"            # There is no compute node yet in DB"},{"line_number":371,"context_line":"            self.compute_node \u003d resources"},{"line_number":372,"context_line":"            self.compute_node[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":373,"context_line":""},{"line_number":374,"context_line":"    def _get_service(self, context):"},{"line_number":375,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":20,"id":"1ae5cdf2_9c30e608","line":372,"updated":"2014-06-18 11:02:58.000000000","message":"This seems a bit confusing, passing this ID into the scheduler client in this way seems very odd.\n\nI think its neater to keep the compute node creation here for now? And the next blueprint has to work though moving the rest of this?","commit_id":"f27ceba283dfbd7a9ec27e580940f1925cbc4e0a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"72e2c600f7d448d331743ed373aee77010fd4ccf","unresolved":false,"context_lines":[{"line_number":369,"context_line":"        if not self.compute_node:"},{"line_number":370,"context_line":"            # There is no compute node yet in DB"},{"line_number":371,"context_line":"            self.compute_node \u003d resources"},{"line_number":372,"context_line":"            self.compute_node[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":373,"context_line":""},{"line_number":374,"context_line":"    def _get_service(self, context):"},{"line_number":375,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":20,"id":"1ae5cdf2_5b8c6dd7","line":372,"in_reply_to":"1ae5cdf2_9c30e608","updated":"2014-06-19 15:52:18.000000000","message":"We agreed on the the problem of Service_id being FK in compute_nodes. Must be tackled in a later patch (maybe in Gantt, further discussions to come)","commit_id":"f27ceba283dfbd7a9ec27e580940f1925cbc4e0a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"aee35e335b6ab11452907cb371c1fc47d49dd42f","unresolved":false,"context_lines":[{"line_number":374,"context_line":""},{"line_number":375,"context_line":"        else:"},{"line_number":376,"context_line":"            # just update the record:"},{"line_number":377,"context_line":"            self._update(context, resources)"},{"line_number":378,"context_line":"            LOG.info(_(\u0027Compute_service record updated for %(host)s:%(node)s\u0027)"},{"line_number":379,"context_line":"                    % {\u0027host\u0027: self.host, \u0027node\u0027: self.nodename})"},{"line_number":380,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"1ae5cdf2_49c56b5a","side":"PARENT","line":377,"updated":"2014-06-20 08:53:12.000000000","message":"I still think it would be nicer to leave this code here, and minimise what you have \"refactoring\" here.","commit_id":"d239e93858872747be694c7cd6a84d902dad1ca8"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c04684f9cb75d12e815acd32bad669bf30743f0","unresolved":false,"context_lines":[{"line_number":368,"context_line":"            resources[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":369,"context_line":"            self._create(context, resources)"},{"line_number":370,"context_line":"            if self.pci_tracker:"},{"line_number":371,"context_line":"                self.pci_tracker.set_compute_node_id(self.compute_node[\u0027id\u0027])"},{"line_number":372,"context_line":"            LOG.info(_(\u0027Compute_service record created for %(host)s:%(node)s\u0027)"},{"line_number":373,"context_line":"                    % {\u0027host\u0027: self.host, \u0027node\u0027: self.nodename})"},{"line_number":374,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_9b86c763","side":"PARENT","line":371,"updated":"2014-06-20 16:55:51.000000000","message":"don\u0027t we still need this somewhere? eek!","commit_id":"83f8c95cf8e8de7aa130a2ee936dc9155fbf4e62"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"477828a0334dd444c6dcf97db7818e23bb329e16","unresolved":false,"context_lines":[{"line_number":368,"context_line":"            resources[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":369,"context_line":"            self._create(context, resources)"},{"line_number":370,"context_line":"            if self.pci_tracker:"},{"line_number":371,"context_line":"                self.pci_tracker.set_compute_node_id(self.compute_node[\u0027id\u0027])"},{"line_number":372,"context_line":"            LOG.info(_(\u0027Compute_service record created for %(host)s:%(node)s\u0027)"},{"line_number":373,"context_line":"                    % {\u0027host\u0027: self.host, \u0027node\u0027: self.nodename})"},{"line_number":374,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_8a84930c","side":"PARENT","line":371,"in_reply_to":"1ae5cdf2_9b86c763","updated":"2014-06-23 08:20:37.000000000","message":"This case is when a new compute_node appears and not in DB, so PCI tracker needs to set its ID. As we no longer give back the ID to Resource Tracker (as Sched Client is returning nothing), we can\u0027t set it this way.\n\nThe thing is, I did some testing (and also Tempest tests), and it seems that there is no impact ?!","commit_id":"83f8c95cf8e8de7aa130a2ee936dc9155fbf4e62"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c04684f9cb75d12e815acd32bad669bf30743f0","unresolved":false,"context_lines":[{"line_number":40,"context_line":"from nova.openstack.common import log as logging"},{"line_number":41,"context_line":"from nova.pci import pci_manager"},{"line_number":42,"context_line":"from nova import rpc"},{"line_number":43,"context_line":"from nova.scheduler import client as sched_cli"},{"line_number":44,"context_line":"from nova import utils"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"resource_tracker_opts \u003d ["}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_50433e3e","line":43,"updated":"2014-06-20 16:55:51.000000000","message":"nit: its not really a cli, maybe go for client?","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"5b6eaaf771dd170a07eac6ccf4208db973b08d5a","unresolved":false,"context_lines":[{"line_number":40,"context_line":"from nova.openstack.common import log as logging"},{"line_number":41,"context_line":"from nova.pci import pci_manager"},{"line_number":42,"context_line":"from nova import rpc"},{"line_number":43,"context_line":"from nova.scheduler import client as sched_cli"},{"line_number":44,"context_line":"from nova import utils"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"resource_tracker_opts \u003d ["}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_2a345fab","line":43,"in_reply_to":"1ae5cdf2_50433e3e","updated":"2014-06-23 08:12:44.000000000","message":"Done","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c04684f9cb75d12e815acd32bad669bf30743f0","unresolved":false,"context_lines":[{"line_number":373,"context_line":"            #               ideal and must be changed later once the FK in"},{"line_number":374,"context_line":"            #               compute_nodes table for service table is either"},{"line_number":375,"context_line":"            #               removed or becomes nullable"},{"line_number":376,"context_line":"            resources[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":377,"context_line":"            self.compute_node \u003d copy.deepcopy(resources)"},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"        self._update(context, resources)"}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_d0410e0b","line":376,"updated":"2014-06-20 16:55:51.000000000","message":"hmm, this smells bad...","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"5b6eaaf771dd170a07eac6ccf4208db973b08d5a","unresolved":false,"context_lines":[{"line_number":373,"context_line":"            #               ideal and must be changed later once the FK in"},{"line_number":374,"context_line":"            #               compute_nodes table for service table is either"},{"line_number":375,"context_line":"            #               removed or becomes nullable"},{"line_number":376,"context_line":"            resources[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":377,"context_line":"            self.compute_node \u003d copy.deepcopy(resources)"},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"        self._update(context, resources)"}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_aaab0fd6","line":376,"in_reply_to":"1ae5cdf2_d0410e0b","updated":"2014-06-23 08:12:44.000000000","message":"This is already in the trunk, see at the left, I just put a comment on it without changing the call itself.","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c04684f9cb75d12e815acd32bad669bf30743f0","unresolved":false,"context_lines":[{"line_number":376,"context_line":"            resources[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":377,"context_line":"            self.compute_node \u003d copy.deepcopy(resources)"},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"        self._update(context, resources)"},{"line_number":380,"context_line":""},{"line_number":381,"context_line":"    def _get_service(self, context):"},{"line_number":382,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_fbafcbe0","line":379,"updated":"2014-06-20 16:55:51.000000000","message":"Thanks for keeping this here, its easier to read.","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c04684f9cb75d12e815acd32bad669bf30743f0","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        self.compute_node.update(values)"},{"line_number":446,"context_line":"        # Persist the stats into DB for use in the Scheduler"},{"line_number":447,"context_line":"        self.scheduler_client.update_resource_stats("},{"line_number":448,"context_line":"            context, (self.host, self.nodename), self.compute_node)"},{"line_number":449,"context_line":"        if self.pci_tracker:"},{"line_number":450,"context_line":"            self.pci_tracker.save(context)"},{"line_number":451,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_3069528c","line":448,"updated":"2014-06-20 16:55:51.000000000","message":"Why don\u0027t we just pass values here? oh right we need the id...\n\nwhy not just put the id into the values here, and do it all the time? client can use it when doing create, and stop it out when \n\nBasically, I worry that we assume the client has a certain type of caching, etc, I don\u0027t really like that kind of coupling.","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"5b6eaaf771dd170a07eac6ccf4208db973b08d5a","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        self.compute_node.update(values)"},{"line_number":446,"context_line":"        # Persist the stats into DB for use in the Scheduler"},{"line_number":447,"context_line":"        self.scheduler_client.update_resource_stats("},{"line_number":448,"context_line":"            context, (self.host, self.nodename), self.compute_node)"},{"line_number":449,"context_line":"        if self.pci_tracker:"},{"line_number":450,"context_line":"            self.pci_tracker.save(context)"},{"line_number":451,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_ea5ef712","line":448,"in_reply_to":"1ae5cdf2_3069528c","updated":"2014-06-23 08:12:44.000000000","message":"In the next patchset, client will only cache the id so no need to care about the coupling ;-) Thanks for the trick, btw.\n\nPlease tho note that id is not always in self.compute_node, there is a case where the compute_node entry is not existing and then it\u0027s a create() called. \n\nAs we now no longer pass back the values from DB, id is never sent to self.compute_node in RT, unless another call to get_service is done.","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f4fe5e7a0184f676d26c931dad30743a0fd7ffaf","unresolved":false,"context_lines":[{"line_number":368,"context_line":"            resources[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":369,"context_line":"            self._create(context, resources)"},{"line_number":370,"context_line":"            if self.pci_tracker:"},{"line_number":371,"context_line":"                self.pci_tracker.set_compute_node_id(self.compute_node[\u0027id\u0027])"},{"line_number":372,"context_line":"            LOG.info(_(\u0027Compute_service record created for %(host)s:%(node)s\u0027)"},{"line_number":373,"context_line":"                    % {\u0027host\u0027: self.host, \u0027node\u0027: self.nodename})"},{"line_number":374,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"1ae5cdf2_e7caad45","side":"PARENT","line":371,"updated":"2014-06-23 10:21:40.000000000","message":"If you delete this, please delete this call from the PCI tracker, to explain why its not needed any more.","commit_id":"83f8c95cf8e8de7aa130a2ee936dc9155fbf4e62"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e672ffc8d4811390692cf52d2c4f9a5dfd871a52","unresolved":false,"context_lines":[{"line_number":365,"context_line":"                    if cn.get(\u0027hypervisor_hostname\u0027) \u003d\u003d self.nodename:"},{"line_number":366,"context_line":"                        self.compute_node \u003d cn"},{"line_number":367,"context_line":"                        if self.pci_tracker:"},{"line_number":368,"context_line":"                            self.pci_tracker.set_compute_node_id(cn[\u0027id\u0027])"},{"line_number":369,"context_line":"                        break"},{"line_number":370,"context_line":"        if not self.compute_node:"},{"line_number":371,"context_line":"            # There is no compute node record yet, we need to create it"}],"source_content_type":"text/x-python","patch_set":26,"id":"1ae5cdf2_c7221102","line":368,"updated":"2014-06-23 10:24:02.000000000","message":"Why do you still need this one, if you don\u0027t need the other one?","commit_id":"7a2a07db2c720f4cadf18178ae6a968e2fee4d7a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"802ee8bd22723d926f1ac32148ad75141a36af4c","unresolved":false,"context_lines":[{"line_number":387,"context_line":"    def _create(self, context, values):"},{"line_number":388,"context_line":"        \"\"\"Create the compute node in the DB.\"\"\""},{"line_number":389,"context_line":"        # initialize load stats from existing instances:"},{"line_number":390,"context_line":"        self.compute_node[\u0027id\u0027] \u003d self.scheduler_client.create_resource("},{"line_number":391,"context_line":"            context, self.compute_node)"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    def _get_service(self, context):"}],"source_content_type":"text/x-python","patch_set":30,"id":"1ae5cdf2_6bf63bfb","line":390,"updated":"2014-06-24 09:58:50.000000000","message":"I think this needs to live in here, because of the PCI device objects having objects that are dependent on that db object.\n\nIf gantt starts updating its own datastore, then this all breaks.","commit_id":"c2b148c73dfb51ecda0e077005f2731bae2181a8"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":358,"context_line":"                return"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"            # FIXME(sbauza): We update self.compute_node by looking at Service"},{"line_number":361,"context_line":"            #                table, we should insteak ask scheduler.client"},{"line_number":362,"context_line":"            compute_node_refs \u003d service[\u0027compute_node\u0027]"},{"line_number":363,"context_line":"            if compute_node_refs:"},{"line_number":364,"context_line":"                for cn in compute_node_refs:"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_874b6e85","line":361,"updated":"2014-06-24 16:17:24.000000000","message":"why?","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":372,"context_line":"            # Need to create the ComputeNode record:"},{"line_number":373,"context_line":"            resources[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":374,"context_line":"            self.compute_node \u003d copy.deepcopy(resources)"},{"line_number":375,"context_line":"            self._create(context)"},{"line_number":376,"context_line":"            if self.pci_tracker:"},{"line_number":377,"context_line":"                self.pci_tracker.set_compute_node_id(self.compute_node[\u0027id\u0027])"},{"line_number":378,"context_line":"            LOG.info(_(\u0027Compute_service record created for %(host)s:%(node)s\u0027)"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_e75b5253","line":375,"updated":"2014-06-24 16:17:24.000000000","message":"Why do you need the deepcopy here? or more like, why is it part of this change?","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":387,"context_line":"    def _create(self, context):"},{"line_number":388,"context_line":"        \"\"\"Create the compute node in the DB.\"\"\""},{"line_number":389,"context_line":"        # initialize load stats from existing instances:"},{"line_number":390,"context_line":"        self.compute_node[\u0027id\u0027] \u003d self.conductor_api.compute_node_create("},{"line_number":391,"context_line":"            context, self.compute_node)"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    def _get_service(self, context):"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_c73c96e4","line":390,"updated":"2014-06-24 16:17:24.000000000","message":"Why have you added the id here, you just made the id a full copy of the compute node?","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":449,"context_line":""},{"line_number":450,"context_line":"    def _update(self, context, values):"},{"line_number":451,"context_line":"        \"\"\"Update Scheduler stats and"},{"line_number":452,"context_line":"           persist the PCI-only updates to the DB."},{"line_number":453,"context_line":"        \"\"\""},{"line_number":454,"context_line":"        if \"service\" in self.compute_node:"},{"line_number":455,"context_line":"            del self.compute_node[\u0027service\u0027]"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_27045a17","line":452,"updated":"2014-06-24 16:17:24.000000000","message":"Erm, thats a bit misleading, you let the scheduler client persist the stats, and also store the PCI devices using the PCI tracker.","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":453,"context_line":"        \"\"\""},{"line_number":454,"context_line":"        if \"service\" in self.compute_node:"},{"line_number":455,"context_line":"            del self.compute_node[\u0027service\u0027]"},{"line_number":456,"context_line":"        # Update locally the stats"},{"line_number":457,"context_line":"        self.compute_node.update(values)"},{"line_number":458,"context_line":"        # Persist the stats into DB for use in the Scheduler"},{"line_number":459,"context_line":"        resource_name \u003d (self.host, self.nodename)"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_0d1f7db9","line":456,"updated":"2014-06-24 16:17:24.000000000","message":"No need for all these comments, they tend to get out of sync with the code, so often best not to have them.","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":455,"context_line":"            del self.compute_node[\u0027service\u0027]"},{"line_number":456,"context_line":"        # Update locally the stats"},{"line_number":457,"context_line":"        self.compute_node.update(values)"},{"line_number":458,"context_line":"        # Persist the stats into DB for use in the Scheduler"},{"line_number":459,"context_line":"        resource_name \u003d (self.host, self.nodename)"},{"line_number":460,"context_line":"        # FIXME(sbauza): Scheduler client must know that host has been created"},{"line_number":461,"context_line":"        #                before"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_6d772109","line":458,"updated":"2014-06-24 16:17:24.000000000","message":"it might not be a DB if you send it to gantt, I would just drop the comment myself.","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":458,"context_line":"        # Persist the stats into DB for use in the Scheduler"},{"line_number":459,"context_line":"        resource_name \u003d (self.host, self.nodename)"},{"line_number":460,"context_line":"        # FIXME(sbauza): Scheduler client must know that host has been created"},{"line_number":461,"context_line":"        #                before"},{"line_number":462,"context_line":"        if not self.compute_node.get(\u0027id\u0027):"},{"line_number":463,"context_line":"            self._create(context)"},{"line_number":464,"context_line":"        values[\u0027id\u0027] \u003d self.compute_node[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_cd0d9591","line":461,"updated":"2014-06-24 16:17:24.000000000","message":"Well, only the nova client needs that, which is OK. the gantt client is using its own datastore, so its not relevant there.","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":460,"context_line":"        # FIXME(sbauza): Scheduler client must know that host has been created"},{"line_number":461,"context_line":"        #                before"},{"line_number":462,"context_line":"        if not self.compute_node.get(\u0027id\u0027):"},{"line_number":463,"context_line":"            self._create(context)"},{"line_number":464,"context_line":"        values[\u0027id\u0027] \u003d self.compute_node[\u0027id\u0027]"},{"line_number":465,"context_line":"        self.scheduler_client.update_resource_stats("},{"line_number":466,"context_line":"            context, resource_name, values)"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_cd84b5d5","line":463,"updated":"2014-06-24 16:17:24.000000000","message":"Why do you need that here? this is dead code, surely?","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":461,"context_line":"        #                before"},{"line_number":462,"context_line":"        if not self.compute_node.get(\u0027id\u0027):"},{"line_number":463,"context_line":"            self._create(context)"},{"line_number":464,"context_line":"        values[\u0027id\u0027] \u003d self.compute_node[\u0027id\u0027]"},{"line_number":465,"context_line":"        self.scheduler_client.update_resource_stats("},{"line_number":466,"context_line":"            context, resource_name, values)"},{"line_number":467,"context_line":"        if self.pci_tracker:"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_4d70a508","line":464,"updated":"2014-06-24 16:17:24.000000000","message":"Thinking about it, that exception inside the client, you could make just move that here.\n\nThis is where we need a FIXME, no need to send this id if its not the nova scheduler client, etc, etc.\n\nMaybe call it compute_node_id instead of just id? in case we end up sending that to gantt.","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"edc16ac01517ab650ed25200089064a6df392057","unresolved":false,"context_lines":[{"line_number":358,"context_line":"                return"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"            # FIXME(sbauza): We update self.compute_node by looking at Service"},{"line_number":361,"context_line":"            #                table, we should insteak ask scheduler.client"},{"line_number":362,"context_line":"            compute_node_refs \u003d service[\u0027compute_node\u0027]"},{"line_number":363,"context_line":"            if compute_node_refs:"},{"line_number":364,"context_line":"                for cn in compute_node_refs:"}],"source_content_type":"text/x-python","patch_set":32,"id":"1ae5cdf2_cbbb8ae2","line":361,"updated":"2014-06-25 19:49:47.000000000","message":"s/insteak/instead :) (though insteak does indeed sound delicious ;)","commit_id":"e84660279cbf7d509c0e8e5d76c220bfe793bbc9"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"907b782b73735206ccbe4ac3828a513a45ac0d97","unresolved":false,"context_lines":[{"line_number":358,"context_line":"                return"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"            # FIXME(sbauza): We update self.compute_node by looking at Service"},{"line_number":361,"context_line":"            #                table, we should insteak ask scheduler.client"},{"line_number":362,"context_line":"            compute_node_refs \u003d service[\u0027compute_node\u0027]"},{"line_number":363,"context_line":"            if compute_node_refs:"},{"line_number":364,"context_line":"                for cn in compute_node_refs:"}],"source_content_type":"text/x-python","patch_set":32,"id":"1ae5cdf2_e3b938ed","line":361,"in_reply_to":"1ae5cdf2_cbbb8ae2","updated":"2014-06-26 09:37:57.000000000","message":"Thanks for the catch ;-)","commit_id":"e84660279cbf7d509c0e8e5d76c220bfe793bbc9"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"b3248de88d78f494072b141714835fc394cef733","unresolved":false,"context_lines":[{"line_number":379,"context_line":"            resources[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":380,"context_line":"            self.compute_node \u003d copy.deepcopy(resources)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"        self._update(context, resources)"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def _get_service(self, context):"},{"line_number":385,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":33,"id":"1ae5cdf2_2fa82c8b","line":382,"updated":"2014-06-27 16:07:46.000000000","message":"Glad to see the create go.\n\nNote that this is the only place where resources is passed in to self._update() instead of self.compute_node. self.compute_node is updated with these values as a side effect of result of _update(). Maybe that copy could be done here instead of in _update()?","commit_id":"0b70a81f12461eb4f2dfa44f2e78bd62b0f01923"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4676eb9617304801013999bef2655b7b8adc076b","unresolved":false,"context_lines":[{"line_number":379,"context_line":"            resources[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":380,"context_line":"            self.compute_node \u003d copy.deepcopy(resources)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"        self._update(context, resources)"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"    def _get_service(self, context):"},{"line_number":385,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":33,"id":"dab895d6_4d744bfd","line":382,"in_reply_to":"1ae5cdf2_2fa82c8b","updated":"2014-06-30 09:08:59.000000000","message":"I prefer to keep all the changes (both locally and for the scheduler) in the _update method, but you\u0027re right, I will remove the deepcopy here to be more consistent and just create an empty dict","commit_id":"0b70a81f12461eb4f2dfa44f2e78bd62b0f01923"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"b3248de88d78f494072b141714835fc394cef733","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        if \"service\" in self.compute_node:"},{"line_number":446,"context_line":"            del self.compute_node[\u0027service\u0027]"},{"line_number":447,"context_line":"        # Update locally the stats"},{"line_number":448,"context_line":"        self.compute_node.update(values)"},{"line_number":449,"context_line":"        # Persist the stats into DB for use in the Scheduler"},{"line_number":450,"context_line":"        self.scheduler_client.update_resource_stats("},{"line_number":451,"context_line":"            context, (self.host, self.nodename), self.compute_node)"}],"source_content_type":"text/x-python","patch_set":33,"id":"1ae5cdf2_2fce6c2d","line":448,"updated":"2014-06-27 16:07:46.000000000","message":"See comment above - in all cases except for L382 above the self.compute_node is passed in as the values parameter. Maybe move this update out to before L382?","commit_id":"0b70a81f12461eb4f2dfa44f2e78bd62b0f01923"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4676eb9617304801013999bef2655b7b8adc076b","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        if \"service\" in self.compute_node:"},{"line_number":446,"context_line":"            del self.compute_node[\u0027service\u0027]"},{"line_number":447,"context_line":"        # Update locally the stats"},{"line_number":448,"context_line":"        self.compute_node.update(values)"},{"line_number":449,"context_line":"        # Persist the stats into DB for use in the Scheduler"},{"line_number":450,"context_line":"        self.scheduler_client.update_resource_stats("},{"line_number":451,"context_line":"            context, (self.host, self.nodename), self.compute_node)"}],"source_content_type":"text/x-python","patch_set":33,"id":"dab895d6_8d1743a3","line":448,"in_reply_to":"1ae5cdf2_2fce6c2d","updated":"2014-06-30 09:08:59.000000000","message":"I like the idea of having _update() being able to do partial updates of compute_node, not the whole dict so I prefer to leave the dict update here.\n\nThat said, to be consistent, I\u0027ll pass values and not the whole compute to scheduler L451.","commit_id":"0b70a81f12461eb4f2dfa44f2e78bd62b0f01923"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"50823d2a94570fc5b280ec62d01c861460a02921","unresolved":false,"context_lines":[{"line_number":381,"context_line":"    def _create(self, context, values):"},{"line_number":382,"context_line":"        \"\"\"Create the compute node in the DB.\"\"\""},{"line_number":383,"context_line":"        # initialize load stats from existing instances:"},{"line_number":384,"context_line":"        self.compute_node \u003d self.conductor_api.compute_node_create(context,"},{"line_number":385,"context_line":"                                                                   values)"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    def _get_service(self, context):"}],"source_content_type":"text/x-python","patch_set":36,"id":"baada198_03e854b3","side":"PARENT","line":384,"updated":"2014-07-01 11:21:55.000000000","message":"Why is the create not still here?","commit_id":"3ba1064dca65154813568c0232a6540469863695"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ff7fc80f7b779a05af5085f2aba8a183d874e393","unresolved":false,"context_lines":[{"line_number":18,"context_line":"scheduler with useful information about availability through the ComputeNode"},{"line_number":19,"context_line":"model."},{"line_number":20,"context_line":"\"\"\""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from oslo.config import cfg"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from nova.compute import claims"}],"source_content_type":"text/x-python","patch_set":37,"id":"baada198_06a67453","side":"PARENT","line":21,"updated":"2014-07-02 13:00:05.000000000","message":"Why did this change?","commit_id":"3ba1064dca65154813568c0232a6540469863695"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ff7fc80f7b779a05af5085f2aba8a183d874e393","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        if \"service\" in self.compute_node:"},{"line_number":448,"context_line":"            del self.compute_node[\u0027service\u0027]"},{"line_number":449,"context_line":"        # FIXME(sbauza) hack for current nova scheduler client,"},{"line_number":450,"context_line":"        # later, all the stats will be sent only to Gantt"},{"line_number":451,"context_line":"        self.compute_node.update(values)"},{"line_number":452,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":453,"context_line":"        values[\u0027id\u0027] \u003d self.compute_node[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":37,"id":"baada198_464eac97","line":450,"updated":"2014-07-02 13:00:05.000000000","message":"I am not sure this is accurate. Its a hack because the current code assumes it caches the compute_node, that is a problem regardless of which client you are using.","commit_id":"a928ea88c31cd7b3ced71e88ec4cd9495df3b71e"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"1f8641604179ff679b88751c64a30efe3e39bf7c","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        if \"service\" in self.compute_node:"},{"line_number":448,"context_line":"            del self.compute_node[\u0027service\u0027]"},{"line_number":449,"context_line":"        # FIXME(sbauza) hack for current nova scheduler client,"},{"line_number":450,"context_line":"        # later, all the stats will be sent only to Gantt"},{"line_number":451,"context_line":"        self.compute_node.update(values)"},{"line_number":452,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":453,"context_line":"        values[\u0027id\u0027] \u003d self.compute_node[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_67272a65","line":450,"updated":"2014-07-02 13:07:38.000000000","message":"not sure about this comment, its more that the resource tracker needs to deal without saving its old results in the compute node. It might be we don\u0027t need this update of values here, but its hard to prove that right now.","commit_id":"532fba0b4b8983f7ebf294a5425fd8918e91d5de"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2fbff7962008564f1efec639418144f759828b19","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        if \"service\" in self.compute_node:"},{"line_number":448,"context_line":"            del self.compute_node[\u0027service\u0027]"},{"line_number":449,"context_line":"        # FIXME(sbauza) hack for current nova scheduler client,"},{"line_number":450,"context_line":"        # later, all the stats will be sent only to Gantt"},{"line_number":451,"context_line":"        self.compute_node.update(values)"},{"line_number":452,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":453,"context_line":"        values[\u0027id\u0027] \u003d self.compute_node[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_398f16ce","line":450,"in_reply_to":"baada198_67272a65","updated":"2014-07-02 14:32:03.000000000","message":"Well, the main difference is that now when updating there is no return value updating the local compute_node, we async\u0027d the update in DB from the update in memory.\n\nWill propose another comment to explain that more","commit_id":"532fba0b4b8983f7ebf294a5425fd8918e91d5de"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"207a86e8a33c59cafdc3c9b0a0e4a0831b2d774f","unresolved":false,"context_lines":[{"line_number":372,"context_line":"                self.pci_tracker.set_compute_node_id(self.compute_node[\u0027id\u0027])"},{"line_number":373,"context_line":"            LOG.info(_(\u0027Compute_service record created for %(host)s:%(node)s\u0027)"},{"line_number":374,"context_line":"                    % {\u0027host\u0027: self.host, \u0027node\u0027: self.nodename})"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"        else:"},{"line_number":377,"context_line":"            # just update the record:"},{"line_number":378,"context_line":"            self._update(context, resources)"}],"source_content_type":"text/x-python","patch_set":41,"id":"baada198_d39e8eb8","line":375,"updated":"2014-07-05 20:18:34.000000000","message":"There should really be a call to the client library after a create (whether that happens here by dropping the \u0027else\u0027 or in the _create() method itself). Doesn\u0027t matter initially, but as the scheduler is split out it will miss an initial update.","commit_id":"2721260a76459652f1a5c97ae3c49df6d050faaa"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"207a86e8a33c59cafdc3c9b0a0e4a0831b2d774f","unresolved":false,"context_lines":[{"line_number":382,"context_line":"    def _create(self, context, values):"},{"line_number":383,"context_line":"        \"\"\"Create the compute node in the DB.\"\"\""},{"line_number":384,"context_line":"        # initialize load stats from existing instances:"},{"line_number":385,"context_line":"        self.compute_node \u003d self.conductor_api.compute_node_create(context,"},{"line_number":386,"context_line":"                                                                   values)"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"    def _get_service(self, context):"}],"source_content_type":"text/x-python","patch_set":41,"id":"baada198_13a56603","line":385,"updated":"2014-07-05 20:18:34.000000000","message":"see comment above, call to library could go here.","commit_id":"2721260a76459652f1a5c97ae3c49df6d050faaa"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9b3757431ff37a699b6f8cc19d7a7f1ea0287e7","unresolved":false,"context_lines":[{"line_number":18,"context_line":"scheduler with useful information about availability through the ComputeNode"},{"line_number":19,"context_line":"model."},{"line_number":20,"context_line":"\"\"\""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from oslo.config import cfg"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from nova.compute import claims"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_2385f1ce","side":"PARENT","line":21,"updated":"2014-07-18 13:33:49.000000000","message":"nit: would be good to avoid this here, but lets ignore that unless you need another change.","commit_id":"a62aae8d54ebda9206febce07680e82480b75f59"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7486ec948d5bcab75776d8e4ecad3746267427b4","unresolved":false,"context_lines":[{"line_number":18,"context_line":"scheduler with useful information about availability through the ComputeNode"},{"line_number":19,"context_line":"model."},{"line_number":20,"context_line":"\"\"\""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from oslo.config import cfg"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"from nova.compute import claims"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_de2b2a80","side":"PARENT","line":21,"in_reply_to":"baada198_2385f1ce","updated":"2014-07-18 13:36:42.000000000","message":"Done","commit_id":"a62aae8d54ebda9206febce07680e82480b75f59"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9b3757431ff37a699b6f8cc19d7a7f1ea0287e7","unresolved":false,"context_lines":[{"line_number":385,"context_line":"        # NOTE(sbauza): We don\u0027t want to miss the first creation event"},{"line_number":386,"context_line":"        values[\u0027id\u0027] \u003d self.compute_node[\u0027id\u0027]"},{"line_number":387,"context_line":"        self.scheduler_client.update_resource_stats("},{"line_number":388,"context_line":"            context, (self.host, self.nodename), values)"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    def _get_service(self, context):"},{"line_number":391,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_c3635518","line":388,"updated":"2014-07-18 13:33:49.000000000","message":"This is cool, but I don\u0027t see a unit test to check this is called.\n\nIts one extra DB call, in this version, which is fine I think.","commit_id":"5bee17582c99661c40c0ca4224a5433fe4dbb111"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7486ec948d5bcab75776d8e4ecad3746267427b4","unresolved":false,"context_lines":[{"line_number":385,"context_line":"        # NOTE(sbauza): We don\u0027t want to miss the first creation event"},{"line_number":386,"context_line":"        values[\u0027id\u0027] \u003d self.compute_node[\u0027id\u0027]"},{"line_number":387,"context_line":"        self.scheduler_client.update_resource_stats("},{"line_number":388,"context_line":"            context, (self.host, self.nodename), values)"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    def _get_service(self, context):"},{"line_number":391,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_3e3a66cd","line":388,"in_reply_to":"baada198_c3635518","updated":"2014-07-18 13:36:42.000000000","message":"Done","commit_id":"5bee17582c99661c40c0ca4224a5433fe4dbb111"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"8ca8ec9a6581dd41fbd9a862eb32f7a8866e0691","unresolved":false,"context_lines":[{"line_number":387,"context_line":"                                                                   values)"},{"line_number":388,"context_line":"        # NOTE(sbauza): We don\u0027t want to miss the first creation event"},{"line_number":389,"context_line":"        stats \u003d copy.deepcopy(values)"},{"line_number":390,"context_line":"        stats[\u0027id\u0027] \u003d self.compute_node[\u0027id\u0027]"},{"line_number":391,"context_line":"        self.scheduler_client.update_resource_stats("},{"line_number":392,"context_line":"            context, (self.host, self.nodename), stats)"},{"line_number":393,"context_line":""}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_9f73374d","line":390,"updated":"2014-07-21 11:51:11.000000000","message":"This seems to duplicate code with the call below, maybe pull into a method somewhere? not sure.","commit_id":"83519d4271d2e77948af0230988e48f69f6b2345"},{"author":{"_account_id":1981,"name":"Don Dugger","email":"n0ano@n0ano.com","username":"n0ano"},"change_message_id":"a2aebcbb1a1ab30938fcba2c915b910c6ff363b9","unresolved":false,"context_lines":[{"line_number":449,"context_line":"    def _resource_change(self, resources):"},{"line_number":450,"context_line":"        \"\"\"Check to see if any resouces have changed.\"\"\""},{"line_number":451,"context_line":"        if cmp(resources, self.old_resources) !\u003d 0:"},{"line_number":452,"context_line":"            self.old_resources \u003d copy.deepcopy(resources)"},{"line_number":453,"context_line":"            return True"},{"line_number":454,"context_line":"        return False"},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_a48364c9","line":452,"updated":"2014-07-22 05:33:53.000000000","message":"Did this just create a memory leak?  I believe that deepcopy allocates new memory so each call creates more memory that doesn\u0027t get freed.\n\nThis could be my C mindset, please tell me the Python memory management is smart enough to avoid this problem.","commit_id":"70eac0c7a357b25ec522d14b79e43c8cf1e70568"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0198cb2d3c023dfddfb3b3b3711dcc7f40bd9fa7","unresolved":false,"context_lines":[{"line_number":449,"context_line":"    def _resource_change(self, resources):"},{"line_number":450,"context_line":"        \"\"\"Check to see if any resouces have changed.\"\"\""},{"line_number":451,"context_line":"        if cmp(resources, self.old_resources) !\u003d 0:"},{"line_number":452,"context_line":"            self.old_resources \u003d copy.deepcopy(resources)"},{"line_number":453,"context_line":"            return True"},{"line_number":454,"context_line":"        return False"},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_c133d8f5","line":452,"in_reply_to":"baada198_3b62033e","updated":"2014-07-22 09:07:31.000000000","message":"Why do we need a deepcopy rather than a copy? is that because of the dicts inside the dict? Does feel a bit wasteful, but python should tidy that up fine when no longer referenced.","commit_id":"70eac0c7a357b25ec522d14b79e43c8cf1e70568"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"20a15edb9d76539a8c94a15a14e1609d469580b8","unresolved":false,"context_lines":[{"line_number":449,"context_line":"    def _resource_change(self, resources):"},{"line_number":450,"context_line":"        \"\"\"Check to see if any resouces have changed.\"\"\""},{"line_number":451,"context_line":"        if cmp(resources, self.old_resources) !\u003d 0:"},{"line_number":452,"context_line":"            self.old_resources \u003d copy.deepcopy(resources)"},{"line_number":453,"context_line":"            return True"},{"line_number":454,"context_line":"        return False"},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_3b62033e","line":452,"in_reply_to":"baada198_a48364c9","updated":"2014-07-22 08:53:22.000000000","message":"I admit this could be confusing, but let me try to explain by my best: \n\nDicts are mutable so dict_a \u003d dict_b reference same object in heap. As a consequence, changing a[foo] \u003d bar makes b[foo] equals to bar.\n\nThe problem here is that in update_usage, resources is being changed, so as old_resources was pointing to the same object, old_resources changed too. In the next iteration, old_resources was equal to resources and the problem appeared. You only circuvent that because self.compute_node was totally reallocated by former L456 (compute_node_update) so you were not hitting the bug. \n\nAs I\u0027m now only updating the same reference self.compute_node now (see L465 below), the problem appears.\n\n\n\nNow that the problem is stated, let me explain why deepcopy doesn\u0027t make a memory leak. Deepcopy provides a C deep copy (and not a shallow copy) from the dict, so it allocates memory for that new object, I agree. Once the allocation is done, it puts the reference from that new object in the heap to the left operand (here self.old_resources), so indeed that\u0027s memory addition.\n\nBut what happens to the previous object referenced by old_resources ? It gets purely and simply dereferenced but keeps its memory size in memory. The magic here is that Python is smart enough to keep track of all objects dereferenced and mark their space as \"free\". So the memory usage doesn\u0027t decrease, but new objects can take this memory space and wipe the current content.\n\nLong story short, by doing a \u003d deepcopy(b), we have roughly 3x or 4x size of dict a (the object a, the object b and the former object(s) b) but that\u0027s not increasing to a certain unsustainable amount. Evidence here : http://paste.openstack.org/show/87560/","commit_id":"70eac0c7a357b25ec522d14b79e43c8cf1e70568"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"61555163db6bae82684f5c48703c0f2c9f59f723","unresolved":false,"context_lines":[{"line_number":449,"context_line":"    def _resource_change(self, resources):"},{"line_number":450,"context_line":"        \"\"\"Check to see if any resouces have changed.\"\"\""},{"line_number":451,"context_line":"        if cmp(resources, self.old_resources) !\u003d 0:"},{"line_number":452,"context_line":"            self.old_resources \u003d copy.deepcopy(resources)"},{"line_number":453,"context_line":"            return True"},{"line_number":454,"context_line":"        return False"},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_a7ca746d","line":452,"in_reply_to":"baada198_c133d8f5","updated":"2014-07-22 10:33:48.000000000","message":"Yeah, because of the nested dicts like stats or cpu_info... As you say, there is no problem of doing deecopy here as it\u0027s being dereferenced (see my above comment)","commit_id":"70eac0c7a357b25ec522d14b79e43c8cf1e70568"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0198cb2d3c023dfddfb3b3b3711dcc7f40bd9fa7","unresolved":false,"context_lines":[{"line_number":465,"context_line":"        self.compute_node.update(values)"},{"line_number":466,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":467,"context_line":"        self._update_resource_stats(context,"},{"line_number":468,"context_line":"                                    (self.host, self.nodename), values)"},{"line_number":469,"context_line":"        if self.pci_tracker:"},{"line_number":470,"context_line":"            self.pci_tracker.save(context)"},{"line_number":471,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_de549524","line":468,"updated":"2014-07-22 09:07:31.000000000","message":"can\u0027t (self.host, self.nodename) thing just be done inside your method?","commit_id":"70eac0c7a357b25ec522d14b79e43c8cf1e70568"},{"author":{"_account_id":9569,"name":"Sergey Nikitin","email":"nikitinserv@gmail.com","username":"snikitin"},"change_message_id":"0327d7bce35bd7f75cbef8ec4fabd82f55f7e2dd","unresolved":false,"context_lines":[{"line_number":465,"context_line":"        self.compute_node.update(values)"},{"line_number":466,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":467,"context_line":"        self._update_resource_stats(context,"},{"line_number":468,"context_line":"                                    (self.host, self.nodename), values)"},{"line_number":469,"context_line":"        if self.pci_tracker:"},{"line_number":470,"context_line":"            self.pci_tracker.save(context)"},{"line_number":471,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_4cbe1f66","line":468,"in_reply_to":"baada198_de549524","updated":"2014-07-22 09:33:01.000000000","message":"+1","commit_id":"70eac0c7a357b25ec522d14b79e43c8cf1e70568"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"61555163db6bae82684f5c48703c0f2c9f59f723","unresolved":false,"context_lines":[{"line_number":465,"context_line":"        self.compute_node.update(values)"},{"line_number":466,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":467,"context_line":"        self._update_resource_stats(context,"},{"line_number":468,"context_line":"                                    (self.host, self.nodename), values)"},{"line_number":469,"context_line":"        if self.pci_tracker:"},{"line_number":470,"context_line":"            self.pci_tracker.save(context)"},{"line_number":471,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_278ca42e","line":468,"in_reply_to":"baada198_de549524","updated":"2014-07-22 10:33:48.000000000","message":"sure, will modify it","commit_id":"70eac0c7a357b25ec522d14b79e43c8cf1e70568"}],"nova/exception.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":799,"context_line":""},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"class ComputeHostNotCreated(HostNotFound):"},{"line_number":802,"context_line":"    msg_fmt \u003d _(\"Compute host needs to be created first.\")"},{"line_number":803,"context_line":""},{"line_number":804,"context_line":""},{"line_number":805,"context_line":"class HostBinaryNotFound(NotFound):"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_2d47d9bd","line":802,"updated":"2014-06-24 16:17:24.000000000","message":"maybe \"needs to be created before it can be updated\"?","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"}],"nova/scheduler/client.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"3f89567c24f673e8be27cab2e2cd501e1509b352","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            # NOTE(sbauza): Calls are done to services table, which would need"},{"line_number":90,"context_line":"            #               to be cloned if scheduler client forklifted into"},{"line_number":91,"context_line":"            #               a separate service."},{"line_number":92,"context_line":"            return self.conductor_api.service_get_by_compute_host(context,"},{"line_number":93,"context_line":"                                                                  service_name)"},{"line_number":94,"context_line":"        except exception.NotFound:"},{"line_number":95,"context_line":"            LOG.warn(_LW(\"No service record for host %s\") % service_name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_c5dcb01b","line":92,"updated":"2014-05-21 14:49:35.000000000","message":"Would be nice to convert this to using the Service object in nova/objects/service.py while you\u0027re moving stuff around.","commit_id":"71b28e54ee57e3ee696ba82ee2c1fdcec037dec6"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"3f89567c24f673e8be27cab2e2cd501e1509b352","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    def _create(self, context, name, values):"},{"line_number":98,"context_line":"        \"\"\"Create the compute node in the DB.\"\"\""},{"line_number":99,"context_line":"        # initialize load stats from existing instances:"},{"line_number":100,"context_line":"        self.compute_nodes[name] \u003d self.conductor_api.compute_node_create("},{"line_number":101,"context_line":"            context, values)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def _update(self, context, name, values):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_85daa815","line":100,"updated":"2014-05-21 14:49:35.000000000","message":"Same here.. except ComputeNode object.","commit_id":"71b28e54ee57e3ee696ba82ee2c1fdcec037dec6"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"3f89567c24f673e8be27cab2e2cd501e1509b352","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        \"\"\"Persist the compute node updates to the DB.\"\"\""},{"line_number":105,"context_line":"        if \"service\" in self.compute_nodes.get(name, {}):"},{"line_number":106,"context_line":"            del self.compute_nodes[name][\u0027service\u0027]"},{"line_number":107,"context_line":"        self.compute_nodes[name] \u003d self.conductor_api.compute_node_update("},{"line_number":108,"context_line":"            context, self.compute_nodes[name], values)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_05fe986b","line":107,"updated":"2014-05-21 14:49:35.000000000","message":"Ditto.","commit_id":"71b28e54ee57e3ee696ba82ee2c1fdcec037dec6"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"10a381fe911763d6fe61c989bb5d211656f13ea5","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from nova import conductor"},{"line_number":17,"context_line":"from nova import exception"},{"line_number":18,"context_line":"from nova.openstack.common.gettextutils import _"},{"line_number":19,"context_line":"from nova.openstack.common.gettextutils import _LW"},{"line_number":20,"context_line":"from nova.openstack.common import log as logging"},{"line_number":21,"context_line":"from nova.scheduler import rpcapi as scheduler_rpcapi"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_eecb1648","line":18,"updated":"2014-05-23 03:38:58.000000000","message":"Do we need from nova.openstack.common.gettextutils import _LI here?","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"10a381fe911763d6fe61c989bb5d211656f13ea5","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        :type name: tuple or string"},{"line_number":44,"context_line":"        :param stats: dict of stats to send to scheduler"},{"line_number":45,"context_line":"        :type stats: dict"},{"line_number":46,"context_line":"        :param node_name: Hypervisor name if different from the service_name"},{"line_number":47,"context_line":"        \"\"\""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        if isinstance(name, tuple):"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_aeae6e96","line":46,"updated":"2014-05-23 03:38:58.000000000","message":"No such parameter","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"41f1ef83e9122bf5b8b4335143b685cfa52504b1","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        :type name: tuple or string"},{"line_number":44,"context_line":"        :param stats: dict of stats to send to scheduler"},{"line_number":45,"context_line":"        :type stats: dict"},{"line_number":46,"context_line":"        :param node_name: Hypervisor name if different from the service_name"},{"line_number":47,"context_line":"        \"\"\""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        if isinstance(name, tuple):"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_21b181e1","line":46,"in_reply_to":"7adec928_aeae6e96","updated":"2014-05-23 14:28:17.000000000","message":"Done","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"10a381fe911763d6fe61c989bb5d211656f13ea5","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        else:"},{"line_number":52,"context_line":"            (service_name, node_name) \u003d (name, None)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        if self.compute_nodes.get(service_name, None) is None:"},{"line_number":55,"context_line":"            # we need a copy of the ComputeNode record:"},{"line_number":56,"context_line":"            service \u003d self._get_service(context, service_name)"},{"line_number":57,"context_line":"            if not service:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_8e8292fe","line":54,"updated":"2014-05-23 03:38:58.000000000","message":"The default value of self.compute_nodes.get(service_name) is None, so possibly we can update it to:\n\nif self.compute_nodes.get(service_name) is None:","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"41f1ef83e9122bf5b8b4335143b685cfa52504b1","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        else:"},{"line_number":52,"context_line":"            (service_name, node_name) \u003d (name, None)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        if self.compute_nodes.get(service_name, None) is None:"},{"line_number":55,"context_line":"            # we need a copy of the ComputeNode record:"},{"line_number":56,"context_line":"            service \u003d self._get_service(context, service_name)"},{"line_number":57,"context_line":"            if not service:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_61caa950","line":54,"in_reply_to":"7adec928_8e8292fe","updated":"2014-05-23 14:28:17.000000000","message":"Done","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"10a381fe911763d6fe61c989bb5d211656f13ea5","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        if self.compute_nodes.get(service_name, None) is None:"},{"line_number":55,"context_line":"            # we need a copy of the ComputeNode record:"},{"line_number":56,"context_line":"            service \u003d self._get_service(context, service_name)"},{"line_number":57,"context_line":"            if not service:"},{"line_number":58,"context_line":"                # no service record, disable resource"},{"line_number":59,"context_line":"                LOG.warning(_LW(\"No service record found for host %s,\""},{"line_number":60,"context_line":"                            \" not updating stats\") % service_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_2ebfbeab","line":57,"updated":"2014-05-23 03:38:58.000000000","message":"Do we need to catch the exception.NotFound here?","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"41f1ef83e9122bf5b8b4335143b685cfa52504b1","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        if self.compute_nodes.get(service_name, None) is None:"},{"line_number":55,"context_line":"            # we need a copy of the ComputeNode record:"},{"line_number":56,"context_line":"            service \u003d self._get_service(context, service_name)"},{"line_number":57,"context_line":"            if not service:"},{"line_number":58,"context_line":"                # no service record, disable resource"},{"line_number":59,"context_line":"                LOG.warning(_LW(\"No service record found for host %s,\""},{"line_number":60,"context_line":"                            \" not updating stats\") % service_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_e1ddd915","line":57,"in_reply_to":"7adec928_2ebfbeab","updated":"2014-05-23 14:28:17.000000000","message":"Nope, I just ported the RT code without modifying logic, and there there is no Exception raised.","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"10a381fe911763d6fe61c989bb5d211656f13ea5","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            # Need to create the ComputeNode record:"},{"line_number":72,"context_line":"            stats[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":73,"context_line":"            self._create(context, service_name, stats)"},{"line_number":74,"context_line":"            LOG.info(_(\u0027Compute_service record created for \u0027"},{"line_number":75,"context_line":"                     \u0027%(host)s:%(node)s\u0027) % {\u0027host\u0027: service_name,"},{"line_number":76,"context_line":"                                             \u0027node\u0027: node_name})"},{"line_number":77,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_0edbe21b","line":74,"updated":"2014-05-23 03:38:58.000000000","message":"_LI?","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"41f1ef83e9122bf5b8b4335143b685cfa52504b1","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            # Need to create the ComputeNode record:"},{"line_number":72,"context_line":"            stats[\u0027service_id\u0027] \u003d service[\u0027id\u0027]"},{"line_number":73,"context_line":"            self._create(context, service_name, stats)"},{"line_number":74,"context_line":"            LOG.info(_(\u0027Compute_service record created for \u0027"},{"line_number":75,"context_line":"                     \u0027%(host)s:%(node)s\u0027) % {\u0027host\u0027: service_name,"},{"line_number":76,"context_line":"                                             \u0027node\u0027: node_name})"},{"line_number":77,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_c1d61df1","line":74,"in_reply_to":"7adec928_0edbe21b","updated":"2014-05-23 14:28:17.000000000","message":"Done","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"10a381fe911763d6fe61c989bb5d211656f13ea5","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        else:"},{"line_number":78,"context_line":"            # just update the record:"},{"line_number":79,"context_line":"            self._update(context, service_name, stats)"},{"line_number":80,"context_line":"            LOG.info(_(\u0027Compute_service record updated for %(host)s:%(node)s\u0027)"},{"line_number":81,"context_line":"                     % {\u0027host\u0027: service_name, \u0027node\u0027: stats})"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        # return back the values for local use in resource tracker"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_2ed6def1","line":80,"updated":"2014-05-23 03:38:58.000000000","message":"_LI?","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"41f1ef83e9122bf5b8b4335143b685cfa52504b1","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        else:"},{"line_number":78,"context_line":"            # just update the record:"},{"line_number":79,"context_line":"            self._update(context, service_name, stats)"},{"line_number":80,"context_line":"            LOG.info(_(\u0027Compute_service record updated for %(host)s:%(node)s\u0027)"},{"line_number":81,"context_line":"                     % {\u0027host\u0027: service_name, \u0027node\u0027: stats})"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        # return back the values for local use in resource tracker"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_e104f97f","line":80,"in_reply_to":"7adec928_2ed6def1","updated":"2014-05-23 14:28:17.000000000","message":"Done","commit_id":"3ca432fe21cd6b9bd42f4243379e555fde26f3b6"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"eac0e9af687903c2cb2f4bfea090766556af674d","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    def __init__(self):"},{"line_number":30,"context_line":"        self.scheduler_rpcapi \u003d scheduler_rpcapi.SchedulerAPI()"},{"line_number":31,"context_line":"        self.conductor_api \u003d conductor.API()"},{"line_number":32,"context_line":"        self.compute_nodes \u003d {}"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def select_destinations(self, context, request_spec, filter_properties):"},{"line_number":35,"context_line":"        return self.scheduler_rpcapi.select_destinations("}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_314561b3","line":32,"updated":"2014-06-02 15:15:31.000000000","message":"Yeah, it feels bad having this state in here, but its a good first step I feel.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":8690,"name":"Khanh-Toan TRAN","email":"khtoantran@gmail.com","username":"toan-tran"},"change_message_id":"4bb65e0bcbb990ee5f51bd2d8d78b34df1c59fd7","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    def __init__(self):"},{"line_number":30,"context_line":"        self.scheduler_rpcapi \u003d scheduler_rpcapi.SchedulerAPI()"},{"line_number":31,"context_line":"        self.conductor_api \u003d conductor.API()"},{"line_number":32,"context_line":"        self.compute_nodes \u003d {}"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def select_destinations(self, context, request_spec, filter_properties):"},{"line_number":35,"context_line":"        return self.scheduler_rpcapi.select_destinations("}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_b8a217ac","line":32,"in_reply_to":"1ae5cdf2_17e210d5","updated":"2014-06-03 07:50:31.000000000","message":"Please desribe/document the \u0027compute_nodes\u0027 structure.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0120c5dac953ab2288a94e7d9f4bba0ed57ab20b","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    def __init__(self):"},{"line_number":30,"context_line":"        self.scheduler_rpcapi \u003d scheduler_rpcapi.SchedulerAPI()"},{"line_number":31,"context_line":"        self.conductor_api \u003d conductor.API()"},{"line_number":32,"context_line":"        self.compute_nodes \u003d {}"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def select_destinations(self, context, request_spec, filter_properties):"},{"line_number":35,"context_line":"        return self.scheduler_rpcapi.select_destinations("}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_17e210d5","line":32,"in_reply_to":"1ae5cdf2_314561b3","updated":"2014-06-02 16:42:13.000000000","message":"Indeed, but I prefer moving towards and rewrite this later.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f5877d718f5f729eabab0867bca465ac6e3ad7","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    def __init__(self):"},{"line_number":30,"context_line":"        self.scheduler_rpcapi \u003d scheduler_rpcapi.SchedulerAPI()"},{"line_number":31,"context_line":"        self.conductor_api \u003d conductor.API()"},{"line_number":32,"context_line":"        self.compute_nodes \u003d {}"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def select_destinations(self, context, request_spec, filter_properties):"},{"line_number":35,"context_line":"        return self.scheduler_rpcapi.select_destinations("}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_d1e22b9f","line":32,"in_reply_to":"1ae5cdf2_b8a217ac","updated":"2014-06-04 12:10:09.000000000","message":"I finally removed that cache, not need to keep it there as there is already one in RT, and also this cache is buggy as it\u0027s not taking in account node_name if so.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":8690,"name":"Khanh-Toan TRAN","email":"khtoantran@gmail.com","username":"toan-tran"},"change_message_id":"4bb65e0bcbb990ee5f51bd2d8d78b34df1c59fd7","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        if self.compute_nodes.get(service_name) is None:"},{"line_number":54,"context_line":"            # we need a copy of the ComputeNode record:"},{"line_number":55,"context_line":"            service \u003d self._get_service(context, service_name)"},{"line_number":56,"context_line":"            if not service:"},{"line_number":57,"context_line":"                # no service record, disable resource"},{"line_number":58,"context_line":"                LOG.warning(_LW(\"No service record found for host %s,\""}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_183a2b36","line":55,"updated":"2014-06-03 07:50:31.000000000","message":"Please recheck this. _get_service uses the node\u0027s name as the last argument, not service\u0027s name.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"eac0e9af687903c2cb2f4bfea090766556af674d","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            self._create(context, service_name, stats)"},{"line_number":73,"context_line":"            LOG.info(_LI(\u0027Compute_service record created for \u0027"},{"line_number":74,"context_line":"                     \u0027%(host)s:%(node)s\u0027) % {\u0027host\u0027: service_name,"},{"line_number":75,"context_line":"                                             \u0027node\u0027: node_name})"},{"line_number":76,"context_line":"        else:"},{"line_number":77,"context_line":"            # just update the record:"},{"line_number":78,"context_line":"            self._update(context, service_name, stats)"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_44006d01","line":75,"updated":"2014-06-02 15:15:31.000000000","message":"any way we can push this into something like \"get_service\"?\n\nfeels like it should be:\n* check db entry exists, create if needed\n* update stats\n\nand this doesn\u0027t really read that way.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0120c5dac953ab2288a94e7d9f4bba0ed57ab20b","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            self._create(context, service_name, stats)"},{"line_number":73,"context_line":"            LOG.info(_LI(\u0027Compute_service record created for \u0027"},{"line_number":74,"context_line":"                     \u0027%(host)s:%(node)s\u0027) % {\u0027host\u0027: service_name,"},{"line_number":75,"context_line":"                                             \u0027node\u0027: node_name})"},{"line_number":76,"context_line":"        else:"},{"line_number":77,"context_line":"            # just update the record:"},{"line_number":78,"context_line":"            self._update(context, service_name, stats)"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_37b2ace6","line":75,"in_reply_to":"1ae5cdf2_44006d01","updated":"2014-06-02 16:42:13.000000000","message":"Will provide another way to do this","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":8690,"name":"Khanh-Toan TRAN","email":"khtoantran@gmail.com","username":"toan-tran"},"change_message_id":"4bb65e0bcbb990ee5f51bd2d8d78b34df1c59fd7","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        # return back the values for local use in resource tracker"},{"line_number":84,"context_line":"        return self.compute_nodes[service_name]"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def _get_service(self, context, service_name):"},{"line_number":87,"context_line":"        \"\"\"Get compute service per compute name.\"\"\""},{"line_number":88,"context_line":"        try:"},{"line_number":89,"context_line":"            # NOTE(sbauza): Calls are done to services table, which would need"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_38f9a780","line":86,"updated":"2014-06-03 07:50:31.000000000","message":"third arg should be \u0027compute_name\u0027","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f5877d718f5f729eabab0867bca465ac6e3ad7","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        # return back the values for local use in resource tracker"},{"line_number":84,"context_line":"        return self.compute_nodes[service_name]"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def _get_service(self, context, service_name):"},{"line_number":87,"context_line":"        \"\"\"Get compute service per compute name.\"\"\""},{"line_number":88,"context_line":"        try:"},{"line_number":89,"context_line":"            # NOTE(sbauza): Calls are done to services table, which would need"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_91550352","line":86,"in_reply_to":"1ae5cdf2_38f9a780","updated":"2014-06-04 12:10:09.000000000","message":"As discussed, not, this is service_name. New refactor will be clearer to review","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"36d2bd8b7abbf0b95d854609363cb6a176f8dccb","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            # NOTE(sbauza): Calls are done to services table, which would need"},{"line_number":81,"context_line":"            #               to be cloned if scheduler client forklifted into"},{"line_number":82,"context_line":"            #               a separate service."},{"line_number":83,"context_line":"            service \u003d service_obj.Service.get_by_compute_host(context,"},{"line_number":84,"context_line":"                                                              service_name)"},{"line_number":85,"context_line":"        except exception.NotFound:"},{"line_number":86,"context_line":"            LOG.warn(_LW(\"No service record for host %s\") % service_name)"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ae5cdf2_d3546123","line":83,"updated":"2014-06-09 17:27:48.000000000","message":"This feels bad, surely we should only access the ComputeNode in here?","commit_id":"caf7b95e01fec22183d1ee5b88d5b8297aaa8c52"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"016b369165a720825e08c6483717afa829fcc3bb","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            # NOTE(sbauza): Calls are done to services table, which would need"},{"line_number":81,"context_line":"            #               to be cloned if scheduler client forklifted into"},{"line_number":82,"context_line":"            #               a separate service."},{"line_number":83,"context_line":"            service \u003d service_obj.Service.get_by_compute_host(context,"},{"line_number":84,"context_line":"                                                              service_name)"},{"line_number":85,"context_line":"        except exception.NotFound:"},{"line_number":86,"context_line":"            LOG.warn(_LW(\"No service record for host %s\") % service_name)"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ae5cdf2_96448275","line":83,"in_reply_to":"1ae5cdf2_d3546123","updated":"2014-06-09 20:02:34.000000000","message":"Ergh, we discussed about keeping Service table accessed by Scheduler in the previous discussions and said that when Gantt would be forklifted, it would have to access its own Service table.\n\nI can understand that you changed your PoV, I just need to know if we consider this a blocker or not, so I need to provide another patchset with changes as you requested.","commit_id":"caf7b95e01fec22183d1ee5b88d5b8297aaa8c52"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"23e7b059ff7d2c4c9e06ee00f96ed820bf83ce12","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            LOG.info(_LI(\u0027Compute_service record updated for \u0027"},{"line_number":58,"context_line":"                     \u0027%s\u0027) % resource.get(\u0027hypervisor_hostname\u0027))"},{"line_number":59,"context_line":"        # return back the values for local use in resourc"},{"line_number":60,"context_line":"        return values"}],"source_content_type":"text/x-python","patch_set":20,"id":"1ae5cdf2_972521b0","line":60,"updated":"2014-06-18 11:02:58.000000000","message":"I don\u0027t think this should return these values here.\n\nSince this change is about getting the interface correct.\n\nI think its better to move the compute_node_create back into the resource tracker, until we are able to move the PCI tracker into here.\n\nSorting out the PCI tracker to work with the gantt interface, is probably the next step that is required here.","commit_id":"f27ceba283dfbd7a9ec27e580940f1925cbc4e0a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"72e2c600f7d448d331743ed373aee77010fd4ccf","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            LOG.info(_LI(\u0027Compute_service record updated for \u0027"},{"line_number":58,"context_line":"                     \u0027%s\u0027) % resource.get(\u0027hypervisor_hostname\u0027))"},{"line_number":59,"context_line":"        # return back the values for local use in resourc"},{"line_number":60,"context_line":"        return values"}],"source_content_type":"text/x-python","patch_set":20,"id":"1ae5cdf2_5bf54d4f","line":60,"in_reply_to":"1ae5cdf2_972521b0","updated":"2014-06-19 15:52:18.000000000","message":"Discussed over IRC with you, we agreed on only removing the return value\nPCI stats are updated in RT too, so that still works, and RT is only managing a dict, sched-cli is only there for persistence purposes","commit_id":"f27ceba283dfbd7a9ec27e580940f1925cbc4e0a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"aee35e335b6ab11452907cb371c1fc47d49dd42f","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                values \u003d None"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        # Inform clients if the updates performed smoothly"},{"line_number":64,"context_line":"        return True if values is not None else False"}],"source_content_type":"text/x-python","patch_set":23,"id":"1ae5cdf2_2991ff51","line":64,"updated":"2014-06-20 08:53:12.000000000","message":"Should we not raise an exception if we failed to make the updates correctly. That seems more pythonic.\n\nAnyways, when would you expect this to fail like this? Surely the update happens or doesn\u0027t happen? You only really care about the values returned if you are doing a partial update, and someone else might have done and update in the meantime, but thats not really going to happen here, unless I am missing something?","commit_id":"f917f7bd63f609372f946a13c77914fd7e1e86ed"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c04684f9cb75d12e815acd32bad669bf30743f0","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    def __init__(self):"},{"line_number":29,"context_line":"        self.scheduler_rpcapi \u003d scheduler_rpcapi.SchedulerAPI()"},{"line_number":30,"context_line":"        self.conductor_api \u003d conductor.API()"},{"line_number":31,"context_line":"        self.resources \u003d {}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def select_destinations(self, context, request_spec, filter_properties):"},{"line_number":34,"context_line":"        return self.scheduler_rpcapi.select_destinations("}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_b032c25b","line":31,"updated":"2014-06-20 16:55:51.000000000","message":"I think if you just store the id in resources, and rename to computenode_ids, this will become much simpler.","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"5b6eaaf771dd170a07eac6ccf4208db973b08d5a","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    def __init__(self):"},{"line_number":29,"context_line":"        self.scheduler_rpcapi \u003d scheduler_rpcapi.SchedulerAPI()"},{"line_number":30,"context_line":"        self.conductor_api \u003d conductor.API()"},{"line_number":31,"context_line":"        self.resources \u003d {}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def select_destinations(self, context, request_spec, filter_properties):"},{"line_number":34,"context_line":"        return self.scheduler_rpcapi.select_destinations("}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_6f3839ef","line":31,"in_reply_to":"1ae5cdf2_b032c25b","updated":"2014-06-23 08:12:44.000000000","message":"Done","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c04684f9cb75d12e815acd32bad669bf30743f0","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            values \u003d self.conductor_api.compute_node_create(context, stats)"},{"line_number":61,"context_line":"            LOG.info(_LI(\u0027Compute_service record created for \u0027"},{"line_number":62,"context_line":"                     \u0027%s:%s\u0027) % (host, node))"},{"line_number":63,"context_line":"            self.resources.update({name: values})"},{"line_number":64,"context_line":"        else:"},{"line_number":65,"context_line":"            # just update the record:"},{"line_number":66,"context_line":"            values \u003d self.conductor_api.compute_node_update("}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_70611a38","line":63,"updated":"2014-06-20 16:55:51.000000000","message":"in this case, you need the service_id, so make sure you send it here...","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"5b6eaaf771dd170a07eac6ccf4208db973b08d5a","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            values \u003d self.conductor_api.compute_node_create(context, stats)"},{"line_number":61,"context_line":"            LOG.info(_LI(\u0027Compute_service record created for \u0027"},{"line_number":62,"context_line":"                     \u0027%s:%s\u0027) % (host, node))"},{"line_number":63,"context_line":"            self.resources.update({name: values})"},{"line_number":64,"context_line":"        else:"},{"line_number":65,"context_line":"            # just update the record:"},{"line_number":66,"context_line":"            values \u003d self.conductor_api.compute_node_update("}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_6a3e678d","line":63,"in_reply_to":"1ae5cdf2_70611a38","updated":"2014-06-23 08:12:44.000000000","message":"Changed to only caching ids","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c04684f9cb75d12e815acd32bad669bf30743f0","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        else:"},{"line_number":65,"context_line":"            # just update the record:"},{"line_number":66,"context_line":"            values \u003d self.conductor_api.compute_node_update("},{"line_number":67,"context_line":"                context, self.resources[name], stats)"},{"line_number":68,"context_line":"            LOG.info(_LI(\u0027Compute_service record updated for \u0027"},{"line_number":69,"context_line":"                     \u0027%s:%s\u0027) % (host, node))"},{"line_number":70,"context_line":"            self.resources[name].update(values)"}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_506fbe27","line":67,"updated":"2014-06-20 16:55:51.000000000","message":"for the second param, only the id is used in the conductor, please just only send a dict with id in it, see:\nhttps://github.com/openstack/nova/blob/master/nova/conductor/manager.py#L487\n\nI think that will really help simplify this...\n\nWe don\u0027t need to send the service_id for these updates, so we could strip that out of the stats here, because we don\u0027t really want to update that everytime, but I guess we could.","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"5b6eaaf771dd170a07eac6ccf4208db973b08d5a","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        else:"},{"line_number":65,"context_line":"            # just update the record:"},{"line_number":66,"context_line":"            values \u003d self.conductor_api.compute_node_update("},{"line_number":67,"context_line":"                context, self.resources[name], stats)"},{"line_number":68,"context_line":"            LOG.info(_LI(\u0027Compute_service record updated for \u0027"},{"line_number":69,"context_line":"                     \u0027%s:%s\u0027) % (host, node))"},{"line_number":70,"context_line":"            self.resources[name].update(values)"}],"source_content_type":"text/x-python","patch_set":25,"id":"1ae5cdf2_8a43b312","line":67,"in_reply_to":"1ae5cdf2_506fbe27","updated":"2014-06-23 08:12:44.000000000","message":"Done","commit_id":"e845f58abcfdd0133facb8d77e3b08a9f1966ed1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f4fe5e7a0184f676d26c931dad30743a0fd7ffaf","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        # Repopulate the cache when compute node restart"},{"line_number":54,"context_line":"        if stats.get(\u0027id\u0027) is not None and name not in self.compute_node_ids:"},{"line_number":55,"context_line":"            self.compute_node_ids.update({name: stats[\u0027id\u0027]})"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        (host, node) \u003d name"},{"line_number":58,"context_line":"        if name not in self.compute_node_ids:"}],"source_content_type":"text/x-python","patch_set":26,"id":"1ae5cdf2_27be55af","line":55,"updated":"2014-06-23 10:21:40.000000000","message":"Not sure I get how this works, where does the id come from after the restart?","commit_id":"7a2a07db2c720f4cadf18178ae6a968e2fee4d7a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c1ff2096c6b6c8490a37e87c1beb6ecc42269552","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        # Repopulate the cache when compute node restart"},{"line_number":54,"context_line":"        if stats.get(\u0027id\u0027) is not None and name not in self.compute_node_ids:"},{"line_number":55,"context_line":"            self.compute_node_ids.update({name: stats[\u0027id\u0027]})"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        (host, node) \u003d name"},{"line_number":58,"context_line":"        if name not in self.compute_node_ids:"}],"source_content_type":"text/x-python","patch_set":26,"id":"1ae5cdf2_470fe18b","line":55,"in_reply_to":"1ae5cdf2_27be55af","updated":"2014-06-23 10:23:06.000000000","message":"oh, sorry, I see where you get that now, eek.","commit_id":"7a2a07db2c720f4cadf18178ae6a968e2fee4d7a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"802ee8bd22723d926f1ac32148ad75141a36af4c","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # TODO(sbauza): Look at compute_node with id and return values"},{"line_number":53,"context_line":"        raise NotImplementedError"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def delete_resource(self, context, id):"},{"line_number":56,"context_line":"        \"Delete a single resource.\""},{"line_number":57,"context_line":"        self.conductor_api.compute_node_delete(context, {\u0027id\u0027: id})"}],"source_content_type":"text/x-python","patch_set":30,"id":"1ae5cdf2_ebb32b4b","line":55,"updated":"2014-06-24 09:58:50.000000000","message":"I don\u0027t understand the CRUD interface here, this is very different from the idea presented in the spec.","commit_id":"c2b148c73dfb51ecda0e077005f2731bae2181a8"},{"author":{"_account_id":9569,"name":"Sergey Nikitin","email":"nikitinserv@gmail.com","username":"snikitin"},"change_message_id":"858ebd227884a5023cfb59f85c450f806f868931","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    def update_resource_stats(self, context, name, stats):"},{"line_number":37,"context_line":"        \"\"\"Updates stats for the desired resource.\"\"\""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        if not stats.get(\u0027id\u0027):"},{"line_number":40,"context_line":"            raise exception.ComputeHostNotCreated()"},{"line_number":41,"context_line":"        compute_node_id \u003d stats[\u0027id\u0027]"},{"line_number":42,"context_line":"        del stats[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_249d3d0b","line":39,"updated":"2014-06-24 13:44:26.000000000","message":"If I am not mistaken here we want to know that \u0027stats\u0027 has no key \u0027id\u0027. I think it would be better to use follow check:\n\n if \u0027id\u0027 not in stats:\n\nbecause \"if not stats.get(\u0027id\u0027)\" could be True even stats contains key \u0027id\u0027.","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    def update_resource_stats(self, context, name, stats):"},{"line_number":37,"context_line":"        \"\"\"Updates stats for the desired resource.\"\"\""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        if not stats.get(\u0027id\u0027):"},{"line_number":40,"context_line":"            raise exception.ComputeHostNotCreated()"},{"line_number":41,"context_line":"        compute_node_id \u003d stats[\u0027id\u0027]"},{"line_number":42,"context_line":"        del stats[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_4747a6a3","line":39,"in_reply_to":"1ae5cdf2_249d3d0b","updated":"2014-06-24 16:17:24.000000000","message":"+1","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"edc16ac01517ab650ed25200089064a6df392057","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def __init__(self):"},{"line_number":29,"context_line":"        self.scheduler_rpcapi \u003d scheduler_rpcapi.SchedulerAPI()"},{"line_number":30,"context_line":"        self.conductor_api \u003d conductor.API()"},{"line_number":31,"context_line":"        self.compute_node_ids \u003d {}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def select_destinations(self, context, request_spec, filter_properties):"}],"source_content_type":"text/x-python","patch_set":32,"id":"1ae5cdf2_6bab5675","line":30,"updated":"2014-06-25 19:49:47.000000000","message":"Instead of having a conductor_api, isn\u0027t the direction now in Nova to just pass nova.objects to methods and let the underlying nova.object remoting take care of speaking with the conductor?","commit_id":"e84660279cbf7d509c0e8e5d76c220bfe793bbc9"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"907b782b73735206ccbe4ac3828a513a45ac0d97","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def __init__(self):"},{"line_number":29,"context_line":"        self.scheduler_rpcapi \u003d scheduler_rpcapi.SchedulerAPI()"},{"line_number":30,"context_line":"        self.conductor_api \u003d conductor.API()"},{"line_number":31,"context_line":"        self.compute_node_ids \u003d {}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def select_destinations(self, context, request_spec, filter_properties):"}],"source_content_type":"text/x-python","patch_set":32,"id":"1ae5cdf2_63252809","line":30,"in_reply_to":"1ae5cdf2_6bab5675","updated":"2014-06-26 09:37:57.000000000","message":"That\u0027s a really good point, and I proposed this alternative in a former patchset, but John G. and I agreed on leaving calls to conductor for this patch in order to reduce the volume of the change and do the move to objects in a separate patch.","commit_id":"e84660279cbf7d509c0e8e5d76c220bfe793bbc9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"edc16ac01517ab650ed25200089064a6df392057","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        (host, node) \u003d name"},{"line_number":58,"context_line":"        if name not in self.compute_node_ids:"},{"line_number":59,"context_line":"            # Need to create the ComputeNode record:"},{"line_number":60,"context_line":"            values \u003d self.conductor_api.compute_node_create(context, stats)"},{"line_number":61,"context_line":"            LOG.info(_LI(\u0027Compute_service record created for \u0027"},{"line_number":62,"context_line":"                     \u0027%s\u0027) % str(name))"},{"line_number":63,"context_line":"            self.compute_node_ids.update({name: values[\u0027id\u0027]})"}],"source_content_type":"text/x-python","patch_set":32,"id":"1ae5cdf2_2bcf8e58","line":60,"updated":"2014-06-25 19:49:47.000000000","message":"We should be storing a collection of nova.objects.compute_node.ComputeNode objects, not a list of UUIDs, and calling save() and create() on those objects. That way, the conductor_api attribute is not necessary and the remoting inherent in the nova.object will handle all of the RPC stuff if necessary.","commit_id":"e84660279cbf7d509c0e8e5d76c220bfe793bbc9"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"907b782b73735206ccbe4ac3828a513a45ac0d97","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        (host, node) \u003d name"},{"line_number":58,"context_line":"        if name not in self.compute_node_ids:"},{"line_number":59,"context_line":"            # Need to create the ComputeNode record:"},{"line_number":60,"context_line":"            values \u003d self.conductor_api.compute_node_create(context, stats)"},{"line_number":61,"context_line":"            LOG.info(_LI(\u0027Compute_service record created for \u0027"},{"line_number":62,"context_line":"                     \u0027%s\u0027) % str(name))"},{"line_number":63,"context_line":"            self.compute_node_ids.update({name: values[\u0027id\u0027]})"}],"source_content_type":"text/x-python","patch_set":32,"id":"1ae5cdf2_e37858fa","line":60,"in_reply_to":"1ae5cdf2_2bcf8e58","updated":"2014-06-26 09:37:57.000000000","message":"This alternative will be done in a separate patch.","commit_id":"e84660279cbf7d509c0e8e5d76c220bfe793bbc9"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"b3248de88d78f494072b141714835fc394cef733","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        (host, node) \u003d name"},{"line_number":58,"context_line":"        if name not in self.compute_node_ids:"},{"line_number":59,"context_line":"            # Need to create the ComputeNode record:"},{"line_number":60,"context_line":"            values \u003d self.conductor_api.compute_node_create(context, stats)"},{"line_number":61,"context_line":"            LOG.info(_LI(\u0027Compute_service record created for \u0027"},{"line_number":62,"context_line":"                     \u0027%s\u0027) % str(name))"},{"line_number":63,"context_line":"            self.compute_node_ids.update({name: values[\u0027id\u0027]})"}],"source_content_type":"text/x-python","patch_set":33,"id":"1ae5cdf2_2206831c","line":60,"updated":"2014-06-27 16:07:46.000000000","message":"In resource_tracker.py the values of values[\u0027stats\u0027] is a json blob, same for a few others (pci_stats, supported_instances, metrics...). The conversion of these to a json blob should really be done as close to here as possible as its only so they can be saved by this method. Later, when this method is removed (by change to objects or by replacement with something else) those will need to be changed too.","commit_id":"0b70a81f12461eb4f2dfa44f2e78bd62b0f01923"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4676eb9617304801013999bef2655b7b8adc076b","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        (host, node) \u003d name"},{"line_number":58,"context_line":"        if name not in self.compute_node_ids:"},{"line_number":59,"context_line":"            # Need to create the ComputeNode record:"},{"line_number":60,"context_line":"            values \u003d self.conductor_api.compute_node_create(context, stats)"},{"line_number":61,"context_line":"            LOG.info(_LI(\u0027Compute_service record created for \u0027"},{"line_number":62,"context_line":"                     \u0027%s\u0027) % str(name))"},{"line_number":63,"context_line":"            self.compute_node_ids.update({name: values[\u0027id\u0027]})"}],"source_content_type":"text/x-python","patch_set":33,"id":"dab895d6_4d4b6bb0","line":60,"in_reply_to":"1ae5cdf2_2206831c","updated":"2014-06-30 09:08:59.000000000","message":"See L48, is this what you mention ?","commit_id":"0b70a81f12461eb4f2dfa44f2e78bd62b0f01923"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"50823d2a94570fc5b280ec62d01c861460a02921","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            values \u003d self.conductor_api.compute_node_create(context, stats)"},{"line_number":60,"context_line":"            LOG.info(_LI(\u0027Compute_service record created for \u0027"},{"line_number":61,"context_line":"                     \u0027%s\u0027) % str(name))"},{"line_number":62,"context_line":"            self.compute_node_ids.update({name: values[\u0027id\u0027]})"},{"line_number":63,"context_line":"        else:"},{"line_number":64,"context_line":"            # just update the record:"},{"line_number":65,"context_line":"            self.conductor_api.compute_node_update("}],"source_content_type":"text/x-python","patch_set":36,"id":"baada198_83f2a498","line":62,"updated":"2014-07-01 11:21:55.000000000","message":"Why is this needed?\n\nThe PCI tracker still needs to fetch the compute node here:\nhttps://review.openstack.org/#/c/102298/3/nova/compute/resource_tracker.py\n\nso when you replace this client with the gantt client, that will be accessing its own DB and not the gantt DB, then you break half of Nova.\n\nThis is the wrong split.","commit_id":"c826c228d28ae260936060a111c0612e0cfca0d4"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ff7fc80f7b779a05af5085f2aba8a183d874e393","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def select_destinations(self, context, request_spec, filter_properties):"},{"line_number":34,"context_line":"        return self.scheduler_rpcapi.select_destinations("},{"line_number":35,"context_line":"            context, request_spec, filter_properties)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def update_resource_stats(self, context, name, stats):"},{"line_number":38,"context_line":"        \"\"\"Creates or updates stats for the desired service."}],"source_content_type":"text/x-python","patch_set":37,"id":"baada198_46cb0c1e","line":35,"updated":"2014-07-02 13:00:05.000000000","message":"If you add this, can you make the changes to start using this, or better, just add this in a later change please?","commit_id":"a928ea88c31cd7b3ced71e88ec4cd9495df3b71e"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ff7fc80f7b779a05af5085f2aba8a183d874e393","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        # As we need to persist the stats, JSONify them or we get an Exception"},{"line_number":48,"context_line":"        stats \u003d jsonutils.to_primitive(stats)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        if \u0027id\u0027 in stats:"},{"line_number":51,"context_line":"            compute_node_id \u003d stats[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":37,"id":"baada198_86ec4491","line":48,"updated":"2014-07-02 13:00:05.000000000","message":"This seems very odd, why do you have this new bit of code here? The old code worked without this here, why do you need it in this new version?","commit_id":"a928ea88c31cd7b3ced71e88ec4cd9495df3b71e"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"1f8641604179ff679b88751c64a30efe3e39bf7c","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def select_destinations(self, context, request_spec, filter_properties):"},{"line_number":34,"context_line":"        return self.scheduler_rpcapi.select_destinations("},{"line_number":35,"context_line":"            context, request_spec, filter_properties)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def update_resource_stats(self, context, name, stats):"},{"line_number":38,"context_line":"        \"\"\"Creates or updates stats for the desired service."}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_a7f8627d","line":35,"updated":"2014-07-02 13:07:38.000000000","message":"can we either:\n\n* add this in a later change, were we start using\n* start using this now\n\nI prefer the first one I think.","commit_id":"532fba0b4b8983f7ebf294a5425fd8918e91d5de"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2fbff7962008564f1efec639418144f759828b19","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def select_destinations(self, context, request_spec, filter_properties):"},{"line_number":34,"context_line":"        return self.scheduler_rpcapi.select_destinations("},{"line_number":35,"context_line":"            context, request_spec, filter_properties)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def update_resource_stats(self, context, name, stats):"},{"line_number":38,"context_line":"        \"\"\"Creates or updates stats for the desired service."}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_19309200","line":35,"in_reply_to":"baada198_a7f8627d","updated":"2014-07-02 14:32:03.000000000","message":"Done","commit_id":"532fba0b4b8983f7ebf294a5425fd8918e91d5de"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"1f8641604179ff679b88751c64a30efe3e39bf7c","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        # As we need to persist the stats, JSONify them or we get an Exception"},{"line_number":48,"context_line":"        stats \u003d jsonutils.to_primitive(stats)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        if \u0027id\u0027 in stats:"},{"line_number":51,"context_line":"            compute_node_id \u003d stats[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_47a5c6b3","line":48,"updated":"2014-07-02 13:07:38.000000000","message":"I don\u0027t understand why an extra function call means you now need this call to be here. Is this left behind from some old change?","commit_id":"532fba0b4b8983f7ebf294a5425fd8918e91d5de"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2fbff7962008564f1efec639418144f759828b19","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        # As we need to persist the stats, JSONify them or we get an Exception"},{"line_number":48,"context_line":"        stats \u003d jsonutils.to_primitive(stats)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        if \u0027id\u0027 in stats:"},{"line_number":51,"context_line":"            compute_node_id \u003d stats[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_72860367","line":48,"in_reply_to":"baada198_47a5c6b3","updated":"2014-07-02 14:32:03.000000000","message":"My bad, that\u0027s coming from an old change, but the side effect was hiding the problem on your patch where you delete stats[\u0027id\u0027] so you delete in memory compute_node[\u0027id\u0027]","commit_id":"532fba0b4b8983f7ebf294a5425fd8918e91d5de"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c2cd51f52731a6b19fbf06018e656c0147f93b32","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2014 Openstack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_45102d4e","line":1,"updated":"2014-07-18 12:13:53.000000000","message":"please double check the policy, you are not consistent on the files you have added here.","commit_id":"7a70f93996dd8daa0492e47adae467df6068d807"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"b8eab6ba5792c74fe9cc8ba4dac10cee08891964","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2014 Openstack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_c3e9951b","line":1,"in_reply_to":"baada198_45102d4e","updated":"2014-07-18 13:12:17.000000000","message":"sure, I\u0027ll change to Red Hat","commit_id":"7a70f93996dd8daa0492e47adae467df6068d807"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c2cd51f52731a6b19fbf06018e656c0147f93b32","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    \"\"\"Client library for placing calls to the scheduler.\"\"\""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def __init__(self):"},{"line_number":31,"context_line":"        self.scheduler_rpcapi \u003d scheduler_rpcapi.SchedulerAPI()"},{"line_number":32,"context_line":"        self.conductor_api \u003d conductor.API()"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def update_resource_stats(self, context, name, stats):"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_d2eec121","line":31,"updated":"2014-07-18 12:13:53.000000000","message":"oops, this is unused, please remove it.","commit_id":"7a70f93996dd8daa0492e47adae467df6068d807"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"b8eab6ba5792c74fe9cc8ba4dac10cee08891964","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    \"\"\"Client library for placing calls to the scheduler.\"\"\""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def __init__(self):"},{"line_number":31,"context_line":"        self.scheduler_rpcapi \u003d scheduler_rpcapi.SchedulerAPI()"},{"line_number":32,"context_line":"        self.conductor_api \u003d conductor.API()"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def update_resource_stats(self, context, name, stats):"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_0379cd81","line":31,"in_reply_to":"baada198_d2eec121","updated":"2014-07-18 13:12:17.000000000","message":"Dammit... good catch... \n\nDone","commit_id":"7a70f93996dd8daa0492e47adae467df6068d807"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"86567d68eaf58da6b71f620b2901b44b07675d16","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        :param context: local context"},{"line_number":38,"context_line":"        :param name: name of resource to update"},{"line_number":39,"context_line":"        :type name: immutable (str or tuple)"},{"line_number":40,"context_line":"        :param stats: updated stats to send to scheduler"},{"line_number":41,"context_line":"        :type stats: dict"},{"line_number":42,"context_line":"        \"\"\""},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_5677a59f","line":40,"updated":"2014-07-07 18:53:27.000000000","message":"Please, please can we not send this random dict of stuff in our APIs? While we\u0027re at this worthy task of pulling the scheduler client lib out of Nova, can we do the needful and actually have real, descriptive objects passed to these API methods instead of a random collection of nested dicts?\n\nSee my attempt at outlining these real objects that represent resource usage and request specs here:\n\nhttps://review.openstack.org/#/c/103598/","commit_id":"7a70f93996dd8daa0492e47adae467df6068d807"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c2cd51f52731a6b19fbf06018e656c0147f93b32","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        :param context: local context"},{"line_number":38,"context_line":"        :param name: name of resource to update"},{"line_number":39,"context_line":"        :type name: immutable (str or tuple)"},{"line_number":40,"context_line":"        :param stats: updated stats to send to scheduler"},{"line_number":41,"context_line":"        :type stats: dict"},{"line_number":42,"context_line":"        \"\"\""},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_523e31b9","line":40,"in_reply_to":"baada198_2c780bf8","updated":"2014-07-18 12:13:53.000000000","message":"@jay I agree that long term we need a proper versioned interface, but this is about drawing a line in the sand, so we know where that proper interface will live.\n\nI don\u0027t want to do this in a big bang, we should evolve towards something that works properly. I am not saying \"this is the gantt interface\", its more like drawing a new line in the sand to help separate the concerns within the system better. I hope we evole it towards where is can become the gantt interface, but as you pointed out, we might want to expand a little bit to include some other pieces, but with the current architecture, this is a reasonable place to start, I feel.","commit_id":"7a70f93996dd8daa0492e47adae467df6068d807"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c49cd022c6758688ff9e66172e0f03f28c343ef6","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        :param context: local context"},{"line_number":38,"context_line":"        :param name: name of resource to update"},{"line_number":39,"context_line":"        :type name: immutable (str or tuple)"},{"line_number":40,"context_line":"        :param stats: updated stats to send to scheduler"},{"line_number":41,"context_line":"        :type stats: dict"},{"line_number":42,"context_line":"        \"\"\""},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_2c780bf8","line":40,"in_reply_to":"baada198_5677a59f","updated":"2014-07-08 12:39:23.000000000","message":"Hi Jay, I can understand your concern and I will have to look at your proposal. \nThat said, the spec here has been agreed for a dict as stats in order to minimize the required change, and this patch has been waiting so long for getting merged that I fear that changing such an interface parameter would require more time than expected.","commit_id":"7a70f93996dd8daa0492e47adae467df6068d807"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0198cb2d3c023dfddfb3b3b3711dcc7f40bd9fa7","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        if \u0027id\u0027 in stats:"},{"line_number":43,"context_line":"            compute_node_id \u003d stats[\u0027id\u0027]"},{"line_number":44,"context_line":"            updates \u003d copy.deepcopy(stats)"},{"line_number":45,"context_line":"            del updates[\u0027id\u0027]"},{"line_number":46,"context_line":"        else:"},{"line_number":47,"context_line":"            raise exception.ComputeHostNotCreated(name\u003dstr(name))"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_810ba023","line":44,"updated":"2014-07-22 09:07:31.000000000","message":"Why so many deep copies? surely to just remove the id without affecting the caller we just need a regular copy here? I could be missing something.","commit_id":"70eac0c7a357b25ec522d14b79e43c8cf1e70568"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"61555163db6bae82684f5c48703c0f2c9f59f723","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        if \u0027id\u0027 in stats:"},{"line_number":43,"context_line":"            compute_node_id \u003d stats[\u0027id\u0027]"},{"line_number":44,"context_line":"            updates \u003d copy.deepcopy(stats)"},{"line_number":45,"context_line":"            del updates[\u0027id\u0027]"},{"line_number":46,"context_line":"        else:"},{"line_number":47,"context_line":"            raise exception.ComputeHostNotCreated(name\u003dstr(name))"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_a7f514ce","line":44,"in_reply_to":"baada198_810ba023","updated":"2014-07-22 10:33:48.000000000","message":"Agree, a shallow copy is enough, my bad.","commit_id":"70eac0c7a357b25ec522d14b79e43c8cf1e70568"},{"author":{"_account_id":10224,"name":"Feodor Tersin","email":"ftersin@hotmail.com","username":"ftersin"},"change_message_id":"fac49caab8e21e39dc04bd3016ead153e23acc5b","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        if \u0027id\u0027 in stats:"},{"line_number":41,"context_line":"            compute_node_id \u003d stats[\u0027id\u0027]"},{"line_number":42,"context_line":"            updates \u003d stats.copy()"},{"line_number":43,"context_line":"            del updates[\u0027id\u0027]"},{"line_number":44,"context_line":"        else:"},{"line_number":45,"context_line":"            raise exception.ComputeHostNotCreated(name\u003dstr(name))"}],"source_content_type":"text/x-python","patch_set":54,"id":"7ac7a964_38aaf370","line":42,"updated":"2014-08-14 08:53:33.000000000","message":"you make a copy in resource_tracker to add id, and here you make another one to delete it\n\nwhy not just to pass id in this function?","commit_id":"f08b67f38116fe9ee596f3c0611424f33ac423c3"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"10dd19348aec8537be21f98a9d90d61384a04219","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        if \u0027id\u0027 in stats:"},{"line_number":41,"context_line":"            compute_node_id \u003d stats[\u0027id\u0027]"},{"line_number":42,"context_line":"            updates \u003d stats.copy()"},{"line_number":43,"context_line":"            del updates[\u0027id\u0027]"},{"line_number":44,"context_line":"        else:"},{"line_number":45,"context_line":"            raise exception.ComputeHostNotCreated(name\u003dstr(name))"}],"source_content_type":"text/x-python","patch_set":54,"id":"1abeadc6_8690a696","line":42,"in_reply_to":"7ac7a964_38aaf370","updated":"2014-08-27 13:41:00.000000000","message":"the plan is to remove the need for this id at a later date, so I am fine with this.","commit_id":"f08b67f38116fe9ee596f3c0611424f33ac423c3"}],"nova/tests/compute/fake_resource_tracker.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"eac0e9af687903c2cb2f4bfea090766556af674d","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        self.compute_node \u003d values"},{"line_number":29,"context_line":"        self.compute_node[\u0027id\u0027] \u003d 1"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def _update(self, context, values, prune_stats\u003dFalse):"},{"line_number":32,"context_line":"        self.compute_node.update(values)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def _get_service(self, context):"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_04e8250f","line":31,"updated":"2014-06-02 15:15:31.000000000","message":"I think you broke this, given your changes.\n\nDoes this all make sense any more.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0120c5dac953ab2288a94e7d9f4bba0ed57ab20b","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        self.compute_node \u003d values"},{"line_number":29,"context_line":"        self.compute_node[\u0027id\u0027] \u003d 1"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def _update(self, context, values, prune_stats\u003dFalse):"},{"line_number":32,"context_line":"        self.compute_node.update(values)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def _get_service(self, context):"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_37e9ccb8","line":31,"in_reply_to":"1ae5cdf2_04e8250f","updated":"2014-06-02 16:42:13.000000000","message":"Agreed, I should remove them, that\u0027s unnecessary to keep them.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self.scheduler_client.update_resource_stats \u003d mock.Mock()"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def _create(self, context):"},{"line_number":29,"context_line":"        self.compute_node[\u0027id\u0027] \u003d 1"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def _get_service(self, context):"},{"line_number":32,"context_line":"        return {"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_6db481d4","line":29,"updated":"2014-06-24 16:17:24.000000000","message":"This all seems a bit odd, not quite I get why you need this change?","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"50823d2a94570fc5b280ec62d01c861460a02921","unresolved":false,"context_lines":[{"line_number":24,"context_line":"        self.compute_node[\u0027id\u0027] \u003d 1"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def _update(self, context, values, prune_stats\u003dFalse):"},{"line_number":27,"context_line":"        self.compute_node.update(values)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def _get_service(self, context):"},{"line_number":30,"context_line":"        return {"}],"source_content_type":"text/x-python","patch_set":36,"id":"baada198_8e1d6b69","side":"PARENT","line":27,"updated":"2014-07-01 11:21:55.000000000","message":"still not sure why you have changed this?","commit_id":"3ba1064dca65154813568c0232a6540469863695"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ff7fc80f7b779a05af5085f2aba8a183d874e393","unresolved":false,"context_lines":[{"line_number":24,"context_line":"        self.compute_node[\u0027id\u0027] \u003d 1"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def _update(self, context, values, prune_stats\u003dFalse):"},{"line_number":27,"context_line":"        self.compute_node.update(values)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def _get_service(self, context):"},{"line_number":30,"context_line":"        return {"}],"source_content_type":"text/x-python","patch_set":37,"id":"baada198_e6fc2041","side":"PARENT","line":27,"updated":"2014-07-02 13:00:05.000000000","message":"I still don\u0027t understand why you changed this?","commit_id":"3ba1064dca65154813568c0232a6540469863695"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"7cd41b7af8d0688c6991e78d6b0493f798813e63","unresolved":false,"context_lines":[{"line_number":24,"context_line":"        self.compute_node[\u0027id\u0027] \u003d 1"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def _update(self, context, values, prune_stats\u003dFalse):"},{"line_number":27,"context_line":"        self.compute_node.update(values)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def _get_service(self, context):"},{"line_number":30,"context_line":"        return {"}],"source_content_type":"text/x-python","patch_set":45,"id":"baada198_f09f08b2","side":"PARENT","line":27,"updated":"2014-07-21 09:30:05.000000000","message":"Why did you change this? will this not work well enough with the current code too?","commit_id":"1dc9ee083b3231cbae165dac538e6a1532b972f5"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"8ca8ec9a6581dd41fbd9a862eb32f7a8866e0691","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"# import mock"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from nova.compute import resource_tracker"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_ff8c3337","line":16,"updated":"2014-07-21 11:51:11.000000000","message":"Shouldn\u0027t have this here.","commit_id":"83519d4271d2e77948af0230988e48f69f6b2345"}],"nova/tests/compute/test_resource_tracker.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0f7b17f32075152386cc75b700df45a8d073a94b","unresolved":false,"context_lines":[{"line_number":402,"context_line":"    def _fake_create_compute_node(self, context, values):"},{"line_number":403,"context_line":"        self.created \u003d True"},{"line_number":404,"context_line":"        self.compute \u003d self._create_compute_node(values)"},{"line_number":405,"context_line":"        return self.compute"},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"    def _fake_service_get_by_compute_host(self, ctx, host):"},{"line_number":408,"context_line":"        # return a service with no joined compute"}],"source_content_type":"text/x-python","patch_set":44,"id":"baada198_fd7e31e3","line":405,"updated":"2014-07-18 15:43:21.000000000","message":"I don\u0027t really understand why we need this change, its seems very odd.","commit_id":"b351c9bf1929996c915a8d5524919c47db9f287c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0f7b17f32075152386cc75b700df45a8d073a94b","unresolved":false,"context_lines":[{"line_number":414,"context_line":"        self.assertTrue(self.created)"},{"line_number":415,"context_line":"        # FIXME(sbauza): stats field is not sent when creating a new compute,"},{"line_number":416,"context_line":"        #                remove this delete statement once this is fixed"},{"line_number":417,"context_line":"        del self.compute[\u0027stats\u0027]"},{"line_number":418,"context_line":"        self.tracker.scheduler_client.update_resource_stats.\\"},{"line_number":419,"context_line":"            assert_called_once_with(self.context,"},{"line_number":420,"context_line":"                                    (\"fakehost\", \"fakenode\"),"}],"source_content_type":"text/x-python","patch_set":44,"id":"baada198_5af8037c","line":417,"updated":"2014-07-18 15:43:21.000000000","message":"If you just call update after the create, would that not fix all this? If not, then there is no point in having this extra call.","commit_id":"b351c9bf1929996c915a8d5524919c47db9f287c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0f7b17f32075152386cc75b700df45a8d073a94b","unresolved":false,"context_lines":[{"line_number":449,"context_line":"        self.stubs.Set(db, \u0027migration_get_in_progress_by_host_and_node\u0027,"},{"line_number":450,"context_line":"                self._fake_migration_get_in_progress_by_host_and_node)"},{"line_number":451,"context_line":"        self.tracker.scheduler_client.update_resource_stats \u003d mock.Mock("},{"line_number":452,"context_line":"            side_effect\u003dself._fake_compute_node_update)"},{"line_number":453,"context_line":""},{"line_number":454,"context_line":"        self.tracker.update_available_resource(self.context)"},{"line_number":455,"context_line":"        self.limits \u003d self._limits()"}],"source_content_type":"text/x-python","patch_set":44,"id":"baada198_5d955d3e","line":452,"updated":"2014-07-18 15:43:21.000000000","message":"This seems odd, either isolate this method with the mock, or test we call the update correctly.\n\nDoing both is just odd.","commit_id":"b351c9bf1929996c915a8d5524919c47db9f287c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0f7b17f32075152386cc75b700df45a8d073a94b","unresolved":false,"context_lines":[{"line_number":534,"context_line":"        self.assertFalse(self.tracker.disabled)"},{"line_number":535,"context_line":"        self.assertTrue(self.updated)"},{"line_number":536,"context_line":"        # NOTE(sbauza): service_id is not passed when updating"},{"line_number":537,"context_line":"        del self.compute[\u0027service_id\u0027]"},{"line_number":538,"context_line":"        self.tracker.scheduler_client.update_resource_stats.\\"},{"line_number":539,"context_line":"            assert_called_once_with(self.context,"},{"line_number":540,"context_line":"                                    (\"fakehost\", \"fakenode\"),"}],"source_content_type":"text/x-python","patch_set":44,"id":"baada198_fd09d195","line":537,"updated":"2014-07-18 15:43:21.000000000","message":"This doesn\u0027t seem obvious from the code, I worry about what this is actually testing, its really hard to read. Maybe just add a separate test new test to check the scheduler_client is called correctly, not sure.","commit_id":"b351c9bf1929996c915a8d5524919c47db9f287c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"7cd41b7af8d0688c6991e78d6b0493f798813e63","unresolved":false,"context_lines":[{"line_number":553,"context_line":"        # NOTE(sbauza): service_id is not passed to scheduler when updating"},{"line_number":554,"context_line":"        expected_values.pop(\u0027service_id\u0027)"},{"line_number":555,"context_line":"        # NOTE(sbauza): as there are no instances yet, stats are not passed"},{"line_number":556,"context_line":"        expected_values.pop(\u0027stats\u0027)"},{"line_number":557,"context_line":"        self.tracker.scheduler_client.update_resource_stats.\\"},{"line_number":558,"context_line":"            assert_called_once_with(self.context,"},{"line_number":559,"context_line":"                                    (\"fakehost\", \"fakenode\"),"}],"source_content_type":"text/x-python","patch_set":45,"id":"baada198_4231cd09","line":556,"updated":"2014-07-21 09:30:05.000000000","message":"Nit: I kinda think you need to test when this actually gets sent, but that patch is till covered by the above code I guess...\n\nMaybe its easier just to test the _update method directly to check your code additions.","commit_id":"524a4f4584fad80ca8165a68cefb022194ea4ef4"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0198cb2d3c023dfddfb3b3b3711dcc7f40bd9fa7","unresolved":false,"context_lines":[{"line_number":561,"context_line":""},{"line_number":562,"context_line":"    def test_update_resource(self):"},{"line_number":563,"context_line":"        values \u003d {\u0027foo\u0027: \u0027bar\u0027, \u0027baz_count\u0027: 0}"},{"line_number":564,"context_line":"        self.tracker._update(self.context, values)"},{"line_number":565,"context_line":"        expected \u003d {\u0027foo\u0027: \u0027bar\u0027, \u0027baz_count\u0027: 0,"},{"line_number":566,"context_line":"                    \u0027id\u0027: 1}"},{"line_number":567,"context_line":"        self.tracker.scheduler_client.update_resource_stats.\\"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_4160a8a4","line":564,"updated":"2014-07-22 09:07:31.000000000","message":"Nit: I like a blank line after the method under test, so its clearer, but feel free to ignore that.","commit_id":"70eac0c7a357b25ec522d14b79e43c8cf1e70568"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"61555163db6bae82684f5c48703c0f2c9f59f723","unresolved":false,"context_lines":[{"line_number":561,"context_line":""},{"line_number":562,"context_line":"    def test_update_resource(self):"},{"line_number":563,"context_line":"        values \u003d {\u0027foo\u0027: \u0027bar\u0027, \u0027baz_count\u0027: 0}"},{"line_number":564,"context_line":"        self.tracker._update(self.context, values)"},{"line_number":565,"context_line":"        expected \u003d {\u0027foo\u0027: \u0027bar\u0027, \u0027baz_count\u0027: 0,"},{"line_number":566,"context_line":"                    \u0027id\u0027: 1}"},{"line_number":567,"context_line":"        self.tracker.scheduler_client.update_resource_stats.\\"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_07fde0b1","line":564,"in_reply_to":"baada198_4160a8a4","updated":"2014-07-22 10:33:48.000000000","message":"Done","commit_id":"70eac0c7a357b25ec522d14b79e43c8cf1e70568"}],"nova/tests/scheduler/fake_client.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"23e7b059ff7d2c4c9e06ee00f96ed820bf83ce12","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    \"\"\"Version without a DB requirement.\"\"\""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    def update_resource_stats(self, context, resource, stats):"},{"line_number":23,"context_line":"        return stats"}],"source_content_type":"text/x-python","patch_set":20,"id":"1ae5cdf2_bc14c29f","line":23,"updated":"2014-06-18 11:02:58.000000000","message":"You should really just use Mock to create one of these.","commit_id":"f27ceba283dfbd7a9ec27e580940f1925cbc4e0a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"72e2c600f7d448d331743ed373aee77010fd4ccf","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    \"\"\"Version without a DB requirement.\"\"\""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    def update_resource_stats(self, context, resource, stats):"},{"line_number":23,"context_line":"        return stats"}],"source_content_type":"text/x-python","patch_set":20,"id":"1ae5cdf2_03f6fbd6","line":23,"in_reply_to":"1ae5cdf2_bc14c29f","updated":"2014-06-19 15:52:18.000000000","message":"Done","commit_id":"f27ceba283dfbd7a9ec27e580940f1925cbc4e0a"}],"nova/tests/scheduler/test_client.py":[{"author":{"_account_id":8430,"name":"Christopher Lefelhocz","email":"christopher.lefelhoc@rackspace.com","username":"leif"},"change_message_id":"15fe6f5b4c32c1909bb1cd904dc4b0cfe0ada67c","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class SchedulerClientTestCase(test.TestCase):"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def patch(self, obj, attr, **kw):"},{"line_number":29,"context_line":"            _p \u003d mock.patch.object(obj, attr, **kw)"},{"line_number":30,"context_line":"            _mock \u003d _p.start()"},{"line_number":31,"context_line":"            self.addCleanup(_p.stop)"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_6088ece7","line":28,"updated":"2014-06-02 18:47:35.000000000","message":"This is generic right?  Can we move this to test.py?","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":8430,"name":"Christopher Lefelhocz","email":"christopher.lefelhoc@rackspace.com","username":"leif"},"change_message_id":"104d4545db3b2203b9b0c0b1e066721ca9372b6e","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class SchedulerClientTestCase(test.TestCase):"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def patch(self, obj, attr, **kw):"},{"line_number":29,"context_line":"            _p \u003d mock.patch.object(obj, attr, **kw)"},{"line_number":30,"context_line":"            _mock \u003d _p.start()"},{"line_number":31,"context_line":"            self.addCleanup(_p.stop)"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_0ad19122","line":28,"in_reply_to":"1ae5cdf2_3167cf4e","updated":"2014-06-09 18:36:52.000000000","message":"Well there is pretty strong pushback on 95552 which means we should probably move these to be decorations of the tests themselves.\n\n\nMake that adjustment.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"54f5877d718f5f729eabab0867bca465ac6e3ad7","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class SchedulerClientTestCase(test.TestCase):"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def patch(self, obj, attr, **kw):"},{"line_number":29,"context_line":"            _p \u003d mock.patch.object(obj, attr, **kw)"},{"line_number":30,"context_line":"            _mock \u003d _p.start()"},{"line_number":31,"context_line":"            self.addCleanup(_p.stop)"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_3167cf4e","line":28,"in_reply_to":"1ae5cdf2_6088ece7","updated":"2014-06-04 12:10:09.000000000","message":"Please review https://review.openstack.org/95552 , this is the patch for test.py\n\nUntil 95552 is merged, I think it\u0027s worth keeping this method here.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e70820862d8b6d6799c37784d2c9c8aeb19e653e","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        self.mock_cn_update \u003d self.patch(self.client.conductor_api,"},{"line_number":51,"context_line":"                                         \u0027compute_node_update\u0027)"},{"line_number":52,"context_line":"        self.mock_cn_update.side_effect \u003d self._fake_compute_node_update"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def _fake_service_get_by_compute_host(self, context, host):"},{"line_number":55,"context_line":"        return self._create_service(host, compute\u003dgetattr(self, \u0027compute\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_4af0f9c8","line":52,"updated":"2014-06-05 14:00:54.000000000","message":"Please don\u0027t do mocks like this. Mock out the thing you need to mock in the place you need it to be mocked. This sort of pattern is what we have with mox-based tests in many areas of the code and they\u0027re often a disaster.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"1f89d4ed9ba4f6ffd0cbadd57bf38ea3862c0035","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        self.mock_cn_update \u003d self.patch(self.client.conductor_api,"},{"line_number":51,"context_line":"                                         \u0027compute_node_update\u0027)"},{"line_number":52,"context_line":"        self.mock_cn_update.side_effect \u003d self._fake_compute_node_update"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def _fake_service_get_by_compute_host(self, context, host):"},{"line_number":55,"context_line":"        return self._create_service(host, compute\u003dgetattr(self, \u0027compute\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ae5cdf2_be2e1ef9","line":52,"in_reply_to":"1ae5cdf2_4af0f9c8","updated":"2014-06-05 14:49:13.000000000","message":"OK, in order to be clear, you recommend either making use of a mock context in each test requiring it, and/or make use of a mock decorator for each test needing it, but not mocking in a global setUp ?\n\nOr (another way), you prefer to not use side_effect and only make use of return_value ?\n\n\nI tried to not mock the whole method, only the call to the conductor.","commit_id":"813aba7e6838fb53f63f47cf3e6116d6d2a6cf9c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"36d2bd8b7abbf0b95d854609363cb6a176f8dccb","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.mock_cn_create \u003d self.patch(compute_node_obj.ComputeNode,"},{"line_number":49,"context_line":"                                         \u0027create\u0027)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        self.mock_cn_update \u003d self.patch(compute_node_obj.ComputeNode,"},{"line_number":52,"context_line":"                                         \u0027save\u0027)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def _fake_service_get_by_compute_host(self, context, host):"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ae5cdf2_53edb18a","line":51,"updated":"2014-06-09 17:27:48.000000000","message":"These are not needed in all tests, so it kinda makes this hard to read I think, maybe split this into two test classes, one for select_desintation, and the other that needs all these?\n\nI think you will find using class decorators much easier to read, but this is OK.","commit_id":"caf7b95e01fec22183d1ee5b88d5b8297aaa8c52"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"36d2bd8b7abbf0b95d854609363cb6a176f8dccb","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    def test_select_destinations(self):"},{"line_number":92,"context_line":"        self.assertIsNotNone(self.client.scheduler_rpcapi)"},{"line_number":93,"context_line":"        with mock.patch.object("},{"line_number":94,"context_line":"            self.client.scheduler_rpcapi, \u0027select_destinations\u0027"},{"line_number":95,"context_line":"        ) as mock_select_destinations:"},{"line_number":96,"context_line":"            self.client.select_destinations("},{"line_number":97,"context_line":"                context\u003d\u0027fake_ctxt\u0027, request_spec\u003d\u0027fake_request_spec\u0027,"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ae5cdf2_93d739bf","line":94,"updated":"2014-06-09 17:27:48.000000000","message":"we tend to use the decorator for this kind of test, it much easier to read.\n\nyou just need to import the scheduler_rpcapi here, and you will not need the self reference any more.","commit_id":"caf7b95e01fec22183d1ee5b88d5b8297aaa8c52"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"36d2bd8b7abbf0b95d854609363cb6a176f8dccb","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        def _fake_get_service_raise_NotFound(context, values):"},{"line_number":107,"context_line":"            raise exception.NotFound()"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        self.mock_get_service.side_effect \u003d _fake_get_service_raise_NotFound"},{"line_number":110,"context_line":"        values \u003d self.client.update_resource_stats(self.context, \u0027fake_node\u0027,"},{"line_number":111,"context_line":"                                                   \u0027fake_stats\u0027)"},{"line_number":112,"context_line":"        self.assertIsNone(values)"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ae5cdf2_339f4505","line":109,"updated":"2014-06-09 17:27:48.000000000","message":"you can just pass the exception here, no need for the method. its easier to read that way too.","commit_id":"caf7b95e01fec22183d1ee5b88d5b8297aaa8c52"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def _stats(**values):"},{"line_number":28,"context_line":"    stats \u003d {"},{"line_number":29,"context_line":"        \"service_id\": 1,"},{"line_number":30,"context_line":"        \"vcpus\": 1,"},{"line_number":31,"context_line":"        \"memory_mb\": 1,"}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_0dc3fd39","line":28,"updated":"2014-06-24 16:17:24.000000000","message":"I don\u0027t see why you need this? just use a place holder value","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def setUp(self):"},{"line_number":51,"context_line":"        super(SchedulerClientTestCase, self).setUp()"},{"line_number":52,"context_line":"        self.context \u003d context.get_admin_context()"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        self.flags(use_local\u003dTrue, group\u003d\u0027conductor\u0027)"},{"line_number":55,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_4deb45a4","line":52,"updated":"2014-06-24 16:17:24.000000000","message":"You should just mock this I think.","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e9de7e67627b5cc2af20374002b418344c0e5389","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        super(SchedulerClientTestCase, self).setUp()"},{"line_number":52,"context_line":"        self.context \u003d context.get_admin_context()"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        self.flags(use_local\u003dTrue, group\u003d\u0027conductor\u0027)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        self.client \u003d scheduler_client.SchedulerClient()"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"1ae5cdf2_2df0b990","line":54,"updated":"2014-06-24 16:17:24.000000000","message":"You should not use the DB in these tests, you should mock the conductor, see:\nhttps://review.openstack.org/#/c/101858/5/nova/tests/scheduler/test_client.py","commit_id":"d2b32a90e0f482d2aef04844cdc7c74126b8a579"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"50823d2a94570fc5b280ec62d01c861460a02921","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        \"running_vms\": 0,"},{"line_number":39,"context_line":"        \"cpu_info\": None,"},{"line_number":40,"context_line":"        \"stats\": {\"key\": \"num_instances\", \"value\": \"1\"},"},{"line_number":41,"context_line":"        \"hypervisor_hostname\": \"fakenode\","},{"line_number":42,"context_line":"    }"},{"line_number":43,"context_line":"    stats.update(values)"},{"line_number":44,"context_line":"    return stats"}],"source_content_type":"text/x-python","patch_set":36,"id":"baada198_6e3737e4","line":41,"updated":"2014-07-01 11:21:55.000000000","message":"still don\u0027t understand why you have this here.\n\nits not required by these unit tests, just use a placeholder value","commit_id":"c826c228d28ae260936060a111c0612e0cfca0d4"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"1f8641604179ff679b88751c64a30efe3e39bf7c","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def test_select_destinations(self):"},{"line_number":41,"context_line":"        self.assertIsNotNone(self.client.scheduler_rpcapi)"},{"line_number":42,"context_line":"        with mock.patch.object("},{"line_number":43,"context_line":"            self.client.scheduler_rpcapi, \u0027select_destinations\u0027"},{"line_number":44,"context_line":"        ) as mock_select_destinations:"},{"line_number":45,"context_line":"            self.client.select_destinations("},{"line_number":46,"context_line":"                context\u003d\u0027fake_ctxt\u0027, request_spec\u003d\u0027fake_request_spec\u0027,"}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_a7a3029d","line":43,"updated":"2014-07-02 13:07:38.000000000","message":"Minor nit: you could do the same kind of decorator as below here, just look up the scheduler_rpcapi class","commit_id":"532fba0b4b8983f7ebf294a5425fd8918e91d5de"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2fbff7962008564f1efec639418144f759828b19","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def test_select_destinations(self):"},{"line_number":41,"context_line":"        self.assertIsNotNone(self.client.scheduler_rpcapi)"},{"line_number":42,"context_line":"        with mock.patch.object("},{"line_number":43,"context_line":"            self.client.scheduler_rpcapi, \u0027select_destinations\u0027"},{"line_number":44,"context_line":"        ) as mock_select_destinations:"},{"line_number":45,"context_line":"            self.client.select_destinations("},{"line_number":46,"context_line":"                context\u003d\u0027fake_ctxt\u0027, request_spec\u003d\u0027fake_request_spec\u0027,"}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_f9075e1b","line":43,"in_reply_to":"baada198_a7a3029d","updated":"2014-07-02 14:32:03.000000000","message":"Will remove that test as select_destinations() will be added in a later change","commit_id":"532fba0b4b8983f7ebf294a5425fd8918e91d5de"}]}
