)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"f1636e1eecdd9df14fad482349bcc02852212232","unresolved":false,"context_lines":[{"line_number":13,"context_line":"decisions."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"In addition, the consumer plug-in is added to the filter scheduler."},{"line_number":16,"context_line":"When the scheduler has selected a compure node it updates its local"},{"line_number":17,"context_line":"copy of HostState for that compute node to reflect the decision."},{"line_number":18,"context_line":"The consumer plug-in provides the operation required on the extended"},{"line_number":19,"context_line":"resource information to perform this step."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAATn%2F9VD8%3D","line":16,"updated":"2013-12-12 16:01:05.000000000","message":"nit: s/compure/compute/","commit_id":"62453f26e5f8114873876c0b94790a11f5d05853"}],"nova/consumers.py":[{"author":{"_account_id":8514,"name":"Yathiraj Udupi","email":"yudupi@cisco.com","username":"yudupi"},"change_message_id":"7f324b73aa189e0ba822cf7e24f124078ec9aa72","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    \"\"\"Base class to handle loading consumer classes.\"\"\""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def consume_from_instance(self, consumer_classes, extra_resources,"},{"line_number":32,"context_line":"                              instance, instance_type):"},{"line_number":33,"context_line":"        \"\"\"Each class is called to update resource state to reflect"},{"line_number":34,"context_line":"        the effect of allocating this instance to this host."},{"line_number":35,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUX%2F%2Bzpo%3D","line":32,"updated":"2014-02-18 22:10:33.000000000","message":"Why does this method signature require a separate instance_type? Can you possibly include the \u0027extra_specs\u0027 field used to describe the instance type in your case as part of the \"instance\" dictionary itself?  This instance argument anyway describes the instance_properties.","commit_id":"90c596309193162aa8d6e0f5750618a47c5e6919"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"539a0b9b4c5202fe7ea5573eb5f4eb5fa79d21f3","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    \"\"\"Base class to handle loading consumer classes.\"\"\""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def consume_from_instance(self, consumer_classes, extra_resources,"},{"line_number":32,"context_line":"                              instance, instance_type):"},{"line_number":33,"context_line":"        \"\"\"Each class is called to update resource state to reflect"},{"line_number":34,"context_line":"        the effect of allocating this instance to this host."},{"line_number":35,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAU3%2F%2FmTk%3D","line":32,"in_reply_to":"AAAAUX%2F%2Bzpo%3D","updated":"2014-02-25 18:41:55.000000000","message":"The extra_specs field is not passed around as part of the instance so I though it better to be consistent here. I also replied to you similar comment in filter_scheduler.py with an alternative involving filter_properties, but that is not really practical. So I thought this was the best compromise.","commit_id":"90c596309193162aa8d6e0f5750618a47c5e6919"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9cc3addd34a3861a993584f3463a94bf4ecba6fe","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from nova import loadables"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class BaseConsumer(object):"},{"line_number":20,"context_line":"    \"\"\"Base class for all consumer classes.\"\"\""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    def consume_from_instance(self, extra_resources,"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAU3%2F%2FewI%3D","line":19,"updated":"2014-02-26 12:12:03.000000000","message":"I am not sure why we are bothering with a BaseConsumer, what not roll this all into the specific scheduler one?","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"dd3cfaa1d65b254613e64d814710f5512a43a109","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from nova import loadables"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class BaseConsumer(object):"},{"line_number":20,"context_line":"    \"\"\"Base class for all consumer classes.\"\"\""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    def consume_from_instance(self, extra_resources,"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVX%2F%2F6tY%3D","line":19,"in_reply_to":"AAAAU3%2F%2FewI%3D","updated":"2014-02-27 12:48:55.000000000","message":"Removing this file - you\u0027re right, I was following a pattern from filters and weights and there was a little more in here. But its moved to nova.scheduler.consumers.__init__","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9cc3addd34a3861a993584f3463a94bf4ecba6fe","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        the effect of allocating this instance to this host."},{"line_number":35,"context_line":"        \"\"\""},{"line_number":36,"context_line":"        for consumer_cls in consumer_classes:"},{"line_number":37,"context_line":"            consumer \u003d consumer_cls()"},{"line_number":38,"context_line":"            consumer.consume_from_instance(extra_resources, instance,"},{"line_number":39,"context_line":"                                           instance_type)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAU3%2F%2FeuY%3D","line":37,"updated":"2014-02-26 12:12:03.000000000","message":"Hmm, this feels expensive...","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"dd3cfaa1d65b254613e64d814710f5512a43a109","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        the effect of allocating this instance to this host."},{"line_number":35,"context_line":"        \"\"\""},{"line_number":36,"context_line":"        for consumer_cls in consumer_classes:"},{"line_number":37,"context_line":"            consumer \u003d consumer_cls()"},{"line_number":38,"context_line":"            consumer.consume_from_instance(extra_resources, instance,"},{"line_number":39,"context_line":"                                           instance_type)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVX%2F%2F6tM%3D","line":37,"in_reply_to":"AAAAU3%2F%2FeuY%3D","updated":"2014-02-27 12:48:55.000000000","message":"Again - yes, agreed. Create classes once - done in nova.scheduler.consumers.__init__","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"}],"nova/scheduler/consumers/__init__.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b7a5645692e2ff8b78482054b9fa59a33372228f","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from nova import consumers"},{"line_number":18,"context_line":"from nova.openstack.common import log as logging"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class BaseResourceConsumer(consumers.BaseConsumer):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUX%2F%2FjGg%3D","line":20,"updated":"2014-02-12 12:57:53.000000000","message":"this is not used","commit_id":"8d6b23d29b29676a0f62b7473dd9d8ebd5fcf994"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"2d9cabf463bee1e0288aee6db46811f7d6407e33","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from nova import consumers"},{"line_number":18,"context_line":"from nova.openstack.common import log as logging"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class BaseResourceConsumer(consumers.BaseConsumer):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FmQQ%3D","line":20,"in_reply_to":"AAAAUX%2F%2FjGg%3D","updated":"2014-02-25 18:41:23.000000000","message":"Done","commit_id":"8d6b23d29b29676a0f62b7473dd9d8ebd5fcf994"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9cc3addd34a3861a993584f3463a94bf4ecba6fe","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from nova import consumers"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class BaseResourceConsumer(consumers.BaseConsumer):"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAU3%2F%2Feos%3D","line":17,"updated":"2014-02-26 12:12:03.000000000","message":"I don\u0027t understand what consumers gives us, do you have a plan for using them separately? If not, I would just roll that code into here.\n\nI wonder if it should be resource_consumers, not consumers/__init__.py?","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"dd3cfaa1d65b254613e64d814710f5512a43a109","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from nova import consumers"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class BaseResourceConsumer(consumers.BaseConsumer):"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVX%2F%2F6p8%3D","line":17,"in_reply_to":"AAAAU3%2F%2Feos%3D","updated":"2014-02-27 12:48:55.000000000","message":"agreed - removed nova.consumers and rolled in here.\nPutting this in consumers/__init__.py follows pattern from other plugins (filters, weights, metrics)","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9cc3addd34a3861a993584f3463a94bf4ecba6fe","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        They may chose to convert them to an internal format."},{"line_number":34,"context_line":"        \"\"\""},{"line_number":35,"context_line":"        for consumer_cls in consumer_classes:"},{"line_number":36,"context_line":"            consumer \u003d consumer_cls()"},{"line_number":37,"context_line":"            consumer.read(extra_resources)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAU3%2F%2FelM%3D","line":36,"updated":"2014-02-26 12:12:03.000000000","message":"I would love this to be a singleton, it kinda sucks, performance wise, with all this object creation.\n\nI think you can create the list of objects in the constructor here. I know that means no internal state for consumers, but that seems OK?","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"dd3cfaa1d65b254613e64d814710f5512a43a109","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        They may chose to convert them to an internal format."},{"line_number":34,"context_line":"        \"\"\""},{"line_number":35,"context_line":"        for consumer_cls in consumer_classes:"},{"line_number":36,"context_line":"            consumer \u003d consumer_cls()"},{"line_number":37,"context_line":"            consumer.read(extra_resources)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVX%2F%2F6rw%3D","line":36,"in_reply_to":"AAAAU3%2F%2FelM%3D","updated":"2014-02-27 12:48:55.000000000","message":"I don\u0027t like singletons, but you are right. Added initialize_consumers method to create  classes once.","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9cc3addd34a3861a993584f3463a94bf4ecba6fe","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    This method is used as the default for available host state consumers"},{"line_number":44,"context_line":"    and should return a list of all consumer classes available."},{"line_number":45,"context_line":"    \"\"\""},{"line_number":46,"context_line":"    return ResourceConsumerHandler().get_all_classes()"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAU3%2F%2FekE%3D","line":46,"updated":"2014-02-26 12:12:03.000000000","message":"I really think we need one simple example, maybe vcpu as a good example?\n\nAlthough ideally, also remove the existing vcpu tracking, and move it to this new model. If that works?\n\nMaybe add a vcpu properties that reads the value from the dict, and that should do the trick?","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"dd3cfaa1d65b254613e64d814710f5512a43a109","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    This method is used as the default for available host state consumers"},{"line_number":44,"context_line":"    and should return a list of all consumer classes available."},{"line_number":45,"context_line":"    \"\"\""},{"line_number":46,"context_line":"    return ResourceConsumerHandler().get_all_classes()"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVX%2F%2F6qs%3D","line":46,"in_reply_to":"AAAAU3%2F%2FekE%3D","updated":"2014-02-27 12:48:55.000000000","message":"This is a good idea - see https://review.openstack.org/71570","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"5403cc27c00d1db1d5daefa1755431a8beb62157","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def read(self, extra_resources):"},{"line_number":44,"context_line":"        \"\"\"Each class is given the chance to read values."},{"line_number":45,"context_line":"        They may chose to convert them to an internal format."},{"line_number":46,"context_line":"        \"\"\""},{"line_number":47,"context_line":"        for consumer in self.consumer_list:"},{"line_number":48,"context_line":"            consumer.read(extra_resources)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAVX%2F%2F6Ko%3D","line":45,"updated":"2014-02-27 13:09:52.000000000","message":"choose","commit_id":"c14d0417499a1f74ad41ff22ae6c3d2229576ed0"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"5c413e40763b4957cb1168022d4a72dbbd206495","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def read(self, extra_resources):"},{"line_number":44,"context_line":"        \"\"\"Each class is given the chance to read values."},{"line_number":45,"context_line":"        They may chose to convert them to an internal format."},{"line_number":46,"context_line":"        \"\"\""},{"line_number":47,"context_line":"        for consumer in self.consumer_list:"},{"line_number":48,"context_line":"            consumer.read(extra_resources)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAVX%2F%2F5Uo%3D","line":45,"in_reply_to":"AAAAVX%2F%2F6Ko%3D","updated":"2014-02-27 14:51:47.000000000","message":"Done","commit_id":"c14d0417499a1f74ad41ff22ae6c3d2229576ed0"}],"nova/scheduler/consumers/base.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"67153c47de5929efec7418a66f2f3c388547417c","unresolved":false,"context_lines":[{"line_number":21,"context_line":"class ResourceConsumer(object):"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    @abc.abstractmethod"},{"line_number":24,"context_line":"    def read(self, host_state):"},{"line_number":25,"context_line":"        pass"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAXH%2F%2FNnY%3D","line":24,"updated":"2014-04-23 09:40:39.000000000","message":"IMHO, would be worth putting long docstrings here","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"881ea86225c78d916d6be6c7fd963cf6b105ae26","unresolved":false,"context_lines":[{"line_number":21,"context_line":"class ResourceConsumer(object):"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    @abc.abstractmethod"},{"line_number":24,"context_line":"    def read(self, host_state):"},{"line_number":25,"context_line":"        pass"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_d77a48f0","line":24,"in_reply_to":"AAAAXH%2F%2FNnY%3D","updated":"2014-07-03 03:07:33.000000000","message":"Will do","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"c0ca0036b858ef70089b3f16cc19b1a927433381","unresolved":false,"context_lines":[{"line_number":21,"context_line":"class ResourceConsumer(object):"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    @abc.abstractmethod"},{"line_number":24,"context_line":"    def read(self, host_state):"},{"line_number":25,"context_line":"        pass"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_f611c752","line":24,"in_reply_to":"baada198_d77a48f0","updated":"2014-07-04 21:12:40.000000000","message":"Done and changed name to update_from_compute_node()","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"67153c47de5929efec7418a66f2f3c388547417c","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    @abc.abstractmethod"},{"line_number":28,"context_line":"    def consume_from_instance(self, host_state,"},{"line_number":29,"context_line":"                              instance, instance_type):"},{"line_number":30,"context_line":"        \"\"\"Consume resources according to host requirements.\"\"\""},{"line_number":31,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAXH%2F%2FNmU%3D","line":30,"updated":"2014-04-23 09:40:39.000000000","message":"please also comment the arguments with expected types","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"881ea86225c78d916d6be6c7fd963cf6b105ae26","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    @abc.abstractmethod"},{"line_number":28,"context_line":"    def consume_from_instance(self, host_state,"},{"line_number":29,"context_line":"                              instance, instance_type):"},{"line_number":30,"context_line":"        \"\"\"Consume resources according to host requirements.\"\"\""},{"line_number":31,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_f77d8ce8","line":30,"in_reply_to":"AAAAXH%2F%2FNmU%3D","updated":"2014-07-03 03:07:33.000000000","message":"Will do","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"c0ca0036b858ef70089b3f16cc19b1a927433381","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    @abc.abstractmethod"},{"line_number":28,"context_line":"    def consume_from_instance(self, host_state,"},{"line_number":29,"context_line":"                              instance, instance_type):"},{"line_number":30,"context_line":"        \"\"\"Consume resources according to host requirements.\"\"\""},{"line_number":31,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_161b9b73","line":30,"in_reply_to":"baada198_f77d8ce8","updated":"2014-07-04 21:12:40.000000000","message":"Done and changed name to update_from_instance()","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"}],"nova/scheduler/consumers/vcpu.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"67153c47de5929efec7418a66f2f3c388547417c","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    def read(self, host_state):"},{"line_number":26,"context_line":"        vcpu \u003d host_state.stats.get(\u0027vcpu\u0027, None)"},{"line_number":27,"context_line":"        vcpu \u003d jsonutils.loads(vcpu)"},{"line_number":28,"context_line":"        host_state.stats[\u0027vcpu\u0027] \u003d vcpu"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def consume_from_instance(self, host_state,"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAXH%2F%2FNtE%3D","line":27,"updated":"2014-04-23 09:40:39.000000000","message":"if vcpu is set to None, it will raise a TypeError which should be handled, at least by logging, as propagate_map_exceptions is set to False for the ExtensionManager","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"881ea86225c78d916d6be6c7fd963cf6b105ae26","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    def read(self, host_state):"},{"line_number":26,"context_line":"        vcpu \u003d host_state.stats.get(\u0027vcpu\u0027, None)"},{"line_number":27,"context_line":"        vcpu \u003d jsonutils.loads(vcpu)"},{"line_number":28,"context_line":"        host_state.stats[\u0027vcpu\u0027] \u003d vcpu"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def consume_from_instance(self, host_state,"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_77697c24","line":27,"in_reply_to":"AAAAXH%2F%2FNtE%3D","updated":"2014-07-03 03:07:33.000000000","message":"Sorry, this is all out of date","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"798fd46bf1e90822352901391e092f75bcd484cb","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    def read(self, host_state):"},{"line_number":26,"context_line":"        vcpu \u003d host_state.stats.get(\u0027vcpu\u0027, None)"},{"line_number":27,"context_line":"        vcpu \u003d jsonutils.loads(vcpu)"},{"line_number":28,"context_line":"        host_state.stats[\u0027vcpu\u0027] \u003d vcpu"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def consume_from_instance(self, host_state,"},{"line_number":31,"context_line":"                              instance, instance_type):"}],"source_content_type":"text/x-python","patch_set":26,"id":"7adec928_0b64d0b7","line":28,"updated":"2014-05-09 13:40:01.000000000","message":"You know, I kinda assumed the json would have already been loaded in a more global way at this point? It feels bad doing so much json parsing.","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"881ea86225c78d916d6be6c7fd963cf6b105ae26","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    def read(self, host_state):"},{"line_number":26,"context_line":"        vcpu \u003d host_state.stats.get(\u0027vcpu\u0027, None)"},{"line_number":27,"context_line":"        vcpu \u003d jsonutils.loads(vcpu)"},{"line_number":28,"context_line":"        host_state.stats[\u0027vcpu\u0027] \u003d vcpu"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def consume_from_instance(self, host_state,"},{"line_number":31,"context_line":"                              instance, instance_type):"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_f764ac4a","line":28,"in_reply_to":"7adec928_0b64d0b7","updated":"2014-07-03 03:07:33.000000000","message":"Yes, there is not json here. this is way out of date","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"c0ca0036b858ef70089b3f16cc19b1a927433381","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    def read(self, host_state):"},{"line_number":26,"context_line":"        vcpu \u003d host_state.stats.get(\u0027vcpu\u0027, None)"},{"line_number":27,"context_line":"        vcpu \u003d jsonutils.loads(vcpu)"},{"line_number":28,"context_line":"        host_state.stats[\u0027vcpu\u0027] \u003d vcpu"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def consume_from_instance(self, host_state,"},{"line_number":31,"context_line":"                              instance, instance_type):"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_f638e7d4","line":28,"in_reply_to":"baada198_f764ac4a","updated":"2014-07-04 21:12:40.000000000","message":"All json processing has been removed from here.","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"67153c47de5929efec7418a66f2f3c388547417c","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def consume_from_instance(self, host_state,"},{"line_number":31,"context_line":"                              instance, instance_type):"},{"line_number":32,"context_line":"        host_state.stats[\u0027vcpu\u0027][\u0027used\u0027] +\u003d instance[\u0027vcpus\u0027]"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAXH%2F%2FNsc%3D","line":32,"updated":"2014-04-23 09:40:39.000000000","message":"instance.get(\u0027vcpus\u0027) would be better IMHO, so it would be set to None instead of raising an Exception","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"881ea86225c78d916d6be6c7fd963cf6b105ae26","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def consume_from_instance(self, host_state,"},{"line_number":31,"context_line":"                              instance, instance_type):"},{"line_number":32,"context_line":"        host_state.stats[\u0027vcpu\u0027][\u0027used\u0027] +\u003d instance[\u0027vcpus\u0027]"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_d7c88824","line":32,"in_reply_to":"7adec928_8b6f0092","updated":"2014-07-03 03:07:33.000000000","message":"I think @John is right, this one is always there.","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"798fd46bf1e90822352901391e092f75bcd484cb","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def consume_from_instance(self, host_state,"},{"line_number":31,"context_line":"                              instance, instance_type):"},{"line_number":32,"context_line":"        host_state.stats[\u0027vcpu\u0027][\u0027used\u0027] +\u003d instance[\u0027vcpus\u0027]"}],"source_content_type":"text/x-python","patch_set":26,"id":"7adec928_8b6f0092","line":32,"in_reply_to":"AAAAXH%2F%2FNsc%3D","updated":"2014-05-09 13:40:01.000000000","message":"hmm, not so sure, it always should be there.","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"ea545456d4e80cdfe4c7ca21247c0436dc07eb47","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        host_state.vcpus_used \u003d compute[\u0027vcpus_used\u0027]"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def update_from_instance(self, host_state, instance, instance_type):"},{"line_number":29,"context_line":"        host_state.vcpus_used \u003d instance[\u0027vcpus\u0027]"}],"source_content_type":"text/x-python","patch_set":27,"id":"baada198_4c2bc6ea","line":29,"updated":"2014-07-21 08:13:20.000000000","message":"I may be missing something, but I think you want \"+\u003d\" here. The tests should be changed to catch that case too.","commit_id":"3377811c75dc8f80509b4a911902c5083d30fb18"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"7183a5f8324faacd2020978f87edde8b0b46690e","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        host_state.vcpus_used \u003d compute[\u0027vcpus_used\u0027]"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def update_from_instance(self, host_state, instance, instance_type):"},{"line_number":29,"context_line":"        host_state.vcpus_used \u003d instance[\u0027vcpus\u0027]"}],"source_content_type":"text/x-python","patch_set":27,"id":"baada198_689061ed","line":29,"in_reply_to":"baada198_056eeeff","updated":"2014-07-21 16:58:59.000000000","message":"Done - the test had host_state.vcpus_used initialized to 0, so \u0027\u003d\u0027 and \u0027+\u003d\u0027 give same result. Fixed that so it is initialized to non-zero and checked this bug caused it to fail before fixing this bug.","commit_id":"3377811c75dc8f80509b4a911902c5083d30fb18"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"deadb0ecca9a014658c5fce784292aa2a7ee66e1","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        host_state.vcpus_used \u003d compute[\u0027vcpus_used\u0027]"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def update_from_instance(self, host_state, instance, instance_type):"},{"line_number":29,"context_line":"        host_state.vcpus_used \u003d instance[\u0027vcpus\u0027]"}],"source_content_type":"text/x-python","patch_set":27,"id":"baada198_a4ee32eb","line":29,"in_reply_to":"baada198_4c2bc6ea","updated":"2014-07-21 11:24:44.000000000","message":"+1","commit_id":"3377811c75dc8f80509b4a911902c5083d30fb18"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"c6c5c9b6f847b68d2c614b72739aeee8652a39f8","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        host_state.vcpus_used \u003d compute[\u0027vcpus_used\u0027]"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def update_from_instance(self, host_state, instance, instance_type):"},{"line_number":29,"context_line":"        host_state.vcpus_used \u003d instance[\u0027vcpus\u0027]"}],"source_content_type":"text/x-python","patch_set":27,"id":"baada198_056eeeff","line":29,"in_reply_to":"baada198_a4ee32eb","updated":"2014-07-21 16:38:24.000000000","message":"Absolutely right - this should be +\u003d\n\nI will fix and checkout why the test didn\u0027t catch this - its uses the existing tests which should cover this.","commit_id":"3377811c75dc8f80509b4a911902c5083d30fb18"}],"nova/scheduler/filter_scheduler.py":[{"author":{"_account_id":8514,"name":"Yathiraj Udupi","email":"yudupi@cisco.com","username":"yudupi"},"change_message_id":"7f324b73aa189e0ba822cf7e24f124078ec9aa72","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            # Now consume the resources so the filter/weights"},{"line_number":348,"context_line":"            # will change for the next instance."},{"line_number":349,"context_line":"            chosen_host.obj.consume_from_instance(instance_properties,"},{"line_number":350,"context_line":"                                                  instance_type)"},{"line_number":351,"context_line":"            if update_group_hosts is True:"},{"line_number":352,"context_line":"                filter_properties[\u0027group_hosts\u0027].append(chosen_host.obj.host)"},{"line_number":353,"context_line":"        return selected_hosts"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUX%2F%2Bzo8%3D","line":350,"updated":"2014-02-18 22:10:33.000000000","message":"Same comment as in the consumers.py file, why a separate instance_type argument, instead is it possible to add another item to the instance_properties dictionary directly?","commit_id":"90c596309193162aa8d6e0f5750618a47c5e6919"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"539a0b9b4c5202fe7ea5573eb5f4eb5fa79d21f3","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            # Now consume the resources so the filter/weights"},{"line_number":348,"context_line":"            # will change for the next instance."},{"line_number":349,"context_line":"            chosen_host.obj.consume_from_instance(instance_properties,"},{"line_number":350,"context_line":"                                                  instance_type)"},{"line_number":351,"context_line":"            if update_group_hosts is True:"},{"line_number":352,"context_line":"                filter_properties[\u0027group_hosts\u0027].append(chosen_host.obj.host)"},{"line_number":353,"context_line":"        return selected_hosts"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAU3%2F%2FmVk%3D","line":350,"in_reply_to":"AAAAUX%2F%2Bzo8%3D","updated":"2014-02-25 18:41:55.000000000","message":"The consume_from_instance() method expects to get an instance as a parameter. I think the right way to do what you are suggesting is to replace it with filter properties, which contains instance and instance_type. However, that would mean re-writing all the implementations of consume_from_instance() and test cases. So I thought it better to add the instance_type parameter instead as it has least impact, least chance of introducing a bug, and actually represents the two pieces of information being passed in.","commit_id":"90c596309193162aa8d6e0f5750618a47c5e6919"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"179297796abc4f894aa2426b2e20d2275201c663","unresolved":false,"context_lines":[{"line_number":297,"context_line":""},{"line_number":298,"context_line":"            # Now consume the resources so the filter/weights"},{"line_number":299,"context_line":"            # will change for the next instance."},{"line_number":300,"context_line":"            # NOTE(pmurray): this conditional is a hack to avoid"},{"line_number":301,"context_line":"            # modifying the bare metal and Ironic versions of HostState."},{"line_number":302,"context_line":"            # It can be removed when Ironic has merged."},{"line_number":303,"context_line":"            if isinstance(chosen_host.obj, host_manager.HostState):"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_1e4cf03e","line":300,"updated":"2014-08-07 13:20:53.000000000","message":"nit: a FIXME comment would be better I think","commit_id":"95126701dfcee5c89cce21e578374b3fee327619"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"1de6cd853314573be8bafaa5c035bc546fe6ae01","unresolved":false,"context_lines":[{"line_number":300,"context_line":"            # NOTE(pmurray): this conditional is a hack to avoid"},{"line_number":301,"context_line":"            # modifying the bare metal and Ironic versions of HostState."},{"line_number":302,"context_line":"            # It can be removed when Ironic has merged."},{"line_number":303,"context_line":"            if isinstance(chosen_host.obj, host_manager.HostState):"},{"line_number":304,"context_line":"                chosen_host.obj.consume_from_instance(instance_properties,"},{"line_number":305,"context_line":"                                                      instance_type)"},{"line_number":306,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_cb4555b5","line":303,"updated":"2014-08-07 15:55:15.000000000","message":"doh! - They are all subclasses of host_manager.HostState - make this more specific.","commit_id":"95126701dfcee5c89cce21e578374b3fee327619"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"b8de2981160a7ec769889ea9dbd0b41a521c1a78","unresolved":false,"context_lines":[{"line_number":305,"context_line":"            # to avoid having to change those versions of HostState. It can"},{"line_number":306,"context_line":"            # be removed when the restrictions on those classes are removed."},{"line_number":307,"context_line":"            if type(chosen_host.obj) \u003d\u003d host_manager.HostState:"},{"line_number":308,"context_line":"                chosen_host.obj.consume_from_instance(instance_properties,"},{"line_number":309,"context_line":"                                                      instance_type)"},{"line_number":310,"context_line":"            else:"},{"line_number":311,"context_line":"                chosen_host.obj.consume_from_instance(instance_properties)"}],"source_content_type":"text/x-python","patch_set":34,"id":"fa98f980_04121bb1","line":308,"updated":"2014-09-01 15:03:42.000000000","message":"This is confusing, seems like its almost a bug fix.\n\nI get we can\u0027t add this for ironic, but not sure why we need to add it in this in this initial version?","commit_id":"5d8a01fbb241e7600767a93c526d8d3351eb084a"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"499ce33679ebffced23869c1ea2598af2cf1f2c6","unresolved":false,"context_lines":[{"line_number":305,"context_line":"            # to avoid having to change those versions of HostState. It can"},{"line_number":306,"context_line":"            # be removed when the restrictions on those classes are removed."},{"line_number":307,"context_line":"            if type(chosen_host.obj) \u003d\u003d host_manager.HostState:"},{"line_number":308,"context_line":"                chosen_host.obj.consume_from_instance(instance_properties,"},{"line_number":309,"context_line":"                                                      instance_type)"},{"line_number":310,"context_line":"            else:"},{"line_number":311,"context_line":"                chosen_host.obj.consume_from_instance(instance_properties)"}],"source_content_type":"text/x-python","patch_set":34,"id":"fa98f980_abe597a9","line":308,"in_reply_to":"fa98f980_04121bb1","updated":"2014-09-01 17:19:28.000000000","message":"Again, we can drop this, but it removes access to extra_specs - can be added back in later to match behavior at resource tracker when extra_specs exists there.","commit_id":"5d8a01fbb241e7600767a93c526d8d3351eb084a"}],"nova/scheduler/host_manager.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f370b9b38ac7ca4c2851e2c578e79553a0b55db2","unresolved":false,"context_lines":[{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        # Generic consumer extensions"},{"line_number":129,"context_line":"        self.consumer_handler \u003d consumers.ResourceConsumerHandler()"},{"line_number":130,"context_line":"        self.consumer_classes \u003d self.consumer_handler.get_all_classes() #ptm: change to get_loadable_classes(CONF.scheduler_consumer_classes)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        # Additional host information from the compute node stats:"},{"line_number":133,"context_line":"        self.vm_states \u003d {}"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BwWo%3D","line":130,"updated":"2014-01-22 13:43:34.000000000","message":"looks like this breaks pep8","commit_id":"f5b8db3d5fd526d1f3cf9df2c1deb5ed96e953fe"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"b37138264a780ea09023a1601b0850d0b651ad86","unresolved":false,"context_lines":[{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        # Generic consumer extensions"},{"line_number":129,"context_line":"        self.consumer_handler \u003d consumers.ResourceConsumerHandler()"},{"line_number":130,"context_line":"        self.consumer_classes \u003d self.consumer_handler.get_all_classes() #ptm: change to get_loadable_classes(CONF.scheduler_consumer_classes)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        # Additional host information from the compute node stats:"},{"line_number":133,"context_line":"        self.vm_states \u003d {}"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2Bu1k%3D","line":130,"in_reply_to":"AAAAUH%2F%2BwWo%3D","updated":"2014-01-22 18:00:05.000000000","message":"Done","commit_id":"f5b8db3d5fd526d1f3cf9df2c1deb5ed96e953fe"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b7a5645692e2ff8b78482054b9fa59a33372228f","unresolved":false,"context_lines":[{"line_number":193,"context_line":"    def _update_resources_from_compute_node(self, compute):"},{"line_number":194,"context_line":"        # extra_resources is a nullable field in the DB scheme,"},{"line_number":195,"context_line":"        # so make sure we get an empty dictionary if not defined."},{"line_number":196,"context_line":"        extra_resources \u003d compute.get(\u0027extra_resources\u0027, \"{}\") or \"{}\""},{"line_number":197,"context_line":"        self.extra_resources \u003d jsonutils.loads(extra_resources)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        # The values are opaque and may be encoded, so give the resource"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUX%2F%2FjEs%3D","line":196,"updated":"2014-02-12 12:57:53.000000000","message":"Why \"{}\" and not {}\nThe former is a string and the latter a empty dictionary.\nIf this is meant to be a string can you please add to the comment","commit_id":"8d6b23d29b29676a0f62b7473dd9d8ebd5fcf994"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"2d9cabf463bee1e0288aee6db46811f7d6407e33","unresolved":false,"context_lines":[{"line_number":193,"context_line":"    def _update_resources_from_compute_node(self, compute):"},{"line_number":194,"context_line":"        # extra_resources is a nullable field in the DB scheme,"},{"line_number":195,"context_line":"        # so make sure we get an empty dictionary if not defined."},{"line_number":196,"context_line":"        extra_resources \u003d compute.get(\u0027extra_resources\u0027, \"{}\") or \"{}\""},{"line_number":197,"context_line":"        self.extra_resources \u003d jsonutils.loads(extra_resources)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        # The values are opaque and may be encoded, so give the resource"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAU3%2F%2FmRY%3D","line":196,"in_reply_to":"AAAAUX%2F%2FjEs%3D","updated":"2014-02-25 18:41:23.000000000","message":"This does look odd. I have changed it as you suggest and made it consistent with the previous methog.","commit_id":"8d6b23d29b29676a0f62b7473dd9d8ebd5fcf994"},{"author":{"_account_id":8514,"name":"Yathiraj Udupi","email":"yudupi@cisco.com","username":"yudupi"},"change_message_id":"7f324b73aa189e0ba822cf7e24f124078ec9aa72","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        # extra_resources is a nullable field in the DB scheme,"},{"line_number":195,"context_line":"        # so make sure we get an empty dictionary if not defined."},{"line_number":196,"context_line":"        extra_resources \u003d compute.get(\u0027extra_resources\u0027, \"{}\") or \"{}\""},{"line_number":197,"context_line":"        self.extra_resources \u003d jsonutils.loads(extra_resources)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        # The values are opaque and may be encoded, so give the resource"},{"line_number":200,"context_line":"        # consumers a chance to read and convert them if they want to."}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUX%2F%2Bzw0%3D","line":197,"updated":"2014-02-18 22:10:33.000000000","message":"This code is a bit confusing. \nWhy not simplify this as follows?\n----\nextra_resources \u003d compute.get(\u0027extra_resources\u0027)\nif extra_resources:\n    self.extra_resources \u003d jsonutils.loads(extra_resources)\nelse:\n    self.extra_resources \u003d {}\n\n---","commit_id":"90c596309193162aa8d6e0f5750618a47c5e6919"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"539a0b9b4c5202fe7ea5573eb5f4eb5fa79d21f3","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        # extra_resources is a nullable field in the DB scheme,"},{"line_number":195,"context_line":"        # so make sure we get an empty dictionary if not defined."},{"line_number":196,"context_line":"        extra_resources \u003d compute.get(\u0027extra_resources\u0027, \"{}\") or \"{}\""},{"line_number":197,"context_line":"        self.extra_resources \u003d jsonutils.loads(extra_resources)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        # The values are opaque and may be encoded, so give the resource"},{"line_number":200,"context_line":"        # consumers a chance to read and convert them if they want to."}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAU3%2F%2FnFY%3D","line":197,"in_reply_to":"AAAAUX%2F%2Bzw0%3D","updated":"2014-02-25 18:41:55.000000000","message":"Thanks, yes it was confusing and garyk had a similar comment. I like your suggestion but I\u0027ve changed it to be similar to _update_metrics_from_compute_node() (method above) to use a similar style.","commit_id":"90c596309193162aa8d6e0f5750618a47c5e6919"},{"author":{"_account_id":8514,"name":"Yathiraj Udupi","email":"yudupi@cisco.com","username":"yudupi"},"change_message_id":"7f324b73aa189e0ba822cf7e24f124078ec9aa72","unresolved":false,"context_lines":[{"line_number":345,"context_line":"                                                    instance_type)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"    def _statmap(self, stats):"},{"line_number":348,"context_line":"        return dict((st[\u0027key\u0027], st[\u0027value\u0027]) for st in stats)"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    def __repr__(self):"},{"line_number":351,"context_line":"        return (\"(%s, %s) ram:%s disk:%s io_ops:%s instances:%s\" %"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUX%2F%2Bzvs%3D","line":348,"updated":"2014-02-18 22:10:33.000000000","message":"Is this method being used anywhere ? if not remove.","commit_id":"90c596309193162aa8d6e0f5750618a47c5e6919"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"539a0b9b4c5202fe7ea5573eb5f4eb5fa79d21f3","unresolved":false,"context_lines":[{"line_number":345,"context_line":"                                                    instance_type)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"    def _statmap(self, stats):"},{"line_number":348,"context_line":"        return dict((st[\u0027key\u0027], st[\u0027value\u0027]) for st in stats)"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    def __repr__(self):"},{"line_number":351,"context_line":"        return (\"(%s, %s) ram:%s disk:%s io_ops:%s instances:%s\" %"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAU3%2F%2FnCU%3D","line":348,"in_reply_to":"AAAAUX%2F%2Bzvs%3D","updated":"2014-02-25 18:41:55.000000000","message":"Good catch, thanks: this must be a rebase error - it went away from master when another patch merged.","commit_id":"90c596309193162aa8d6e0f5750618a47c5e6919"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9cc3addd34a3861a993584f3463a94bf4ecba6fe","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        # Generic consumer extensions"},{"line_number":135,"context_line":"        self.consumer_handler \u003d consumers.ResourceConsumerHandler()"},{"line_number":136,"context_line":"        self.consumer_classes \u003d self.consumer_handler.get_matching_classes("},{"line_number":137,"context_line":"            CONF.scheduler_consumer_classes)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        # Additional host information from the compute node stats:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAU3%2F%2FejQ%3D","line":136,"updated":"2014-02-26 12:12:03.000000000","message":"It feels bad to have this per Host.\n\nCould we not have this at the module level, and then have the hander create all the objects when it starts up?\n\nWe should get singleton for almost \"free\" that way.","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"dd3cfaa1d65b254613e64d814710f5512a43a109","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        # Generic consumer extensions"},{"line_number":135,"context_line":"        self.consumer_handler \u003d consumers.ResourceConsumerHandler()"},{"line_number":136,"context_line":"        self.consumer_classes \u003d self.consumer_handler.get_matching_classes("},{"line_number":137,"context_line":"            CONF.scheduler_consumer_classes)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        # Additional host information from the compute node stats:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVX%2F%2F6o0%3D","line":136,"in_reply_to":"AAAAU3%2F%2FejQ%3D","updated":"2014-02-27 12:48:55.000000000","message":"Done","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9cc3addd34a3861a993584f3463a94bf4ecba6fe","unresolved":false,"context_lines":[{"line_number":293,"context_line":"        # update resource allocation information"},{"line_number":294,"context_line":"        self._update_resources_from_compute_node(compute)"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"    def consume_from_instance(self, instance, instance_type\u003dNone):"},{"line_number":297,"context_line":"        \"\"\"Incrementally update host state from an instance.\"\"\""},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"        if not instance_type:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAU3%2F%2Fe0I%3D","line":296,"updated":"2014-02-26 12:12:03.000000000","message":"I really hoped the instance would contain the instance_type, but I see instance_type has come from the request spec at this point. Does seem a bit odd, but I can\u0027t think of a better ideas, so ignore me.","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"dd3cfaa1d65b254613e64d814710f5512a43a109","unresolved":false,"context_lines":[{"line_number":293,"context_line":"        # update resource allocation information"},{"line_number":294,"context_line":"        self._update_resources_from_compute_node(compute)"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"    def consume_from_instance(self, instance, instance_type\u003dNone):"},{"line_number":297,"context_line":"        \"\"\"Incrementally update host state from an instance.\"\"\""},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"        if not instance_type:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVX%2F%2F6oA%3D","line":296,"in_reply_to":"AAAAU3%2F%2Fe0I%3D","updated":"2014-02-27 12:48:55.000000000","message":"Happy to ignore :)\nAnd actually I agree.","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":7641,"name":"Shuangtai Tian","email":"hitianst@gmail.com","username":"shuangtai"},"change_message_id":"eae338e15b739696d7f50610e2b86d4cd12b553b","unresolved":false,"context_lines":[{"line_number":195,"context_line":"    def _update_resources_from_compute_node(self, compute):"},{"line_number":196,"context_line":"        # extra_resources is a nullable field in the DB scheme,"},{"line_number":197,"context_line":"        # so make sure we get an empty dictionary if not defined."},{"line_number":198,"context_line":"        extra_resources \u003d compute.get(\u0027extra_resources\u0027, {}) or {}"},{"line_number":199,"context_line":"        if extra_resources:"},{"line_number":200,"context_line":"            self.extra_resources \u003d jsonutils.loads(extra_resources)"},{"line_number":201,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAW3%2F%2Fy6M%3D","line":198,"updated":"2014-04-10 11:18:29.000000000","message":"i think the get default return is {}, right?  so can we remove the \"or {}\"?","commit_id":"b02697ffd59867d82bb1ca8b71d83e43718a3192"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"d69d71a699873e8a724daabf95c98b67cc5e45b4","unresolved":false,"context_lines":[{"line_number":195,"context_line":"    def _update_resources_from_compute_node(self, compute):"},{"line_number":196,"context_line":"        # extra_resources is a nullable field in the DB scheme,"},{"line_number":197,"context_line":"        # so make sure we get an empty dictionary if not defined."},{"line_number":198,"context_line":"        extra_resources \u003d compute.get(\u0027extra_resources\u0027, {}) or {}"},{"line_number":199,"context_line":"        if extra_resources:"},{"line_number":200,"context_line":"            self.extra_resources \u003d jsonutils.loads(extra_resources)"},{"line_number":201,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAAW3%2F%2FoV8%3D","line":198,"in_reply_to":"AAAAW3%2F%2Fy6M%3D","updated":"2014-04-11 15:05:12.000000000","message":"The {} in the parameter is returned by default if there is no extra_resources. If there is extra_resources it can have None as its value. If we get that we want to use {} instead so \u0027or {}\u0027 will be used.\n\nThis whole method is gone now - moving to use stats field instead of extra_resources field.","commit_id":"b02697ffd59867d82bb1ca8b71d83e43718a3192"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"798fd46bf1e90822352901391e092f75bcd484cb","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"# Generic consumer extensions"},{"line_number":111,"context_line":"ConsumerHandler \u003d consumers.ResourceConsumerHandler(CONF.scheduler_consumers)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"class HostState(object):"}],"source_content_type":"text/x-python","patch_set":26,"id":"7adec928_8bf620d6","line":111,"updated":"2014-05-09 13:40:01.000000000","message":"hmm, can these be all caps please? not sure we say that anywhere, but I thought you had imported a class directly when I look at what was happening below.\n\nCONSUMER_HANDLER","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"c0ca0036b858ef70089b3f16cc19b1a927433381","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"# Generic consumer extensions"},{"line_number":111,"context_line":"ConsumerHandler \u003d consumers.ResourceConsumerHandler(CONF.scheduler_consumers)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"class HostState(object):"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_767bf78b","line":111,"in_reply_to":"7adec928_8bf620d6","updated":"2014-07-04 21:12:40.000000000","message":"Done","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"798fd46bf1e90822352901391e092f75bcd484cb","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        self.disk_mb_used \u003d 0"},{"line_number":130,"context_line":"        self.free_ram_mb \u003d 0"},{"line_number":131,"context_line":"        self.free_disk_mb \u003d 0"},{"line_number":132,"context_line":"        self.vcpus_total \u003d 0"},{"line_number":133,"context_line":"        self.vcpus_used \u003d 0"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        # Generic resource extensions"}],"source_content_type":"text/x-python","patch_set":26,"id":"7adec928_0b0bf0d6","line":132,"updated":"2014-05-09 13:40:01.000000000","message":"I expected this stuff to be deleted","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"c0ca0036b858ef70089b3f16cc19b1a927433381","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        self.disk_mb_used \u003d 0"},{"line_number":130,"context_line":"        self.free_ram_mb \u003d 0"},{"line_number":131,"context_line":"        self.free_disk_mb \u003d 0"},{"line_number":132,"context_line":"        self.vcpus_total \u003d 0"},{"line_number":133,"context_line":"        self.vcpus_used \u003d 0"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        # Generic resource extensions"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_1660fbcd","line":132,"in_reply_to":"7adec928_0b0bf0d6","updated":"2014-07-04 21:12:40.000000000","message":"Done","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"589fd75303ed294df9929716be2c840aa7ef9bb1","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        self.extra_resources \u003d {}"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        # Generic consumer extensions"},{"line_number":139,"context_line":"        self.consumer_handler \u003d ConsumerHandler"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        # Extra resource information"},{"line_number":142,"context_line":"        self.stats \u003d {}"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_7e5d49e9","line":139,"updated":"2014-06-30 14:58:12.000000000","message":"If ConsumerHandler is a module level singleton object, it probably doesn\u0027t need to also be an instance variable.","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"c0ca0036b858ef70089b3f16cc19b1a927433381","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        self.extra_resources \u003d {}"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        # Generic consumer extensions"},{"line_number":139,"context_line":"        self.consumer_handler \u003d ConsumerHandler"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        # Extra resource information"},{"line_number":142,"context_line":"        self.stats \u003d {}"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_d642033d","line":139,"in_reply_to":"baada198_7e5d49e9","updated":"2014-07-04 21:12:40.000000000","message":"I was just changing this as you suggested when I realised I use it as a convienient way to replace the handler with a fake in the tests. It is also overridden with an alternative in the bare metal host manager that subclasses this. So I have left it as it is. Otherwise I would have done as you say. The reason for the module level singleton is so it doesn\u0027t get reconstructed for every host on every load - otherwise I generally try to avoid singletons altogether.","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"67153c47de5929efec7418a66f2f3c388547417c","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            else:"},{"line_number":196,"context_line":"                LOG.warn(_(\"Metric name unknown of %r\") % item)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"    # ptm: remove"},{"line_number":199,"context_line":"    # def _update_resources_from_compute_node(self, compute):"},{"line_number":200,"context_line":"    #     # extra_resources is a nullable field in the DB scheme,"},{"line_number":201,"context_line":"    #     # so make sure we get an empty dictionary if not defined."}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAXH%2F%2FNkg%3D","line":198,"updated":"2014-04-23 09:40:39.000000000","message":"maybe a miss here ?","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"881ea86225c78d916d6be6c7fd963cf6b105ae26","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            else:"},{"line_number":196,"context_line":"                LOG.warn(_(\"Metric name unknown of %r\") % item)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"    # ptm: remove"},{"line_number":199,"context_line":"    # def _update_resources_from_compute_node(self, compute):"},{"line_number":200,"context_line":"    #     # extra_resources is a nullable field in the DB scheme,"},{"line_number":201,"context_line":"    #     # so make sure we get an empty dictionary if not defined."}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_37d624c6","line":198,"in_reply_to":"AAAAXH%2F%2FNkg%3D","updated":"2014-07-03 03:07:33.000000000","message":"yep, big time! :(","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"c0ca0036b858ef70089b3f16cc19b1a927433381","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            else:"},{"line_number":196,"context_line":"                LOG.warn(_(\"Metric name unknown of %r\") % item)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"    # ptm: remove"},{"line_number":199,"context_line":"    # def _update_resources_from_compute_node(self, compute):"},{"line_number":200,"context_line":"    #     # extra_resources is a nullable field in the DB scheme,"},{"line_number":201,"context_line":"    #     # so make sure we get an empty dictionary if not defined."}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_1632bbf1","line":198,"in_reply_to":"baada198_37d624c6","updated":"2014-07-04 21:12:40.000000000","message":"Done","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"67153c47de5929efec7418a66f2f3c388547417c","unresolved":false,"context_lines":[{"line_number":296,"context_line":"        # update metrics"},{"line_number":297,"context_line":"        self._update_metrics_from_compute_node(compute)"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"    def consume_from_instance(self, instance, instance_type\u003dNone):"},{"line_number":300,"context_line":"        \"\"\"Incrementally update host state from an instance.\"\"\""},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"        if not instance_type:"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAXH%2F%2FNk4%3D","line":299,"updated":"2014-04-23 09:40:39.000000000","message":"why are you needing instance_type as arg ? There is no explanation as the example plugin is not using it.","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"c0ca0036b858ef70089b3f16cc19b1a927433381","unresolved":false,"context_lines":[{"line_number":296,"context_line":"        # update metrics"},{"line_number":297,"context_line":"        self._update_metrics_from_compute_node(compute)"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"    def consume_from_instance(self, instance, instance_type\u003dNone):"},{"line_number":300,"context_line":"        \"\"\"Incrementally update host state from an instance.\"\"\""},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"        if not instance_type:"}],"source_content_type":"text/x-python","patch_set":26,"id":"baada198_365dff15","line":299,"in_reply_to":"AAAAXH%2F%2FNk4%3D","updated":"2014-07-04 21:12:40.000000000","message":"I have added an explanation for why it is there in the base class.","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d785c1b7eca9c309623e1d1b4b0d79825746c871","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    previously used and lock down access."},{"line_number":118,"context_line":"    \"\"\""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def __init__(self, host, node, compute\u003dNone):"},{"line_number":121,"context_line":"        self.host \u003d host"},{"line_number":122,"context_line":"        self.nodename \u003d node"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_4651bad7","line":120,"updated":"2014-07-28 14:06:41.000000000","message":", ext_handler\u003dNone):","commit_id":"5fe1ee9d1c5654403fe72b32cb35750ff129281c"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"d785c1b7eca9c309623e1d1b4b0d79825746c871","unresolved":false,"context_lines":[{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        # Generic consumer extensions"},{"line_number":138,"context_line":"        # This is a class parameter to make it easy to override"},{"line_number":139,"context_line":"        self.ext_resources_handler \u003d RESOURCE_HANDLER"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        # Extra resource information"},{"line_number":142,"context_line":"        self.stats \u003d {}"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_46c45a5f","line":139,"updated":"2014-07-28 14:06:41.000000000","message":"I think this is a bit more consistent style-wise when you want to pass in an object that differs only in the test cases.  Your test case can just use the kwarg above.  (Sorry about the nit-pickiness.)\n\nif ext_handler is None:\n    ext_handler \u003d RESOURCE_HANDLER\n\nself.ext_resources_handler \u003d ext_handler","commit_id":"5fe1ee9d1c5654403fe72b32cb35750ff129281c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"b8de2981160a7ec769889ea9dbd0b41a521c1a78","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        # update metrics"},{"line_number":250,"context_line":"        self._update_metrics_from_compute_node(compute)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def consume_from_instance(self, instance, instance_type\u003dNone):"},{"line_number":253,"context_line":"        \"\"\"Incrementally update host state from an instance.\"\"\""},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        if not instance_type:"}],"source_content_type":"text/x-python","patch_set":34,"id":"fa98f980_a4ddcf16","line":252,"updated":"2014-09-01 15:03:42.000000000","message":"Not sure I understand why we are adding instance_type here, particularly if its not needed yet? You can extract the instance_type for system_metadata in instance, so seems odd to include it here, although maybe that changes for things like resize, etc, but thats not really covered here.","commit_id":"5d8a01fbb241e7600767a93c526d8d3351eb084a"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"499ce33679ebffced23869c1ea2598af2cf1f2c6","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        # update metrics"},{"line_number":250,"context_line":"        self._update_metrics_from_compute_node(compute)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def consume_from_instance(self, instance, instance_type\u003dNone):"},{"line_number":253,"context_line":"        \"\"\"Incrementally update host state from an instance.\"\"\""},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        if not instance_type:"}],"source_content_type":"text/x-python","patch_set":34,"id":"fa98f980_2b360753","line":252,"in_reply_to":"fa98f980_a4ddcf16","updated":"2014-09-01 17:19:28.000000000","message":"This anticipates access to extra_specs, which is available here through instance_type because it is added into the request - even though it is not available at the compute node. I agree this seems odd when it is not used in the example.\n\nDo you think I should remove it?","commit_id":"5d8a01fbb241e7600767a93c526d8d3351eb084a"}],"nova/tests/scheduler/fakes.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9cc3addd34a3861a993584f3463a94bf4ecba6fe","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        extra_resources[\u0027resource1\u0027] \u003d res - req"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"class FakeConsumer2(consumers.BaseResourceConsumer):"},{"line_number":293,"context_line":"    def consume_from_instance(self, extra_resources,"},{"line_number":294,"context_line":"                              instance, instance_type):"},{"line_number":295,"context_line":"        \"\"\"Consume resources according to host requirements.\"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAU3%2F%2FeyM%3D","line":292,"updated":"2014-02-26 12:12:03.000000000","message":"Its not very DRY. Maybe just have a module function to reduce the repeated code here?","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"}],"nova/tests/scheduler/test_consumers.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9cc3addd34a3861a993584f3463a94bf4ecba6fe","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        instance \u003d fake_instance_dict()"},{"line_number":84,"context_line":"        instance_type \u003d fake_instance_type_dict()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        handler.consume_from_instance(classes,"},{"line_number":87,"context_line":"                                      host_state.extra_resources,"},{"line_number":88,"context_line":"                                      instance,"},{"line_number":89,"context_line":"                                      instance_type)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAU3%2F%2FexE%3D","line":86,"updated":"2014-02-26 12:12:03.000000000","message":"Its a bit integration testy.\n\nWould be nice to see tests for the separate components.\n\nUnit tests are great at documenting how you use each component, we are missing that value here. This just looks like \"magic\" happens.","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"dd3cfaa1d65b254613e64d814710f5512a43a109","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        instance \u003d fake_instance_dict()"},{"line_number":84,"context_line":"        instance_type \u003d fake_instance_type_dict()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        handler.consume_from_instance(classes,"},{"line_number":87,"context_line":"                                      host_state.extra_resources,"},{"line_number":88,"context_line":"                                      instance,"},{"line_number":89,"context_line":"                                      instance_type)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVX%2F%2F6S8%3D","line":86,"in_reply_to":"AAAAU3%2F%2FexE%3D","updated":"2014-02-27 12:48:55.000000000","message":"I have tried to split this out into a test for one of the consumers and more tests for the handler.","commit_id":"4245df757d70034a3bcf834861f9cf3d8fa8ee5c"}],"setup.cfg":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"67153c47de5929efec7418a66f2f3c388547417c","unresolved":false,"context_lines":[{"line_number":29,"context_line":"[entry_points]"},{"line_number":30,"context_line":"nova.compute.resources \u003d"},{"line_number":31,"context_line":"    vcpu \u003d nova.compute.resources.vcpu:VCPU"},{"line_number":32,"context_line":"nova.scheduler.consumers \u003d"},{"line_number":33,"context_line":"    vcpu \u003d nova.scheduler.consumers.vcpu:VCPU"},{"line_number":34,"context_line":"nova.image.download.modules \u003d"},{"line_number":35,"context_line":"    file \u003d nova.image.download.file"}],"source_content_type":"text/x-ttcn-cfg","patch_set":26,"id":"AAAAXH%2F%2FNxU%3D","line":32,"updated":"2014-04-23 09:40:39.000000000","message":"IMHO, from an operator point of view, both namespaces should have the same top-level domain, like :\n\n nova.resources.producers \u003d nova.compute.resources.vcpu:VCPU\n nova.resources.consumers \u003d vcpu \u003d nova.scheduler.consumers.vcpu:VCPU","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"589fd75303ed294df9929716be2c840aa7ef9bb1","unresolved":false,"context_lines":[{"line_number":29,"context_line":"[entry_points]"},{"line_number":30,"context_line":"nova.compute.resources \u003d"},{"line_number":31,"context_line":"    vcpu \u003d nova.compute.resources.vcpu:VCPU"},{"line_number":32,"context_line":"nova.scheduler.consumers \u003d"},{"line_number":33,"context_line":"    vcpu \u003d nova.scheduler.consumers.vcpu:VCPU"},{"line_number":34,"context_line":"nova.image.download.modules \u003d"},{"line_number":35,"context_line":"    file \u003d nova.image.download.file"}],"source_content_type":"text/x-ttcn-cfg","patch_set":26,"id":"baada198_bee36104","line":32,"in_reply_to":"AAAAXH%2F%2FNxU%3D","updated":"2014-06-30 14:58:12.000000000","message":"+1","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"c0ca0036b858ef70089b3f16cc19b1a927433381","unresolved":false,"context_lines":[{"line_number":29,"context_line":"[entry_points]"},{"line_number":30,"context_line":"nova.compute.resources \u003d"},{"line_number":31,"context_line":"    vcpu \u003d nova.compute.resources.vcpu:VCPU"},{"line_number":32,"context_line":"nova.scheduler.consumers \u003d"},{"line_number":33,"context_line":"    vcpu \u003d nova.scheduler.consumers.vcpu:VCPU"},{"line_number":34,"context_line":"nova.image.download.modules \u003d"},{"line_number":35,"context_line":"    file \u003d nova.image.download.file"}],"source_content_type":"text/x-ttcn-cfg","patch_set":26,"id":"baada198_f694678c","line":32,"in_reply_to":"baada198_37038474","updated":"2014-07-04 21:12:40.000000000","message":"I have changed the name space used here to \"nova.compute.resources.consumers\"\n\nI left the nova.compute.resources in the other patch because I think that is a good name for the resources themselves. As you say, it does make sense that they have the same top level, so I used the same name with the \"consumers\" extension.\n\nLet me know what you think - I am still not keen on \"consumers\". It follows the name of the method HostState.consumer_from_instance().","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"881ea86225c78d916d6be6c7fd963cf6b105ae26","unresolved":false,"context_lines":[{"line_number":29,"context_line":"[entry_points]"},{"line_number":30,"context_line":"nova.compute.resources \u003d"},{"line_number":31,"context_line":"    vcpu \u003d nova.compute.resources.vcpu:VCPU"},{"line_number":32,"context_line":"nova.scheduler.consumers \u003d"},{"line_number":33,"context_line":"    vcpu \u003d nova.scheduler.consumers.vcpu:VCPU"},{"line_number":34,"context_line":"nova.image.download.modules \u003d"},{"line_number":35,"context_line":"    file \u003d nova.image.download.file"}],"source_content_type":"text/x-ttcn-cfg","patch_set":26,"id":"baada198_37038474","line":32,"in_reply_to":"baada198_bee36104","updated":"2014-07-03 03:07:33.000000000","message":"I think maybe the word \"consumers\" is misleading here - this is not a producer-consumer relationship. The plugins at the compute nodes represent resources, (that is why \"nova.compute.resources\"). Although data obtained from the resources are passed to the scheduler, their function is to maintain allocation of the resources they represent. The plugins at the scheduler don\u0027t actually consume resources or resource data, they update cached data in the host_state that is used by the scheduler.\n\nPersonally, and speaking as an operator, I like \"nova.compute.resources\" because they do represent compute resources, but I would consider alternatives that do not have the words producer or consumer in them. Maybe \"nova.resources\" and \"nova.resources.scheduler-cache-updater-thingies\".\n\nOn a process point, these are stated in the nova-spec, so I think maybe we need a really good alternative to make them something else.","commit_id":"b6d4179607073bf1efdf38dafc07c8d6ab27d694"}]}
