)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"capacity-headroom"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The proposol calculates virtual free capacity"},{"line_number":10,"context_line":"for pool and sum total for the backend which"},{"line_number":11,"context_line":"support thin provisioning. It will then notify"},{"line_number":12,"context_line":"various capacity info to Ceilometer service."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3a50d1a3_7df05e67","line":9,"updated":"2015-07-29 10:21:47.000000000","message":"s/proposol/proposal/","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":16883,"name":"huyang","email":"huyang1@huawei.com","username":"huyang"},"change_message_id":"4b1b79c3bbbf789381262cf20ba7013ffb0ee63e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"capacity-headroom"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The proposol calculates virtual free capacity"},{"line_number":10,"context_line":"for pool and sum total for the backend which"},{"line_number":11,"context_line":"support thin provisioning. It will then notify"},{"line_number":12,"context_line":"various capacity info to Ceilometer service."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1a4dcd0f_a52c4bac","line":9,"updated":"2015-08-04 01:44:40.000000000","message":"proposol?","commit_id":"22d863a83095bc1b250e310a3a3ef13c5de1ce26"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"375102b4a7204dfc5d25f78ac0850e883a001d29","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The proposol calculates virtual free capacity"},{"line_number":10,"context_line":"for pool and sum total for the backend which"},{"line_number":11,"context_line":"support thin provisioning. It will then notify"},{"line_number":12,"context_line":"various capacity info to Ceilometer service."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Implements: blueprint capacity-headroom"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3a50d1a3_14463321","line":11,"updated":"2015-08-01 15:07:13.000000000","message":"You are actually calculating for backends support thin and those that don\u0027t support thin.  Two different formulas are used there.","commit_id":"22d863a83095bc1b250e310a3a3ef13c5de1ce26"},{"author":{"_account_id":8202,"name":"chenzongliang","email":"chenzongliang@huawei.com","username":"zongliang"},"change_message_id":"ba98691d440ff7557c3555cbe373e5816fe41e6a","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     XinXiaohui \u003cxiaohui.xin@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-05 09:51:37 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"capacity-headroom"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"It calculates virtual free capacity for"},{"line_number":10,"context_line":"pool and backend which reports definite"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"1a4dcd0f_2c69bb8b","line":7,"updated":"2015-08-05 05:04:21.000000000","message":"capacity-headroom need to be a sentence to describe the feature，refer to http://docs.openstack.org/developer/hacking/","commit_id":"9d0a6222daaeb062663bd8d2921179ba24984ef5"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"a411df8c497b43983760d776c519a81afaffd935","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     XinXiaohui \u003cxiaohui.xin@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-07 15:46:43 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"calculate virtual free capacity and notify"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"It calculates virtual free capacity for"},{"line_number":10,"context_line":"pool and backend which reports definite"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"1a4dcd0f_9bdf67d5","line":7,"updated":"2015-08-07 08:39:35.000000000","message":"Put the capital letter at the beginning.","commit_id":"f22609842851459eb9c6675d6b3d1a14be37c619"},{"author":{"_account_id":16883,"name":"huyang","email":"huyang1@huawei.com","username":"huyang"},"change_message_id":"6948a20b07bbcb0ee4bc7c8d7fa8d03d65b437ba","unresolved":false,"context_lines":[{"line_number":12,"context_line":"capacity info at the same time to"},{"line_number":13,"context_line":"Ceilometer service. It will give users"},{"line_number":14,"context_line":"a bit more clearer about the current"},{"line_number":15,"context_line":"stoage usage situations."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Implements: blueprint capacity-headroom"},{"line_number":18,"context_line":"Change-Id: Iff033d1b591fb3d9c0a5b9732c0c17d96ddbf712"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"1a4dcd0f_3d3b2bd3","line":15,"updated":"2015-08-11 03:45:15.000000000","message":"s/stoage/storage?","commit_id":"52f8bf37589e4f514e2505d87dde1400c0ff74b2"},{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"57ec21084dc2ce9aaed025ad48a029246e46aa51","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Calculate virtual free capacity and notify"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"It calculates virtual free capacity for"},{"line_number":10,"context_line":"pool and backend which reports definite"},{"line_number":11,"context_line":"values. It will also notify various"},{"line_number":12,"context_line":"capacity info to Ceilometer service."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":27,"id":"9a1a9d01_d00f1035","line":9,"updated":"2015-09-30 14:46:09.000000000","message":"Suggest: \"This patch calculates virtual...\"","commit_id":"da72048f3794e414ea93bb8bea92e8641aac57f5"},{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"57ec21084dc2ce9aaed025ad48a029246e46aa51","unresolved":false,"context_lines":[{"line_number":9,"context_line":"It calculates virtual free capacity for"},{"line_number":10,"context_line":"pool and backend which reports definite"},{"line_number":11,"context_line":"values. It will also notify various"},{"line_number":12,"context_line":"capacity info to Ceilometer service."},{"line_number":13,"context_line":"The notification only occurs when"},{"line_number":14,"context_line":"volume status is updated. It will give"},{"line_number":15,"context_line":"users a bit knowledge about the current"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":27,"id":"9a1a9d01_db44114b","line":12,"updated":"2015-09-30 14:46:09.000000000","message":"Suggest: \"It will also notify Ceilometer about capacity info.\"","commit_id":"da72048f3794e414ea93bb8bea92e8641aac57f5"},{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"57ec21084dc2ce9aaed025ad48a029246e46aa51","unresolved":false,"context_lines":[{"line_number":14,"context_line":"volume status is updated. It will give"},{"line_number":15,"context_line":"users a bit knowledge about the current"},{"line_number":16,"context_line":"storage usage."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Implements: blueprint capacity-headroom"},{"line_number":19,"context_line":"Change-Id: Iff033d1b591fb3d9c0a5b9732c0c17d96ddbf712"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":27,"id":"9a1a9d01_7ba145f7","line":17,"updated":"2015-09-30 14:46:09.000000000","message":"It might also be a good idea to talk about why this is necessary. For example, what will this be used for now that this information is readily available?","commit_id":"da72048f3794e414ea93bb8bea92e8641aac57f5"},{"author":{"_account_id":11224,"name":"Swami Reddy","email":"swamireddy@gmail.com","username":"swamireddy"},"change_message_id":"a2f2f0ad3aa45d68c68d3e27e7e6d2b60094f9b0","unresolved":false,"context_lines":[{"line_number":21,"context_line":"a new rpc call named as notify_service_capabilities()"},{"line_number":22,"context_line":"which fanout is false in volume manager which to"},{"line_number":23,"context_line":"send capbilities to only one of the schedulers."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Co-Authored-By: Gorka Eguileor \u003cgeguileo@redhat.com\u003e"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Implements: blueprint capacity-headroom"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":37,"id":"9a68dd71_9774b99c","line":24,"updated":"2016-01-21 09:50:32.000000000","message":"Add \"DocImpact\" flag","commit_id":"2cae004f99fa14bf42b16613c70769e9cb3cc2ec"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8efd902f6dd74402a357bcdfe74a88a489dd30d8","unresolved":false,"context_lines":[{"line_number":18,"context_line":"As there are multiple schedulers and volumes, the"},{"line_number":19,"context_line":"patch contains the logic only to send changed"},{"line_number":20,"context_line":"capacity info to ceilometer as possible as. It adds"},{"line_number":21,"context_line":"a new rpc call named as notify_service_capabilities()"},{"line_number":22,"context_line":"which fanout is false in volume manager which to"},{"line_number":23,"context_line":"send capbilities to only one of the schedulers."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Co-Authored-By: Gorka Eguileor \u003cgeguileo@redhat.com\u003e"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":43,"id":"9a68dd71_49d50ab7","line":23,"range":{"start_line":21,"start_character":15,"end_line":23,"end_character":46},"updated":"2016-01-22 14:34:37.000000000","message":"named notify_service_capabilities() with fanout\u003dFalse. This means that only one scheduler will receive it and send the notification.","commit_id":"912377821cf8190e6204d70a4e3d54c61890dfca"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8efd902f6dd74402a357bcdfe74a88a489dd30d8","unresolved":false,"context_lines":[{"line_number":20,"context_line":"capacity info to ceilometer as possible as. It adds"},{"line_number":21,"context_line":"a new rpc call named as notify_service_capabilities()"},{"line_number":22,"context_line":"which fanout is false in volume manager which to"},{"line_number":23,"context_line":"send capbilities to only one of the schedulers."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Co-Authored-By: Gorka Eguileor \u003cgeguileo@redhat.com\u003e"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":43,"id":"9a68dd71_49398a40","line":23,"range":{"start_line":23,"start_character":5,"end_line":23,"end_character":16},"updated":"2016-01-22 14:34:37.000000000","message":"s/capbilities/capabilities","commit_id":"912377821cf8190e6204d70a4e3d54c61890dfca"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"8ce711287b58038ddf2220a8e4fff8d96032a4ef","unresolved":false,"context_lines":[{"line_number":18,"context_line":"As there are multiple schedulers and volumes, the"},{"line_number":19,"context_line":"patch contains the logic only to send changed"},{"line_number":20,"context_line":"capacity info to ceilometer as possible as. It adds"},{"line_number":21,"context_line":"a new rpc call named as notify_service_capabilities()"},{"line_number":22,"context_line":"which fanout is false in volume manager which to"},{"line_number":23,"context_line":"send capbilities to only one of the schedulers."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Co-Authored-By: Gorka Eguileor \u003cgeguileo@redhat.com\u003e"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":43,"id":"9a68dd71_50a57944","line":23,"range":{"start_line":21,"start_character":15,"end_line":23,"end_character":46},"in_reply_to":"9a68dd71_49d50ab7","updated":"2016-01-23 08:34:28.000000000","message":"Will done in next release.","commit_id":"912377821cf8190e6204d70a4e3d54c61890dfca"},{"author":{"_account_id":11224,"name":"Swami Reddy","email":"swamireddy@gmail.com","username":"swamireddy"},"change_message_id":"a0513bf23deaf4e11e1c71b4ad377d8a0b4d8414","unresolved":false,"context_lines":[{"line_number":22,"context_line":"which fanout\u003dfalse in volume manager. This means"},{"line_number":23,"context_line":"that only one scheduler will receive it and send"},{"line_number":24,"context_line":"the notification."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Co-Authored-By: Gorka Eguileor \u003cgeguileo@redhat.com\u003e"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Implements: blueprint capacity-headroom"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":45,"id":"7a5de9d1_b88d2c33","line":25,"updated":"2016-01-28 10:16:06.000000000","message":"Please add \"DocImpact\" flag, these functionalities to added to the documentation.","commit_id":"3c23969c1f6c93a7d5e55470c3b2b97874801f4f"}],"cinder/manager.py":[{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"286fdcf1cef42a0f4c846428db64660c5d00267c","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                context,"},{"line_number":164,"context_line":"                self.service_name,"},{"line_number":165,"context_line":"                self.host,"},{"line_number":166,"context_line":"                self.last_capabilities)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def _add_to_threadpool(self, func, *args, **kwargs):"},{"line_number":169,"context_line":"        self._tp.spawn_n(func, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":18,"id":"da20952f_0646c04e","line":166,"updated":"2015-08-31 14:37:14.000000000","message":"I\u0027m sorry if I miss something, but why we need rpc call again with same args, could we do the notify_service_capabilities in update_service_capabilities routine?","commit_id":"730449a5263a6cfe11388f44be9ec81d01c19a54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8efd902f6dd74402a357bcdfe74a88a489dd30d8","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        \"\"\"Pass data back to the scheduler at a periodic interval.\"\"\""},{"line_number":155,"context_line":"        if self.last_capabilities:"},{"line_number":156,"context_line":"            LOG.debug(\u0027Notifying Schedulers of capabilities ...\u0027)"},{"line_number":157,"context_line":"            self.scheduler_rpcapi.update_service_capabilities("},{"line_number":158,"context_line":"                context,"},{"line_number":159,"context_line":"                self.service_name,"},{"line_number":160,"context_line":"                self.host,"},{"line_number":161,"context_line":"                self.last_capabilities)"},{"line_number":162,"context_line":"            self.scheduler_rpcapi.notify_service_capabilities("},{"line_number":163,"context_line":"                context,"},{"line_number":164,"context_line":"                self.service_name,"},{"line_number":165,"context_line":"                self.host,"},{"line_number":166,"context_line":"                self.last_capabilities)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def _add_to_threadpool(self, func, *args, **kwargs):"},{"line_number":169,"context_line":"        self._tp.spawn_n(func, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":43,"id":"9a68dd71_b64731bb","line":166,"range":{"start_line":157,"start_character":0,"end_line":166,"end_character":39},"updated":"2016-01-22 14:34:37.000000000","message":"I dislike splitting this into two messages. I understand the purpose (fanout vs. non-fanout), but I wonder if this may lead to a inconsistent situation. Please consider an example:\n\n1. c-vol A and c-vol B send notifications almost simultaneously.\n2. c-sch C proceeds with \u0027notify\u0027 message from A before finishing processing \u0027update\u0027 from B.\n3. c-sch D proceeds with \u0027notify\u0027 message from B before finishing processing \u0027update\u0027 from A.\n4. Two contradictory notifications are issued - second one undoes the update from c-vol A.\n\nState will repair itself on next update of course, but maybe we can do better? For example using consistent hash ring to decide which c-sch should send the notification for update message? Or maybe RabbitMQ have stronger guarantees on message delivery order than I think and my concerns are just delusions?","commit_id":"912377821cf8190e6204d70a4e3d54c61890dfca"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"8ce711287b58038ddf2220a8e4fff8d96032a4ef","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        \"\"\"Pass data back to the scheduler at a periodic interval.\"\"\""},{"line_number":155,"context_line":"        if self.last_capabilities:"},{"line_number":156,"context_line":"            LOG.debug(\u0027Notifying Schedulers of capabilities ...\u0027)"},{"line_number":157,"context_line":"            self.scheduler_rpcapi.update_service_capabilities("},{"line_number":158,"context_line":"                context,"},{"line_number":159,"context_line":"                self.service_name,"},{"line_number":160,"context_line":"                self.host,"},{"line_number":161,"context_line":"                self.last_capabilities)"},{"line_number":162,"context_line":"            self.scheduler_rpcapi.notify_service_capabilities("},{"line_number":163,"context_line":"                context,"},{"line_number":164,"context_line":"                self.service_name,"},{"line_number":165,"context_line":"                self.host,"},{"line_number":166,"context_line":"                self.last_capabilities)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def _add_to_threadpool(self, func, *args, **kwargs):"},{"line_number":169,"context_line":"        self._tp.spawn_n(func, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":43,"id":"9a68dd71_b09cf50e","line":166,"range":{"start_line":157,"start_character":0,"end_line":166,"end_character":39},"in_reply_to":"9a68dd71_b64731bb","updated":"2016-01-23 08:34:28.000000000","message":"@Michal Dulko\nHi, Michal, I\u0027m not very sure about the idea. If we use a consistent hash ring to choose the scheduler, someone will be  responsible for the choosing. If we don\u0027t want c-sch to do that, then we need another service. If we use c-sch, then we may face race condition to access the ring. Also we need someplace in other name space which is not in c-sch. I think it\u0027s a bit complicated, as we just want to send some notifications to the ceilometer service as possible as less.\n\nThanks!","commit_id":"912377821cf8190e6204d70a4e3d54c61890dfca"}],"cinder/scheduler/driver.py":[{"author":{"_account_id":13203,"name":"Wilson Liu","email":"295988511@qq.com","username":"Bob-OpenStack"},"change_message_id":"7904583f3dd7874e7f54c573e70fadc81ce88eeb","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                                                      capabilities)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def notify_service_capabilities(self, service_name, host, capabilities):"},{"line_number":87,"context_line":"        \"\"\"notify capability update from a service node.\"\"\""},{"line_number":88,"context_line":"        self.host_manager.notify_service_capabilities(service_name,"},{"line_number":89,"context_line":"                                                      host,"},{"line_number":90,"context_line":"                                                      capabilities)"}],"source_content_type":"text/x-python","patch_set":30,"id":"fa80f949_0f521a14","line":87,"updated":"2015-11-03 14:04:46.000000000","message":"s/notify/Notify","commit_id":"014cbf1aca7d809fa222f5dc936215486e282621"}],"cinder/scheduler/host_manager.py":[{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":340,"context_line":"    def update_pools(self, capability):"},{"line_number":341,"context_line":"        # Do nothing, since we don\u0027t have pools within pool, yet"},{"line_number":342,"context_line":"        pass"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":"class HostManager(object):"},{"line_number":345,"context_line":"    \"\"\"Base HostManager class.\"\"\""},{"line_number":346,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_9dc1aae6","line":343,"updated":"2015-07-29 10:21:47.000000000","message":"Looks like you accidentally removed a blank line that is needed before a class definition.","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":377,"context_line":""},{"line_number":378,"context_line":"        # We get admin context here. Later the update_service_capabilities()"},{"line_number":379,"context_line":"        # will need it for storage capacity notification sending. If we call"},{"line_number":380,"context_line":"        # cinder_context.get_amdin_context() in update_service_capabilities()"},{"line_number":381,"context_line":"        # directly, it will fail the test_update_service_capabilities() since"},{"line_number":382,"context_line":"        # the timeutils.utcnow() function will be called in recurrence."},{"line_number":383,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_fdb22e93","line":380,"updated":"2015-07-29 10:21:47.000000000","message":"s/amdin/admin/","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":383,"context_line":""},{"line_number":384,"context_line":"        self.admin_context \u003d cinder_context.get_admin_context()"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"        # As we already have self.admin_context, so just use it at here."},{"line_number":387,"context_line":"        self._update_host_state_map(self.admin_context)"},{"line_number":388,"context_line":""},{"line_number":389,"context_line":"    def _choose_host_filters(self, filter_cls_names):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_5d45626c","line":386,"updated":"2015-07-29 10:21:47.000000000","message":"s/use it at here/use it here/","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":491,"context_line":"                vol_utils.notify_about_capacity_usage(\\"},{"line_number":492,"context_line":"                    context, capacity[key], \"backend\", None, host)"},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"        LOG.debug(\"Publish storage capacity %(capacity)s\" % {\u0027capacity\u0027: capacity})"},{"line_number":495,"context_line":"        self._no_capabilities_hosts.discard(host)"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    def has_all_capabilities(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_a02b1d81","line":494,"updated":"2015-07-29 10:21:47.000000000","message":"Please indicate which backend or pool the capacity is being published for in this debug message.","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":620,"context_line":"            total \u003d capa.get(\"total_capacity_gb\")"},{"line_number":621,"context_line":"            free \u003d capa.get(\"free_capacity_gb\")"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":"            # Just ignore if the unknown/inifinite storage stats is got"},{"line_number":624,"context_line":"            if (total \u003d\u003d \"infinite\" or total \u003d\u003d \"unknown\" or total \u003d\u003d None) or \\"},{"line_number":625,"context_line":"                (free \u003d\u003d \"infinite\" or free \u003d\u003d \"unknown\" or free \u003d\u003d None):"},{"line_number":626,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_0023f156","line":623,"updated":"2015-07-29 10:21:47.000000000","message":"s/ihifinite/infinite/","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":621,"context_line":"            free \u003d capa.get(\"free_capacity_gb\")"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":"            # Just ignore if the unknown/inifinite storage stats is got"},{"line_number":624,"context_line":"            if (total \u003d\u003d \"infinite\" or total \u003d\u003d \"unknown\" or total \u003d\u003d None) or \\"},{"line_number":625,"context_line":"                (free \u003d\u003d \"infinite\" or free \u003d\u003d \"unknown\" or free \u003d\u003d None):"},{"line_number":626,"context_line":"                break"},{"line_number":627,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_20706d71","line":624,"updated":"2015-07-29 10:21:47.000000000","message":"We are supposed to no longer continue lines with \u0027\\\u0027 and use parens instead.","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":622,"context_line":""},{"line_number":623,"context_line":"            # Just ignore if the unknown/inifinite storage stats is got"},{"line_number":624,"context_line":"            if (total \u003d\u003d \"infinite\" or total \u003d\u003d \"unknown\" or total \u003d\u003d None) or \\"},{"line_number":625,"context_line":"                (free \u003d\u003d \"infinite\" or free \u003d\u003d \"unknown\" or free \u003d\u003d None):"},{"line_number":626,"context_line":"                break"},{"line_number":627,"context_line":"            else:"},{"line_number":628,"context_line":"                allocated \u003d capa.get(\"allocated_capacity_gb\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_80df010c","line":625,"updated":"2015-07-29 10:21:47.000000000","message":"Perhaps this would be nicer:\n\n     unknown_values \u003d {\u0027infinite\u0027, \u0027unknown\u0027, None}\n     if total in unknown_values or free in unknown_values:\n         break","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":623,"context_line":"            # Just ignore if the unknown/inifinite storage stats is got"},{"line_number":624,"context_line":"            if (total \u003d\u003d \"infinite\" or total \u003d\u003d \"unknown\" or total \u003d\u003d None) or \\"},{"line_number":625,"context_line":"                (free \u003d\u003d \"infinite\" or free \u003d\u003d \"unknown\" or free \u003d\u003d None):"},{"line_number":626,"context_line":"                break"},{"line_number":627,"context_line":"            else:"},{"line_number":628,"context_line":"                allocated \u003d capa.get(\"allocated_capacity_gb\")"},{"line_number":629,"context_line":"                provisioned \u003d capa.get(\"provisioned_capacity_gb\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_20f62d8f","line":626,"updated":"2015-07-29 10:21:47.000000000","message":"Why do you break here rather than coninue?","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":624,"context_line":"            if (total \u003d\u003d \"infinite\" or total \u003d\u003d \"unknown\" or total \u003d\u003d None) or \\"},{"line_number":625,"context_line":"                (free \u003d\u003d \"infinite\" or free \u003d\u003d \"unknown\" or free \u003d\u003d None):"},{"line_number":626,"context_line":"                break"},{"line_number":627,"context_line":"            else:"},{"line_number":628,"context_line":"                allocated \u003d capa.get(\"allocated_capacity_gb\")"},{"line_number":629,"context_line":"                provisioned \u003d capa.get(\"provisioned_capacity_gb\")"},{"line_number":630,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_203dcd2a","line":627,"updated":"2015-07-29 10:21:47.000000000","message":"The \u0027else\u0027 is not needed if you break (or continue).","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":630,"context_line":""},{"line_number":631,"context_line":"                # Calculate the virtual free storage"},{"line_number":632,"context_line":"                if capa.get(\"thin_provisioning_support\"):"},{"line_number":633,"context_line":"                    virtual_free \u003d total * \\"},{"line_number":634,"context_line":"                        capa.get(\"max_over_subscription_ration\") - provisioned"},{"line_number":635,"context_line":"                else:"},{"line_number":636,"context_line":"                    virtual_free \u003d total - provisioned"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_a01d5d74","line":633,"updated":"2015-07-29 10:21:47.000000000","message":"Please don\u0027t continue lines with \u0027\\\u0027.","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":631,"context_line":"                # Calculate the virtual free storage"},{"line_number":632,"context_line":"                if capa.get(\"thin_provisioning_support\"):"},{"line_number":633,"context_line":"                    virtual_free \u003d total * \\"},{"line_number":634,"context_line":"                        capa.get(\"max_over_subscription_ration\") - provisioned"},{"line_number":635,"context_line":"                else:"},{"line_number":636,"context_line":"                    virtual_free \u003d total - provisioned"},{"line_number":637,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_13db497d","line":634,"updated":"2015-07-29 10:21:47.000000000","message":"I\u0027d like to see a utility method for calculating virtual free space defined in one place in the scheduler and invoked from capacity filter, capacity weigher, and here.   Note that the formula here is different than what we currently see in the capacity weigher, where virtual_free is a function of reserved space as well.","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":650,"context_line":"                backend \u003d pool.get(\"name\").split(\u0027#\u0027)[0]"},{"line_number":651,"context_line":""},{"line_number":652,"context_line":"                if not capa_b.has_key(backend):"},{"line_number":653,"context_line":"                    capa_b[backend] \u003d {\"name_to_id\":backend,"},{"line_number":654,"context_line":"                                       \"total\":total,"},{"line_number":655,"context_line":"                                       \"free\":free,"},{"line_number":656,"context_line":"                                       \"allocated\":allocated,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_53ac719e","line":653,"updated":"2015-07-29 10:21:47.000000000","message":"put spaces between the \u0027:\u0027 and the values that follow.","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"abac4c6d98a46e713166c55e4c1174e0ad8cf599","unresolved":false,"context_lines":[{"line_number":660,"context_line":"                                       }"},{"line_number":661,"context_line":""},{"line_number":662,"context_line":"                else:"},{"line_number":663,"context_line":"                    capa_b[backend][\"total\"] \u003d \\"},{"line_number":664,"context_line":"                        capa_b[backend][\"total\"] + total"},{"line_number":665,"context_line":"                    capa_b[backend][\"free\"] \u003d \\"},{"line_number":666,"context_line":"                        capa_b[backend][\"free\"] + free"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_f3e9fde6","line":663,"updated":"2015-07-29 10:21:47.000000000","message":"\u0027\\\u0027 continuation.","commit_id":"475b9a50c9f2eb67a50dd84a3f7e3ffe2ea23ae5"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"6abf9ba587150f6db395d5b21d8ca66acfabe748","unresolved":false,"context_lines":[{"line_number":379,"context_line":"        # We get admin context here. Later the update_service_capabilities()"},{"line_number":380,"context_line":"        # will need it for storage capacity notification sending. If we call"},{"line_number":381,"context_line":"        # cinder_context.get_admin_context() in update_service_capabilities()"},{"line_number":382,"context_line":"        # directly, it will fail the test_update_service_capabilities() since"},{"line_number":383,"context_line":"        # the timeutils.utcnow() function will be called in recurrence."},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"        self.admin_context \u003d cinder_context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_3fdda342","line":382,"updated":"2015-08-04 03:12:17.000000000","message":"I think we should fix test_update_service_capabilities() instead.","commit_id":"22d863a83095bc1b250e310a3a3ef13c5de1ce26"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"6abf9ba587150f6db395d5b21d8ca66acfabe748","unresolved":false,"context_lines":[{"line_number":485,"context_line":"        # for pool and backend."},{"line_number":486,"context_line":"        for key in capacity:"},{"line_number":487,"context_line":"            # differentiate the pool/backend with the capacity dict key"},{"line_number":488,"context_line":"            if \"#\" in key:"},{"line_number":489,"context_line":"                vol_utils.notify_about_capacity_usage("},{"line_number":490,"context_line":"                    context, capacity[key], \"pool\", None, host)"},{"line_number":491,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_5fe2ef04","line":488,"updated":"2015-08-04 03:12:17.000000000","message":"delimiter like \u0027#\u0027 may change over time.  I suggest when preparing the capacity dict, you put pool and backend to \u0027pool\u0027 and \u0027backend\u0027 key explicitly.","commit_id":"22d863a83095bc1b250e310a3a3ef13c5de1ce26"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"6abf9ba587150f6db395d5b21d8ca66acfabe748","unresolved":false,"context_lines":[{"line_number":585,"context_line":"    def get_capacity(self, context, timestamp):"},{"line_number":586,"context_line":"        \"\"\"Returns dicts of storage capacity for pools/backends\"\"\""},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"        capa_b \u003d {}"},{"line_number":589,"context_line":"        capa_p \u003d {}"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        # Call get_pools to get the basic storage capacity"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_3fca83a2","line":588,"updated":"2015-08-04 03:12:17.000000000","message":"naming is like C code. :)  I\u0027d prefer to use cap_backend, cap_pool instead.","commit_id":"22d863a83095bc1b250e310a3a3ef13c5de1ce26"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"375102b4a7204dfc5d25f78ac0850e883a001d29","unresolved":false,"context_lines":[{"line_number":628,"context_line":"            # Just ignore if the unknown/infinite storage stats is got"},{"line_number":629,"context_line":"            Unknown \u003d [\"infinite\", \"unknown\", None]"},{"line_number":630,"context_line":"            if (total in Unknown) or (free in Unknown):"},{"line_number":631,"context_line":"                continue"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":"            allocated \u003d capa.get(\"allocated_capacity_gb\")"},{"line_number":634,"context_line":"            provisioned \u003d capa.get(\"provisioned_capacity_gb\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_743697b5","line":631,"updated":"2015-08-01 15:07:13.000000000","message":"I thought you are going to the total number of backends that report unknown or infinite as well.  Are you just ignoring them?","commit_id":"22d863a83095bc1b250e310a3a3ef13c5de1ce26"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"375102b4a7204dfc5d25f78ac0850e883a001d29","unresolved":false,"context_lines":[{"line_number":633,"context_line":"            allocated \u003d capa.get(\"allocated_capacity_gb\")"},{"line_number":634,"context_line":"            provisioned \u003d capa.get(\"provisioned_capacity_gb\")"},{"line_number":635,"context_line":""},{"line_number":636,"context_line":"            # Calculate the virtual free storage, the formula"},{"line_number":637,"context_line":"            # please reference method _weight_object() in Class"},{"line_number":638,"context_line":"            # CapacityWeigher in cinder/scheduler/weights/capacity.py"},{"line_number":639,"context_line":"            reserved \u003d float(capa.get(\"reserved_percentage\")) / 100"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_3457afcb","line":636,"updated":"2015-08-01 15:07:13.000000000","message":"……free storage. For the formula, please reference…...","commit_id":"22d863a83095bc1b250e310a3a3ef13c5de1ce26"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"6abf9ba587150f6db395d5b21d8ca66acfabe748","unresolved":false,"context_lines":[{"line_number":658,"context_line":"                              }"},{"line_number":659,"context_line":""},{"line_number":660,"context_line":"            # Sum the capacity stats for a backend"},{"line_number":661,"context_line":"            backend \u003d pool.get(\"name\").split(\u0027#\u0027)[0]"},{"line_number":662,"context_line":""},{"line_number":663,"context_line":"            if backend not in capa_b:"},{"line_number":664,"context_line":"                capa_b[backend] \u003d {\"name_to_id\": backend,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_1f11c752","line":661,"updated":"2015-08-04 03:12:17.000000000","message":"Please use extract_host() in cinder/volume/utils.py to do this.","commit_id":"22d863a83095bc1b250e310a3a3ef13c5de1ce26"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"6abf9ba587150f6db395d5b21d8ca66acfabe748","unresolved":false,"context_lines":[{"line_number":683,"context_line":"                    capa_b[backend][\"virtual_free\"] + virtual_free)"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        # merge the capacity dicts"},{"line_number":686,"context_line":"        capacity \u003d dict(capa_p, **capa_b)"},{"line_number":687,"context_line":"        return capacity"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_bfb9b330","line":686,"updated":"2015-08-04 03:12:17.000000000","message":"How about:\n\n    capa_p \u003d capa_p.update(capa_b)\n    return capa_p","commit_id":"22d863a83095bc1b250e310a3a3ef13c5de1ce26"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"d5c996261a26e34f063a1c978eebf09c556ce1e3","unresolved":false,"context_lines":[{"line_number":477,"context_line":"                   \u0027cap\u0027: capabilities})"},{"line_number":478,"context_line":""},{"line_number":479,"context_line":"        # Publish the storage capacity here."},{"line_number":480,"context_line":"        # 1) get the storage capacity"},{"line_number":481,"context_line":"        context \u003d self.admin_context"},{"line_number":482,"context_line":"        capacity \u003d self.get_capacity(context, capab_copy[\"timestamp\"])"},{"line_number":483,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_810a55d1","line":480,"updated":"2015-08-04 09:11:05.000000000","message":"Please capitalize the comment strings and end with a period for consistency. i.e. get \u003d\u003e Get","commit_id":"71ab3a8a4db794655f76f02ed327d2b4f2311504"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"d5c996261a26e34f063a1c978eebf09c556ce1e3","unresolved":false,"context_lines":[{"line_number":481,"context_line":"        context \u003d self.admin_context"},{"line_number":482,"context_line":"        capacity \u003d self.get_capacity(context, capab_copy[\"timestamp\"])"},{"line_number":483,"context_line":""},{"line_number":484,"context_line":"        # 2) send notifications to ceilometer in two events"},{"line_number":485,"context_line":"        # for pool and backend."},{"line_number":486,"context_line":"        for key in capacity:"},{"line_number":487,"context_line":"            # differentiate the pool/backend with the capacity dict key"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_c19cdd6b","line":484,"updated":"2015-08-04 09:11:05.000000000","message":"Same as above.","commit_id":"71ab3a8a4db794655f76f02ed327d2b4f2311504"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"d5c996261a26e34f063a1c978eebf09c556ce1e3","unresolved":false,"context_lines":[{"line_number":484,"context_line":"        # 2) send notifications to ceilometer in two events"},{"line_number":485,"context_line":"        # for pool and backend."},{"line_number":486,"context_line":"        for key in capacity:"},{"line_number":487,"context_line":"            # differentiate the pool/backend with the capacity dict key"},{"line_number":488,"context_line":"            if capacity[key][\"type\"] \u003d\u003d \"pool\":"},{"line_number":489,"context_line":"                vol_utils.notify_about_capacity_usage("},{"line_number":490,"context_line":"                    context, capacity[key], \"pool\", None, host)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_e17c7922","line":487,"updated":"2015-08-04 09:11:05.000000000","message":"Same as above.","commit_id":"71ab3a8a4db794655f76f02ed327d2b4f2311504"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"d5c996261a26e34f063a1c978eebf09c556ce1e3","unresolved":false,"context_lines":[{"line_number":493,"context_line":"                    context, capacity[key], \"backend\", None, host)"},{"line_number":494,"context_line":""},{"line_number":495,"context_line":"        # Log the whole capacity dict includes all backends and pools."},{"line_number":496,"context_line":"        LOG.debug(\"Publish storage capacity %(capacity)s\" %"},{"line_number":497,"context_line":"                  {\u0027capacity\u0027: capacity})"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":"        self._no_capabilities_hosts.discard(host)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_8117b5a2","line":496,"updated":"2015-08-04 09:11:05.000000000","message":"Please use \",\" to add variables to log messages instead of \"%\".\n\nref: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages","commit_id":"71ab3a8a4db794655f76f02ed327d2b4f2311504"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"d5c996261a26e34f063a1c978eebf09c556ce1e3","unresolved":false,"context_lines":[{"line_number":690,"context_line":"                capa_backend[backend][\"virtual_free\"] \u003d ("},{"line_number":691,"context_line":"                    capa_backend[backend][\"virtual_free\"] + virtual_free)"},{"line_number":692,"context_line":""},{"line_number":693,"context_line":"        # merge the capacity dicts"},{"line_number":694,"context_line":"        capa_pool.update(capa_backend)"},{"line_number":695,"context_line":"        return capa_pool"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_61c70913","line":693,"updated":"2015-08-04 09:11:05.000000000","message":"Please capitalize the comment strings and end with a period for consistency.","commit_id":"71ab3a8a4db794655f76f02ed327d2b4f2311504"},{"author":{"_account_id":17444,"name":"Jay.Shen","email":"shenhong09@huawei.com","username":"Jay.Shen"},"change_message_id":"1dffe21aa5f24cb08ec69014b95e758851481eb1","unresolved":false,"context_lines":[{"line_number":455,"context_line":"        self.service_states[host] \u003d capab_copy"},{"line_number":456,"context_line":""},{"line_number":457,"context_line":"        LOG.debug(\"Received %(service_name)s service update from \""},{"line_number":458,"context_line":"                  \"%(host)s: %(cap)s\","},{"line_number":459,"context_line":"                  {\u0027service_name\u0027: service_name, \u0027host\u0027: host,"},{"line_number":460,"context_line":"                   \u0027cap\u0027: capabilities})"},{"line_number":461,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a4dcd0f_f162ccac","line":458,"updated":"2015-08-05 04:33:17.000000000","message":"Add \u0027.\u0027 in the end","commit_id":"9d0a6222daaeb062663bd8d2921179ba24984ef5"},{"author":{"_account_id":17444,"name":"Jay.Shen","email":"shenhong09@huawei.com","username":"Jay.Shen"},"change_message_id":"1dffe21aa5f24cb08ec69014b95e758851481eb1","unresolved":false,"context_lines":[{"line_number":476,"context_line":"                    context, capacity[key], \"backend\", None, host)"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"        # Log the whole capacity dict includes all backends and pools."},{"line_number":479,"context_line":"        LOG.debug(\"Publish storage capacity: %s\", capacity)"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":"        self._no_capabilities_hosts.discard(host)"},{"line_number":482,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a4dcd0f_f1d40c48","line":479,"updated":"2015-08-05 04:33:17.000000000","message":"Add \u0027.\u0027 in the end","commit_id":"9d0a6222daaeb062663bd8d2921179ba24984ef5"},{"author":{"_account_id":13203,"name":"Wilson Liu","email":"295988511@qq.com","username":"Bob-OpenStack"},"change_message_id":"7f1ca53096eecd94f4aea1f797dd4a223b5aaad7","unresolved":false,"context_lines":[{"line_number":565,"context_line":"        return all_pools"},{"line_number":566,"context_line":""},{"line_number":567,"context_line":"    def get_capacity(self, context, timestamp):"},{"line_number":568,"context_line":"        \"\"\"Returns dicts of storage capacity for pools/backends\"\"\""},{"line_number":569,"context_line":""},{"line_number":570,"context_line":"        capa_backend \u003d {}"},{"line_number":571,"context_line":"        capa_pool \u003d {}"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_3b9a98c6","line":568,"updated":"2015-08-09 08:30:17.000000000","message":"Add a \u0027.\u0027 to the EOL.","commit_id":"f22609842851459eb9c6675d6b3d1a14be37c619"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"a0c0c8493e435ac0ed21019ced410c2747ba3934","unresolved":false,"context_lines":[{"line_number":570,"context_line":"        capa_backend \u003d {}"},{"line_number":571,"context_line":"        capa_pool \u003d {}"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"        # Call get_pools to get the basic storage capacity"},{"line_number":574,"context_line":"        # The capacity dicts returned will be in the way:"},{"line_number":575,"context_line":"        #"},{"line_number":576,"context_line":"        # capacity \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_080c0b3a","line":573,"updated":"2015-08-10 14:57:37.000000000","message":"Think you meant to remove these :)","commit_id":"bd7d75823688a9fa42db9d768c36303398d4cebb"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"5231835313f386982f318595460d63db055252e1","unresolved":false,"context_lines":[{"line_number":583,"context_line":""},{"line_number":584,"context_line":"            if capa.get(\"thin_provisioning_support\"):"},{"line_number":585,"context_line":"                virtual_free \u003d (total *"},{"line_number":586,"context_line":"                                capa.get(\"max_over_subscription_ration\")"},{"line_number":587,"context_line":"                                - provisioned"},{"line_number":588,"context_line":"                                - math.floor(total * reserved))"},{"line_number":589,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_4b623ada","line":586,"updated":"2015-08-17 15:13:50.000000000","message":"Wrong key name: s/max_over_subscription_ration/max_over_subscription_ratio","commit_id":"68dd780d27c760dc86e8b6270b8c569d0caef52f"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"5231835313f386982f318595460d63db055252e1","unresolved":false,"context_lines":[{"line_number":591,"context_line":""},{"line_number":592,"context_line":"            p_name \u003d pool.get(\"name\")"},{"line_number":593,"context_line":""},{"line_number":594,"context_line":"            # Fill capacity stats we need to notify for a pool\"\"\""},{"line_number":595,"context_line":"            capa_pool[p_name] \u003d {"},{"line_number":596,"context_line":"                \"name_to_id\": p_name,"},{"line_number":597,"context_line":"                \"type\": \"pool\","}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_4b90fa95","line":594,"updated":"2015-08-17 15:13:50.000000000","message":"Please remove \"\"\".  This is not a doctrine.","commit_id":"68dd780d27c760dc86e8b6270b8c569d0caef52f"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"9480cb1b88f3802c4ec214b19a2dd6a529f42973","unresolved":false,"context_lines":[{"line_number":560,"context_line":"        capa_backend \u003d {}"},{"line_number":561,"context_line":"        capa_pool \u003d {}"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"        all_pools \u003d self.get_pools(context)"},{"line_number":564,"context_line":"        for pool in all_pools:"},{"line_number":565,"context_line":"            # Get the capacity stats from capabilities"},{"line_number":566,"context_line":"            capa \u003d pool.get(\"capabilities\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_ed7e9fe3","line":563,"updated":"2015-08-18 08:58:25.000000000","message":"can we do get_admin_context() here before get_pools()?","commit_id":"684c00f93d90205df17bfabc124de7b33bd0fd94"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9e0fa5fdc59606038514de3764dc383edbfd00e8","unresolved":false,"context_lines":[{"line_number":610,"context_line":"                }"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"            else:"},{"line_number":613,"context_line":"                capa_backend[backend][\"total\"] \u003d ("},{"line_number":614,"context_line":"                    capa_backend[backend][\"total\"] + total)"},{"line_number":615,"context_line":"                capa_backend[backend][\"free\"] \u003d ("},{"line_number":616,"context_line":"                    capa_backend[backend][\"free\"] + free)"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_f4e87112","line":613,"updated":"2015-08-19 09:33:07.000000000","message":"+\u003d total","commit_id":"5232fcd28c291697a63f71efb38a0a0edb6feddd"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9e0fa5fdc59606038514de3764dc383edbfd00e8","unresolved":false,"context_lines":[{"line_number":612,"context_line":"            else:"},{"line_number":613,"context_line":"                capa_backend[backend][\"total\"] \u003d ("},{"line_number":614,"context_line":"                    capa_backend[backend][\"total\"] + total)"},{"line_number":615,"context_line":"                capa_backend[backend][\"free\"] \u003d ("},{"line_number":616,"context_line":"                    capa_backend[backend][\"free\"] + free)"},{"line_number":617,"context_line":"                capa_backend[backend][\"allocated\"] \u003d ("},{"line_number":618,"context_line":"                    capa_backend[backend][\"allocated\"] + allocated)"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_34c6e99a","line":615,"updated":"2015-08-19 09:33:07.000000000","message":"+\u003d free","commit_id":"5232fcd28c291697a63f71efb38a0a0edb6feddd"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9e0fa5fdc59606038514de3764dc383edbfd00e8","unresolved":false,"context_lines":[{"line_number":614,"context_line":"                    capa_backend[backend][\"total\"] + total)"},{"line_number":615,"context_line":"                capa_backend[backend][\"free\"] \u003d ("},{"line_number":616,"context_line":"                    capa_backend[backend][\"free\"] + free)"},{"line_number":617,"context_line":"                capa_backend[backend][\"allocated\"] \u003d ("},{"line_number":618,"context_line":"                    capa_backend[backend][\"allocated\"] + allocated)"},{"line_number":619,"context_line":"                capa_backend[backend][\"provisioned\"] \u003d ("},{"line_number":620,"context_line":"                    capa_backend[backend][\"provisioned\"] + provisioned)"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_f4bf11f9","line":617,"updated":"2015-08-19 09:33:07.000000000","message":"+\u003d allocated","commit_id":"5232fcd28c291697a63f71efb38a0a0edb6feddd"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9e0fa5fdc59606038514de3764dc383edbfd00e8","unresolved":false,"context_lines":[{"line_number":616,"context_line":"                    capa_backend[backend][\"free\"] + free)"},{"line_number":617,"context_line":"                capa_backend[backend][\"allocated\"] \u003d ("},{"line_number":618,"context_line":"                    capa_backend[backend][\"allocated\"] + allocated)"},{"line_number":619,"context_line":"                capa_backend[backend][\"provisioned\"] \u003d ("},{"line_number":620,"context_line":"                    capa_backend[backend][\"provisioned\"] + provisioned)"},{"line_number":621,"context_line":"                capa_backend[backend][\"virtual_free\"] \u003d ("},{"line_number":622,"context_line":"                    capa_backend[backend][\"virtual_free\"] + virtual_free)"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_14bba50f","line":619,"updated":"2015-08-19 09:33:07.000000000","message":"+\u003d provisioned","commit_id":"5232fcd28c291697a63f71efb38a0a0edb6feddd"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9e0fa5fdc59606038514de3764dc383edbfd00e8","unresolved":false,"context_lines":[{"line_number":618,"context_line":"                    capa_backend[backend][\"allocated\"] + allocated)"},{"line_number":619,"context_line":"                capa_backend[backend][\"provisioned\"] \u003d ("},{"line_number":620,"context_line":"                    capa_backend[backend][\"provisioned\"] + provisioned)"},{"line_number":621,"context_line":"                capa_backend[backend][\"virtual_free\"] \u003d ("},{"line_number":622,"context_line":"                    capa_backend[backend][\"virtual_free\"] + virtual_free)"},{"line_number":623,"context_line":""},{"line_number":624,"context_line":"        # Merge the capacity dicts."}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_344d893e","line":621,"updated":"2015-08-19 09:33:07.000000000","message":"+\u003d virtual_free","commit_id":"5232fcd28c291697a63f71efb38a0a0edb6feddd"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"fc4ad16f7d2cf03da82efea805415f24b4b8e028","unresolved":false,"context_lines":[{"line_number":460,"context_line":"        # Check if the capabilities is updated. If yes,"},{"line_number":461,"context_line":"        # get storage capacity and notify ceilometer."},{"line_number":462,"context_line":"        if self.is_updated_capabilities(capab_old, capabilities):"},{"line_number":463,"context_line":"            self.get_capacity_and_notify(capab_copy[\"timestamp\"])"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"        self._no_capabilities_hosts.discard(host)"},{"line_number":466,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"fa1b9901_23df143b","line":463,"updated":"2015-08-21 08:51:55.000000000","message":"-1: We should just notify of changes instead of all of them when we have a change in just one","commit_id":"a8e1a8aaca905727549ba76bb4b0ac143505c924"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"fc4ad16f7d2cf03da82efea805415f24b4b8e028","unresolved":false,"context_lines":[{"line_number":467,"context_line":"    def is_updated_capabilities(self, old_capab, new_capab):"},{"line_number":468,"context_line":"        # Check if the capa has the key values."},{"line_number":469,"context_line":"        def _is_ready(capab):"},{"line_number":470,"context_line":"            try:"},{"line_number":471,"context_line":"                pools \u003d capab[\u0027pools\u0027]"},{"line_number":472,"context_line":"            except (TypeError, KeyError):"},{"line_number":473,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa1b9901_f521d39e","line":470,"updated":"2015-08-21 08:51:55.000000000","message":"-1: This whole method can be greatly simplified:\n\n pools \u003d capab.get(\u0027pools\u0027, [])\n required_keys \u003d {\u0027pool_name\u0027, \u0027total_capacity_gb, ...}\n return all(required_keys.issubset(pool) for pool in pools)","commit_id":"a8e1a8aaca905727549ba76bb4b0ac143505c924"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"fc4ad16f7d2cf03da82efea805415f24b4b8e028","unresolved":false,"context_lines":[{"line_number":530,"context_line":""},{"line_number":531,"context_line":"        # Otherwise, we have to check if they\u0027re the same."},{"line_number":532,"context_line":"        # Only if it\u0027s yes, we need to notify."},{"line_number":533,"context_line":"        for old_pool in old_pools:"},{"line_number":534,"context_line":"            # Traverse the old_pools to find the named pool"},{"line_number":535,"context_line":"            # in the new_pools. If it is not found, notify."},{"line_number":536,"context_line":"            found \u003d False"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa1b9901_15d32761","line":533,"range":{"start_line":533,"start_character":21,"end_line":533,"end_character":23},"updated":"2015-08-21 08:51:55.000000000","message":"-1: There\u0027s a cleaner way to do it, this doesn\u0027t look clean","commit_id":"a8e1a8aaca905727549ba76bb4b0ac143505c924"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"fc4ad16f7d2cf03da82efea805415f24b4b8e028","unresolved":false,"context_lines":[{"line_number":732,"context_line":"        # for pool and backend."},{"line_number":733,"context_line":"        for key in capacity:"},{"line_number":734,"context_line":"            # Differentiate the pool/backend with the capacity dict key."},{"line_number":735,"context_line":"            if capacity[key][\"type\"] \u003d\u003d \"pool\":"},{"line_number":736,"context_line":"                vol_utils.notify_about_capacity_usage("},{"line_number":737,"context_line":"                    context, capacity[key], \"pool\", None, None)"},{"line_number":738,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa1b9901_43856857","line":735,"updated":"2015-08-21 08:51:55.000000000","message":"-1: No need for this if:\n\n vol_utils.notify_about_capacity_usage(context, capacity[key], capacity[key][\u0027type\u0027], None, None)","commit_id":"a8e1a8aaca905727549ba76bb4b0ac143505c924"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"286fdcf1cef42a0f4c846428db64660c5d00267c","unresolved":false,"context_lines":[{"line_number":691,"context_line":"                        (new_pool[\u0027thick_provisioning_support\u0027] !\u003d"},{"line_number":692,"context_line":"                            old_pool[\u0027thick_provisioning_support\u0027]) or"},{"line_number":693,"context_line":"                        (new_pool[\u0027reserved_percentage\u0027] !\u003d"},{"line_number":694,"context_line":"                            old_pool[\u0027reserved_percentage\u0027])):"},{"line_number":695,"context_line":"                        updated_pools.append(new_pool)"},{"line_number":696,"context_line":"                    break"},{"line_number":697,"context_line":"            if not found:"}],"source_content_type":"text/x-python","patch_set":18,"id":"da20952f_4b24c1c3","line":694,"updated":"2015-08-31 14:37:14.000000000","message":"this block could be improved better IMO. Add util method to return the true/false, and judge those keys with requires keys list.","commit_id":"730449a5263a6cfe11388f44be9ec81d01c19a54"},{"author":{"_account_id":10439,"name":"Xi Yang","email":"yang.xi@99cloud.net","username":"phenom"},"change_message_id":"1d3a3aa385a2e7274f49a6fe0982416400f5fb40","unresolved":false,"context_lines":[{"line_number":448,"context_line":"        try:"},{"line_number":449,"context_line":"            capab_old \u003d self.service_states[host]"},{"line_number":450,"context_line":"        except KeyError:"},{"line_number":451,"context_line":"            capab_old \u003d {}"},{"line_number":452,"context_line":"        if not self._is_updated(capab_old, capab_copy):"},{"line_number":453,"context_line":"            self.service_states_last[host] \u003d capab_old"},{"line_number":454,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"da20952f_514aa156","line":451,"updated":"2015-09-10 03:41:05.000000000","message":"Could we simplify this try-catch as:\n capa_old \u003d self.service_states.get(host, {})","commit_id":"3978250a60ff9dbcc4c9b230f8c9fb3cee016289"},{"author":{"_account_id":10439,"name":"Xi Yang","email":"yang.xi@99cloud.net","username":"phenom"},"change_message_id":"1d3a3aa385a2e7274f49a6fe0982416400f5fb40","unresolved":false,"context_lines":[{"line_number":472,"context_line":"        try:"},{"line_number":473,"context_line":"            capa_new \u003d self.service_states[host]"},{"line_number":474,"context_line":"        except KeyError:"},{"line_number":475,"context_line":"            capa_new \u003d {}"},{"line_number":476,"context_line":"        timestamp \u003d timeutils.utcnow()"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"        if not capa_new:"}],"source_content_type":"text/x-python","patch_set":25,"id":"da20952f_d16c71d2","line":475,"updated":"2015-09-10 03:41:05.000000000","message":"Same as line 451","commit_id":"3978250a60ff9dbcc4c9b230f8c9fb3cee016289"},{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"57ec21084dc2ce9aaed025ad48a029246e46aa51","unresolved":false,"context_lines":[{"line_number":462,"context_line":"        \"\"\"Notify the ceilometer with updated volume stats\"\"\""},{"line_number":463,"context_line":"        if service_name !\u003d \u0027volume\u0027:"},{"line_number":464,"context_line":"            LOG.debug(\u0027Ignoring %(service_name)s service update \u0027"},{"line_number":465,"context_line":"                      \u0027from %(host)s\u0027,"},{"line_number":466,"context_line":"                      {\u0027service_name\u0027: service_name, \u0027host\u0027: host})"},{"line_number":467,"context_line":"            return"},{"line_number":468,"context_line":"        updated \u003d []"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a1a9d01_70bc04bb","line":465,"updated":"2015-09-30 14:46:09.000000000","message":"\".\" at EOL","commit_id":"da72048f3794e414ea93bb8bea92e8641aac57f5"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"a19b95fe56830d24998c1e8f47a0b67961fdd8fb","unresolved":false,"context_lines":[{"line_number":589,"context_line":"                    backend_usage[\"provisioned\"] +\u003d pool_usage[\"provisioned\"]"},{"line_number":590,"context_line":"                    backend_usage[\"virtual_free\"] +\u003d pool_usage[\"virtual_free\"]"},{"line_number":591,"context_line":"                # Only the updated pool is reported."},{"line_number":592,"context_line":"                if pool in updated_pools:"},{"line_number":593,"context_line":"                    usage.append(pool_usage)"},{"line_number":594,"context_line":"            usage.append(backend_usage)"},{"line_number":595,"context_line":"        return usage"}],"source_content_type":"text/x-python","patch_set":29,"id":"1a26ad4f_b8672db6","line":592,"updated":"2015-10-31 15:51:31.000000000","message":"Move check to see if it is relevant at the beginning of the loop to skip pool_usage processing if it\u0027s not needed.","commit_id":"388fdecdd033dbc08ee4eeae5a06c693b50c8639"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"71322178d24ee21ee8e4c812504ee49394cb83e1","unresolved":false,"context_lines":[{"line_number":589,"context_line":"                    backend_usage[\"provisioned\"] +\u003d pool_usage[\"provisioned\"]"},{"line_number":590,"context_line":"                    backend_usage[\"virtual_free\"] +\u003d pool_usage[\"virtual_free\"]"},{"line_number":591,"context_line":"                # Only the updated pool is reported."},{"line_number":592,"context_line":"                if pool in updated_pools:"},{"line_number":593,"context_line":"                    usage.append(pool_usage)"},{"line_number":594,"context_line":"            usage.append(backend_usage)"},{"line_number":595,"context_line":"        return usage"}],"source_content_type":"text/x-python","patch_set":29,"id":"1a26ad4f_761a017f","line":592,"in_reply_to":"1a26ad4f_b8672db6","updated":"2015-11-02 02:38:03.000000000","message":"Thanks for the comments.Because we want to calculate the backend usage for all the pools it has, so each pool usage cannot be skipped. And if the pool usage is in the updated_pools which means it changed, and then we will collect all the changed pool usages together with the backend usage and then notify. Maybe I have understood you wrong, please correct me. Thanks!","commit_id":"388fdecdd033dbc08ee4eeae5a06c693b50c8639"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"a19b95fe56830d24998c1e8f47a0b67961fdd8fb","unresolved":false,"context_lines":[{"line_number":598,"context_line":"        total \u003d pool[\"total_capacity_gb\"]"},{"line_number":599,"context_line":"        free \u003d pool[\"free_capacity_gb\"]"},{"line_number":600,"context_line":""},{"line_number":601,"context_line":"        Unknown \u003d [\"unknown\", \"infinite\", None]"},{"line_number":602,"context_line":"        if (total in Unknown) or (free in Unknown):"},{"line_number":603,"context_line":"            return {}"},{"line_number":604,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"1a26ad4f_180d01e8","line":601,"updated":"2015-10-31 15:51:31.000000000","message":"Rename Unknown to unknown or something similar to follow variable naming conventions.","commit_id":"388fdecdd033dbc08ee4eeae5a06c693b50c8639"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"71322178d24ee21ee8e4c812504ee49394cb83e1","unresolved":false,"context_lines":[{"line_number":598,"context_line":"        total \u003d pool[\"total_capacity_gb\"]"},{"line_number":599,"context_line":"        free \u003d pool[\"free_capacity_gb\"]"},{"line_number":600,"context_line":""},{"line_number":601,"context_line":"        Unknown \u003d [\"unknown\", \"infinite\", None]"},{"line_number":602,"context_line":"        if (total in Unknown) or (free in Unknown):"},{"line_number":603,"context_line":"            return {}"},{"line_number":604,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"1a26ad4f_56158546","line":601,"in_reply_to":"1a26ad4f_180d01e8","updated":"2015-11-02 02:38:03.000000000","message":"Thanks! I have changed Unknown to unknowns. Done.","commit_id":"388fdecdd033dbc08ee4eeae5a06c693b50c8639"},{"author":{"_account_id":13203,"name":"Wilson Liu","email":"295988511@qq.com","username":"Bob-OpenStack"},"change_message_id":"7904583f3dd7874e7f54c573e70fadc81ce88eeb","unresolved":false,"context_lines":[{"line_number":567,"context_line":"        self._notify_capacity_usage(context, usage)"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"    def _get_usage(self, capa_new, updated_pools, host, timestamp):"},{"line_number":570,"context_line":"        pools \u003d capa_new.get(\u0027pools\u0027, None)"},{"line_number":571,"context_line":"        usage \u003d []"},{"line_number":572,"context_line":"        if pools and isinstance(pools, list):"},{"line_number":573,"context_line":"            backend_usage \u003d dict(type\u003d\u0027backend\u0027,"}],"source_content_type":"text/x-python","patch_set":30,"id":"fa80f949_cf809249","line":570,"updated":"2015-11-03 14:04:46.000000000","message":"Just use capa_new.get(\u0027pools\u0027), no need the second parameter \"None\". The default value will be None if \"pools\" not exists in capa_new.","commit_id":"014cbf1aca7d809fa222f5dc936215486e282621"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":349,"context_line":""},{"line_number":350,"context_line":"        self._no_capabilities_hosts \u003d set()  # Hosts having no capabilities"},{"line_number":351,"context_line":"        self._update_host_state_map(cinder_context.get_admin_context())"},{"line_number":352,"context_line":"        self.service_states_last \u003d {}"},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"    def _choose_host_filters(self, filter_cls_names):"},{"line_number":355,"context_line":"        \"\"\"Return a list of available filter names."}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_ad1f5a5a","line":352,"updated":"2015-11-16 13:14:13.000000000","message":"nit: Maybe improve the name to service_states_last_update or something like that if that\u0027s what it being used for.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":349,"context_line":""},{"line_number":350,"context_line":"        self._no_capabilities_hosts \u003d set()  # Hosts having no capabilities"},{"line_number":351,"context_line":"        self._update_host_state_map(cinder_context.get_admin_context())"},{"line_number":352,"context_line":"        self.service_states_last \u003d {}"},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"    def _choose_host_filters(self, filter_cls_names):"},{"line_number":355,"context_line":"        \"\"\"Return a list of available filter names."}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_c7634440","line":352,"in_reply_to":"ba8a016a_ad1f5a5a","updated":"2015-11-24 17:05:44.000000000","message":"Will make it as service_states_last_updated.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":456,"context_line":"            return"},{"line_number":457,"context_line":"        updated \u003d []"},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"        capa_new \u003d self.service_states.get(host, {})"},{"line_number":460,"context_line":"        timestamp \u003d timeutils.utcnow()"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"        if not capa_new:"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_0deea622","line":459,"updated":"2015-11-16 13:14:13.000000000","message":"nit: This is not capa_new but capa_old","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":456,"context_line":"            return"},{"line_number":457,"context_line":"        updated \u003d []"},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"        capa_new \u003d self.service_states.get(host, {})"},{"line_number":460,"context_line":"        timestamp \u003d timeutils.utcnow()"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"        if not capa_new:"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_47699424","line":459,"in_reply_to":"ba8a016a_0deea622","updated":"2015-11-24 17:05:44.000000000","message":"Will do.Thanks!","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":460,"context_line":"        timestamp \u003d timeutils.utcnow()"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"        if not capa_new:"},{"line_number":463,"context_line":"            updated \u003d self._is_updated(capa_new, capabilities)"},{"line_number":464,"context_line":"        else:"},{"line_number":465,"context_line":"            if timestamp \u003e self.service_states[host][\"timestamp\"]:"},{"line_number":466,"context_line":"                updated \u003d self._is_updated(self.service_states[host],"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_2dbe0a00","line":463,"updated":"2015-11-16 13:14:13.000000000","message":"-1: _is_updated is not a good name, since you are not getting a boolean value but a list.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":460,"context_line":"        timestamp \u003d timeutils.utcnow()"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"        if not capa_new:"},{"line_number":463,"context_line":"            updated \u003d self._is_updated(capa_new, capabilities)"},{"line_number":464,"context_line":"        else:"},{"line_number":465,"context_line":"            if timestamp \u003e self.service_states[host][\"timestamp\"]:"},{"line_number":466,"context_line":"                updated \u003d self._is_updated(self.service_states[host],"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_30c0397c","line":463,"in_reply_to":"ba8a016a_2dbe0a00","updated":"2015-11-24 17:05:44.000000000","message":"Will change it to _get_updated_pools()","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"add0755e15bdb5b49a5e6e43068fa11ef2e193fd","unresolved":false,"context_lines":[{"line_number":460,"context_line":"        timestamp \u003d timeutils.utcnow()"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"        if not capa_new:"},{"line_number":463,"context_line":"            updated \u003d self._is_updated(capa_new, capabilities)"},{"line_number":464,"context_line":"        else:"},{"line_number":465,"context_line":"            if timestamp \u003e self.service_states[host][\"timestamp\"]:"},{"line_number":466,"context_line":"                updated \u003d self._is_updated(self.service_states[host],"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_0ebf31fc","line":463,"in_reply_to":"ba8a016a_30c0397c","updated":"2015-11-25 17:52:46.000000000","message":"That\u0027s a lot better","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":463,"context_line":"            updated \u003d self._is_updated(capa_new, capabilities)"},{"line_number":464,"context_line":"        else:"},{"line_number":465,"context_line":"            if timestamp \u003e self.service_states[host][\"timestamp\"]:"},{"line_number":466,"context_line":"                updated \u003d self._is_updated(self.service_states[host],"},{"line_number":467,"context_line":"                                           capabilities)"},{"line_number":468,"context_line":"                if not updated:"},{"line_number":469,"context_line":"                    updated \u003d self._is_updated("}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_f05f7573","line":466,"updated":"2015-11-16 13:14:13.000000000","message":"nit: Why use self.service_states[host] instead of capa_new?","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":463,"context_line":"            updated \u003d self._is_updated(capa_new, capabilities)"},{"line_number":464,"context_line":"        else:"},{"line_number":465,"context_line":"            if timestamp \u003e self.service_states[host][\"timestamp\"]:"},{"line_number":466,"context_line":"                updated \u003d self._is_updated(self.service_states[host],"},{"line_number":467,"context_line":"                                           capabilities)"},{"line_number":468,"context_line":"                if not updated:"},{"line_number":469,"context_line":"                    updated \u003d self._is_updated("}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_ca2fcb3c","line":466,"in_reply_to":"ba8a016a_f05f7573","updated":"2015-11-24 17:05:44.000000000","message":"@eguileor\nThanks for your method for just notifying the changed capabilities. I think it will work and will do that in the code.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":594,"context_line":"            usage.append(backend_usage)"},{"line_number":595,"context_line":"        return usage"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    def _get_pool_usage(self, pool, host, timestamp):"},{"line_number":598,"context_line":"        total \u003d pool[\"total_capacity_gb\"]"},{"line_number":599,"context_line":"        free \u003d pool[\"free_capacity_gb\"]"},{"line_number":600,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_8be7de11","line":597,"updated":"2015-11-16 13:14:13.000000000","message":"-1: Somebody mentioned that this should use the same code path we use somewhere else.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"556f513fb826e08ca03d8f77eb5ac58601c9b138","unresolved":false,"context_lines":[{"line_number":594,"context_line":"            usage.append(backend_usage)"},{"line_number":595,"context_line":"        return usage"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    def _get_pool_usage(self, pool, host, timestamp):"},{"line_number":598,"context_line":"        total \u003d pool[\"total_capacity_gb\"]"},{"line_number":599,"context_line":"        free \u003d pool[\"free_capacity_gb\"]"},{"line_number":600,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_afd7f021","line":597,"in_reply_to":"9a8ffd7b_0ea0919e","updated":"2015-11-25 22:56:44.000000000","message":"@eguileor\n\nMaybe I can add a common function to calculate the virtual free capacity, and call them in 2 places. And make it as a patch which depends on this.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"fa84af52b685a891473c103f278cb9a6c3c08630","unresolved":false,"context_lines":[{"line_number":594,"context_line":"            usage.append(backend_usage)"},{"line_number":595,"context_line":"        return usage"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    def _get_pool_usage(self, pool, host, timestamp):"},{"line_number":598,"context_line":"        total \u003d pool[\"total_capacity_gb\"]"},{"line_number":599,"context_line":"        free \u003d pool[\"free_capacity_gb\"]"},{"line_number":600,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_186178d3","line":597,"in_reply_to":"9a8ffd7b_68500c0b","updated":"2015-12-18 20:32:00.000000000","message":"@geguileor\n\nI have wrote another patch to wrap the calculation logic into a method. It\u0027s at https://review.openstack.org/#/c/257620/ .\n\nThis patch will call the method then.  \n\nThanks!","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"612dba21978d42d8f76005e7ba946dab8ac952b5","unresolved":false,"context_lines":[{"line_number":594,"context_line":"            usage.append(backend_usage)"},{"line_number":595,"context_line":"        return usage"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    def _get_pool_usage(self, pool, host, timestamp):"},{"line_number":598,"context_line":"        total \u003d pool[\"total_capacity_gb\"]"},{"line_number":599,"context_line":"        free \u003d pool[\"free_capacity_gb\"]"},{"line_number":600,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_68500c0b","line":597,"in_reply_to":"9a8ffd7b_afd7f021","updated":"2015-12-02 10:58:12.000000000","message":"That would be the way to go.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"add0755e15bdb5b49a5e6e43068fa11ef2e193fd","unresolved":false,"context_lines":[{"line_number":594,"context_line":"            usage.append(backend_usage)"},{"line_number":595,"context_line":"        return usage"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    def _get_pool_usage(self, pool, host, timestamp):"},{"line_number":598,"context_line":"        total \u003d pool[\"total_capacity_gb\"]"},{"line_number":599,"context_line":"        free \u003d pool[\"free_capacity_gb\"]"},{"line_number":600,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_0ea0919e","line":597,"in_reply_to":"9a8ffd7b_f0a3ec4d","updated":"2015-11-25 17:52:46.000000000","message":"It\u0027s the same logic, but not the same code path (as in both execute the same code from the same file).  We should have a common place for the code and use it in both places, that way if there are changes in that logic we can\u0027t get out of sync in any of the places where it is being used.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":594,"context_line":"            usage.append(backend_usage)"},{"line_number":595,"context_line":"        return usage"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    def _get_pool_usage(self, pool, host, timestamp):"},{"line_number":598,"context_line":"        total \u003d pool[\"total_capacity_gb\"]"},{"line_number":599,"context_line":"        free \u003d pool[\"free_capacity_gb\"]"},{"line_number":600,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_f0a3ec4d","line":597,"in_reply_to":"ba8a016a_8be7de11","updated":"2015-11-24 17:05:44.000000000","message":"@eguileor \nThe code path I have used is the same logic as in function _weigh_object() under cinder/scheduler/weights/capacity.py. line 117~125. Is there any other code path?","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":628,"context_line":"    def _is_updated(self, old_capa, new_capa):"},{"line_number":629,"context_line":"        # Judge if the capabilities should be reported."},{"line_number":630,"context_line":""},{"line_number":631,"context_line":"        required_keys \u003d {\u0027pool_name\u0027,"},{"line_number":632,"context_line":"                         \u0027total_capacity_gb\u0027,"},{"line_number":633,"context_line":"                         \u0027free_capacity_gb\u0027,"},{"line_number":634,"context_line":"                         \u0027allocated_capacity_gb\u0027,"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_2dadaa88","line":631,"updated":"2015-11-16 13:14:13.000000000","message":"nit: Maybe we could set this as a class attribute.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"556f513fb826e08ca03d8f77eb5ac58601c9b138","unresolved":false,"context_lines":[{"line_number":628,"context_line":"    def _is_updated(self, old_capa, new_capa):"},{"line_number":629,"context_line":"        # Judge if the capabilities should be reported."},{"line_number":630,"context_line":""},{"line_number":631,"context_line":"        required_keys \u003d {\u0027pool_name\u0027,"},{"line_number":632,"context_line":"                         \u0027total_capacity_gb\u0027,"},{"line_number":633,"context_line":"                         \u0027free_capacity_gb\u0027,"},{"line_number":634,"context_line":"                         \u0027allocated_capacity_gb\u0027,"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_eca9867c","line":631,"in_reply_to":"9a8ffd7b_4c477c4b","updated":"2015-11-25 22:56:44.000000000","message":"@eguileor\n\n_get_update_pools() is a method in HostManager Class.\nSo what you mean is like this?\n\nClass HostManager(object):\n    host_state_cls \u003d HostState\n    required_keys \u003d {\u0027pool_name\u0027,\n                     \u0027total_capacity_gb\u0027,\n                      ....\n                     }","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"add0755e15bdb5b49a5e6e43068fa11ef2e193fd","unresolved":false,"context_lines":[{"line_number":628,"context_line":"    def _is_updated(self, old_capa, new_capa):"},{"line_number":629,"context_line":"        # Judge if the capabilities should be reported."},{"line_number":630,"context_line":""},{"line_number":631,"context_line":"        required_keys \u003d {\u0027pool_name\u0027,"},{"line_number":632,"context_line":"                         \u0027total_capacity_gb\u0027,"},{"line_number":633,"context_line":"                         \u0027free_capacity_gb\u0027,"},{"line_number":634,"context_line":"                         \u0027allocated_capacity_gb\u0027,"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_4c477c4b","line":631,"in_reply_to":"9a8ffd7b_9b02c13d","updated":"2015-11-25 17:52:46.000000000","message":"Not a class, a class attribute \u003d an attribute at the class level and not in a method in the class.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"fa84af52b685a891473c103f278cb9a6c3c08630","unresolved":false,"context_lines":[{"line_number":628,"context_line":"    def _is_updated(self, old_capa, new_capa):"},{"line_number":629,"context_line":"        # Judge if the capabilities should be reported."},{"line_number":630,"context_line":""},{"line_number":631,"context_line":"        required_keys \u003d {\u0027pool_name\u0027,"},{"line_number":632,"context_line":"                         \u0027total_capacity_gb\u0027,"},{"line_number":633,"context_line":"                         \u0027free_capacity_gb\u0027,"},{"line_number":634,"context_line":"                         \u0027allocated_capacity_gb\u0027,"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_58b2a04d","line":631,"in_reply_to":"9a8ffd7b_a8b4b434","updated":"2015-12-18 20:32:00.000000000","message":"Done","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"612dba21978d42d8f76005e7ba946dab8ac952b5","unresolved":false,"context_lines":[{"line_number":628,"context_line":"    def _is_updated(self, old_capa, new_capa):"},{"line_number":629,"context_line":"        # Judge if the capabilities should be reported."},{"line_number":630,"context_line":""},{"line_number":631,"context_line":"        required_keys \u003d {\u0027pool_name\u0027,"},{"line_number":632,"context_line":"                         \u0027total_capacity_gb\u0027,"},{"line_number":633,"context_line":"                         \u0027free_capacity_gb\u0027,"},{"line_number":634,"context_line":"                         \u0027allocated_capacity_gb\u0027,"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_a8b4b434","line":631,"in_reply_to":"9a8ffd7b_eca9867c","updated":"2015-12-02 10:58:12.000000000","message":"Yes, that\u0027s what I was referring to, and you should use REQUIRED_KEYS to reflect it\u0027s a constant and maybe even use a frozenset instead of set to enforce it as a constant.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":628,"context_line":"    def _is_updated(self, old_capa, new_capa):"},{"line_number":629,"context_line":"        # Judge if the capabilities should be reported."},{"line_number":630,"context_line":""},{"line_number":631,"context_line":"        required_keys \u003d {\u0027pool_name\u0027,"},{"line_number":632,"context_line":"                         \u0027total_capacity_gb\u0027,"},{"line_number":633,"context_line":"                         \u0027free_capacity_gb\u0027,"},{"line_number":634,"context_line":"                         \u0027allocated_capacity_gb\u0027,"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_9b02c13d","line":631,"in_reply_to":"ba8a016a_2dadaa88","updated":"2015-11-24 17:05:44.000000000","message":"@eguileor\nI\u0027m not very sure about it. I thought a dict is lighter than a class. Or I misunderstood your point?","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":639,"context_line":"                         \u0027reserved_percentage\u0027}"},{"line_number":640,"context_line":""},{"line_number":641,"context_line":"        new_pools \u003d new_capa.get(\u0027pools\u0027, [])"},{"line_number":642,"context_line":"        if not new_pools or not new_capa:"},{"line_number":643,"context_line":"            return []"},{"line_number":644,"context_line":""},{"line_number":645,"context_line":"        if new_pools and isinstance(new_pools, list):"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_adb3da09","line":642,"updated":"2015-11-16 13:14:13.000000000","message":"nit: We shouldn\u0027t need to check for new_capa, if it\u0027s {} we\u0027ll also have new_pools set to []","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":639,"context_line":"                         \u0027reserved_percentage\u0027}"},{"line_number":640,"context_line":""},{"line_number":641,"context_line":"        new_pools \u003d new_capa.get(\u0027pools\u0027, [])"},{"line_number":642,"context_line":"        if not new_pools or not new_capa:"},{"line_number":643,"context_line":"            return []"},{"line_number":644,"context_line":""},{"line_number":645,"context_line":"        if new_pools and isinstance(new_pools, list):"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_ca158b9b","line":642,"in_reply_to":"ba8a016a_adb3da09","updated":"2015-11-24 17:05:44.000000000","message":"Will do that. Thanks!","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":642,"context_line":"        if not new_pools or not new_capa:"},{"line_number":643,"context_line":"            return []"},{"line_number":644,"context_line":""},{"line_number":645,"context_line":"        if new_pools and isinstance(new_pools, list):"},{"line_number":646,"context_line":"            # If the volume_stats is not well preprared, don\u0027t notify."},{"line_number":647,"context_line":"            if not (all(required_keys.issubset(pool) for pool in new_pools)):"},{"line_number":648,"context_line":"                return []"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_adaafa83","line":645,"updated":"2015-11-16 13:14:13.000000000","message":"nit: No need to check new_pools, if it was [] we would have returned on 643\n\n-1: We check for new_pools being a list but then we use it as a list (or at leas as an iterable) in L659. Shouldn\u0027t we log it and return if it\u0027s not a list?","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":642,"context_line":"        if not new_pools or not new_capa:"},{"line_number":643,"context_line":"            return []"},{"line_number":644,"context_line":""},{"line_number":645,"context_line":"        if new_pools and isinstance(new_pools, list):"},{"line_number":646,"context_line":"            # If the volume_stats is not well preprared, don\u0027t notify."},{"line_number":647,"context_line":"            if not (all(required_keys.issubset(pool) for pool in new_pools)):"},{"line_number":648,"context_line":"                return []"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_103bb5d2","line":645,"in_reply_to":"ba8a016a_adaafa83","updated":"2015-11-24 17:05:44.000000000","message":"Will log it and return a []","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":643,"context_line":"            return []"},{"line_number":644,"context_line":""},{"line_number":645,"context_line":"        if new_pools and isinstance(new_pools, list):"},{"line_number":646,"context_line":"            # If the volume_stats is not well preprared, don\u0027t notify."},{"line_number":647,"context_line":"            if not (all(required_keys.issubset(pool) for pool in new_pools)):"},{"line_number":648,"context_line":"                return []"},{"line_number":649,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_0d8d4631","line":646,"updated":"2015-11-16 13:14:13.000000000","message":"nit: s/preprared/prepared","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":643,"context_line":"            return []"},{"line_number":644,"context_line":""},{"line_number":645,"context_line":"        if new_pools and isinstance(new_pools, list):"},{"line_number":646,"context_line":"            # If the volume_stats is not well preprared, don\u0027t notify."},{"line_number":647,"context_line":"            if not (all(required_keys.issubset(pool) for pool in new_pools)):"},{"line_number":648,"context_line":"                return []"},{"line_number":649,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_ea064f1f","line":646,"in_reply_to":"ba8a016a_0d8d4631","updated":"2015-11-24 17:05:44.000000000","message":"Will do it.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":648,"context_line":"                return []"},{"line_number":649,"context_line":""},{"line_number":650,"context_line":"        old_pools \u003d old_capa.get(\u0027pools\u0027, [])"},{"line_number":651,"context_line":"        if not old_pools or not old_capa:"},{"line_number":652,"context_line":"            return new_pools"},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"        if old_pools and isinstance(old_pools, list):"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_4d4b4eb1","line":651,"updated":"2015-11-16 13:14:13.000000000","message":"nit: Like on L642 no need to check for old_capa","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":648,"context_line":"                return []"},{"line_number":649,"context_line":""},{"line_number":650,"context_line":"        old_pools \u003d old_capa.get(\u0027pools\u0027, [])"},{"line_number":651,"context_line":"        if not old_pools or not old_capa:"},{"line_number":652,"context_line":"            return new_pools"},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"        if old_pools and isinstance(old_pools, list):"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_8df6bdf7","line":651,"in_reply_to":"ba8a016a_4d4b4eb1","updated":"2015-11-24 17:05:44.000000000","message":"Will do it.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":651,"context_line":"        if not old_pools or not old_capa:"},{"line_number":652,"context_line":"            return new_pools"},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"        if old_pools and isinstance(old_pools, list):"},{"line_number":655,"context_line":"            if not (all(required_keys.issubset(pool) for pool in old_pools)):"},{"line_number":656,"context_line":"                return new_pools"},{"line_number":657,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_cdec1e92","line":654,"updated":"2015-11-16 13:14:13.000000000","message":"nit: No need to check old_pools, like on L645\n\n-1: I don\u0027t think we need to check old_pools, but if we do and it\u0027s not a list we have a big bug in our hands, this should be logged and we should return.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":651,"context_line":"        if not old_pools or not old_capa:"},{"line_number":652,"context_line":"            return new_pools"},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"        if old_pools and isinstance(old_pools, list):"},{"line_number":655,"context_line":"            if not (all(required_keys.issubset(pool) for pool in old_pools)):"},{"line_number":656,"context_line":"                return new_pools"},{"line_number":657,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_d01d2d67","line":654,"in_reply_to":"ba8a016a_cdec1e92","updated":"2015-11-24 17:05:44.000000000","message":"I will remove the isinstance() check for old_pools.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":656,"context_line":"                return new_pools"},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"        updated_pools \u003d []"},{"line_number":659,"context_line":"        for new_pool in new_pools:"},{"line_number":660,"context_line":"            found \u003d False"},{"line_number":661,"context_line":"            for old_pool in old_pools:"},{"line_number":662,"context_line":"                if new_pool[\u0027pool_name\u0027] \u003d\u003d old_pool[\u0027pool_name\u0027]:"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_1079d993","line":659,"updated":"2015-11-16 13:14:13.000000000","message":"nit: Shouldn\u0027t we consider using a dictionary to prevent triple nested loops?","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"556f513fb826e08ca03d8f77eb5ac58601c9b138","unresolved":false,"context_lines":[{"line_number":656,"context_line":"                return new_pools"},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"        updated_pools \u003d []"},{"line_number":659,"context_line":"        for new_pool in new_pools:"},{"line_number":660,"context_line":"            found \u003d False"},{"line_number":661,"context_line":"            for old_pool in old_pools:"},{"line_number":662,"context_line":"                if new_pool[\u0027pool_name\u0027] \u003d\u003d old_pool[\u0027pool_name\u0027]:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_af9ff0b2","line":659,"in_reply_to":"9a8ffd7b_0c30949d","updated":"2015-11-25 22:56:44.000000000","message":"@eguileor\n\nnew_pools/old_pools is a list which contains many dictionaries, it is an original structure in capabilities. Do you mean to construct a new dictionary to substitute the list or what? Sorry, I could not catch what you have thought. :-(","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"fa84af52b685a891473c103f278cb9a6c3c08630","unresolved":false,"context_lines":[{"line_number":656,"context_line":"                return new_pools"},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"        updated_pools \u003d []"},{"line_number":659,"context_line":"        for new_pool in new_pools:"},{"line_number":660,"context_line":"            found \u003d False"},{"line_number":661,"context_line":"            for old_pool in old_pools:"},{"line_number":662,"context_line":"                if new_pool[\u0027pool_name\u0027] \u003d\u003d old_pool[\u0027pool_name\u0027]:"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_388c747e","line":659,"in_reply_to":"9a8ffd7b_2801a46a","updated":"2015-12-18 20:32:00.000000000","message":"Done","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"612dba21978d42d8f76005e7ba946dab8ac952b5","unresolved":false,"context_lines":[{"line_number":656,"context_line":"                return new_pools"},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"        updated_pools \u003d []"},{"line_number":659,"context_line":"        for new_pool in new_pools:"},{"line_number":660,"context_line":"            found \u003d False"},{"line_number":661,"context_line":"            for old_pool in old_pools:"},{"line_number":662,"context_line":"                if new_pool[\u0027pool_name\u0027] \u003d\u003d old_pool[\u0027pool_name\u0027]:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_2801a46a","line":659,"in_reply_to":"9a8ffd7b_af9ff0b2","updated":"2015-12-02 10:58:12.000000000","message":"I think it should structures should be changed accordingly to the use, and a triple loop is a nightmare ;-)\n\nBut this is something that can be optimized in a future patch, that\u0027s why comment was marked as a nit.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":656,"context_line":"                return new_pools"},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"        updated_pools \u003d []"},{"line_number":659,"context_line":"        for new_pool in new_pools:"},{"line_number":660,"context_line":"            found \u003d False"},{"line_number":661,"context_line":"            for old_pool in old_pools:"},{"line_number":662,"context_line":"                if new_pool[\u0027pool_name\u0027] \u003d\u003d old_pool[\u0027pool_name\u0027]:"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_9a31060e","line":659,"in_reply_to":"ba8a016a_1079d993","updated":"2015-11-24 17:05:44.000000000","message":"Will do it with:\nfor new_pool in old_pools:\n    for old_pool in old_pools:\n        if new_pool[\u0027pool_name\u0027] \u003d\u003d old_pool[\u0027pool_name\u0027]:\n            if not cmp(new_pool, old_pool):\n                updated_pools.append(new_pool)\n                break\n            break\n    else:\n        updated_pools.append(new_pool)","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"add0755e15bdb5b49a5e6e43068fa11ef2e193fd","unresolved":false,"context_lines":[{"line_number":656,"context_line":"                return new_pools"},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"        updated_pools \u003d []"},{"line_number":659,"context_line":"        for new_pool in new_pools:"},{"line_number":660,"context_line":"            found \u003d False"},{"line_number":661,"context_line":"            for old_pool in old_pools:"},{"line_number":662,"context_line":"                if new_pool[\u0027pool_name\u0027] \u003d\u003d old_pool[\u0027pool_name\u0027]:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_0c30949d","line":659,"in_reply_to":"ba8a016a_9a31060e","updated":"2015-11-25 17:52:46.000000000","message":"I was actually referring to using a dictionary instead of a lists in new_pools and old_pools using pool_name as the key. That way we can check this more easily.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":666,"context_line":"                            updated_pools.append(new_pool)"},{"line_number":667,"context_line":"                            break"},{"line_number":668,"context_line":"                    break"},{"line_number":669,"context_line":"            if not found:"},{"line_number":670,"context_line":"                updated_pools.append(new_pool)"},{"line_number":671,"context_line":"        return updated_pools"},{"line_number":672,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_10a0f9f3","line":669,"updated":"2015-11-16 13:14:13.000000000","message":"nit: You can use an `else:` clause in the for loop and avoid using found variable.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"fa84af52b685a891473c103f278cb9a6c3c08630","unresolved":false,"context_lines":[{"line_number":666,"context_line":"                            updated_pools.append(new_pool)"},{"line_number":667,"context_line":"                            break"},{"line_number":668,"context_line":"                    break"},{"line_number":669,"context_line":"            if not found:"},{"line_number":670,"context_line":"                updated_pools.append(new_pool)"},{"line_number":671,"context_line":"        return updated_pools"},{"line_number":672,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_b85b84f5","line":669,"in_reply_to":"9a8ffd7b_48a188a8","updated":"2015-12-18 20:32:00.000000000","message":"Done","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":666,"context_line":"                            updated_pools.append(new_pool)"},{"line_number":667,"context_line":"                            break"},{"line_number":668,"context_line":"                    break"},{"line_number":669,"context_line":"            if not found:"},{"line_number":670,"context_line":"                updated_pools.append(new_pool)"},{"line_number":671,"context_line":"        return updated_pools"},{"line_number":672,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_7f12140b","line":669,"in_reply_to":"ba8a016a_10a0f9f3","updated":"2015-11-24 17:05:44.000000000","message":"As above.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"612dba21978d42d8f76005e7ba946dab8ac952b5","unresolved":false,"context_lines":[{"line_number":666,"context_line":"                            updated_pools.append(new_pool)"},{"line_number":667,"context_line":"                            break"},{"line_number":668,"context_line":"                    break"},{"line_number":669,"context_line":"            if not found:"},{"line_number":670,"context_line":"                updated_pools.append(new_pool)"},{"line_number":671,"context_line":"        return updated_pools"},{"line_number":672,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_48a188a8","line":669,"in_reply_to":"ba8a016a_7f12140b","updated":"2015-12-02 10:58:12.000000000","message":"I don\u0027t understand what you mean with \"As above\"... You can remove L660 and L663 if you replace L669 with:\n\n  else:","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"98b6740986c2f1afa60cd9a9ee548c66f2a320b2","unresolved":false,"context_lines":[{"line_number":668,"context_line":"                    break"},{"line_number":669,"context_line":"            if not found:"},{"line_number":670,"context_line":"                updated_pools.append(new_pool)"},{"line_number":671,"context_line":"        return updated_pools"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"    def _notify_capacity_usage(self, context, usage):"},{"line_number":674,"context_line":"        if usage:"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_10947935","line":671,"updated":"2015-11-16 13:14:13.000000000","message":"?: Is there a mechanism to remove pools that are no longer being reported?","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"632d7c6a99442c214da52985b38210bc49e49b3a","unresolved":false,"context_lines":[{"line_number":668,"context_line":"                    break"},{"line_number":669,"context_line":"            if not found:"},{"line_number":670,"context_line":"                updated_pools.append(new_pool)"},{"line_number":671,"context_line":"        return updated_pools"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"    def _notify_capacity_usage(self, context, usage):"},{"line_number":674,"context_line":"        if usage:"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba8a016a_bf071c80","line":671,"in_reply_to":"ba8a016a_10947935","updated":"2015-11-24 17:05:44.000000000","message":"Hi, Gorka, the above loop is trying to iterate in the new pools which means only the current existing pools will be reported once it\u0027s different from the old ones, so in my understanding, the pools being no longer reported is now removed already from the updated_pools. I\u0027m not sure if I have understood you right. Thanks.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"add0755e15bdb5b49a5e6e43068fa11ef2e193fd","unresolved":false,"context_lines":[{"line_number":668,"context_line":"                    break"},{"line_number":669,"context_line":"            if not found:"},{"line_number":670,"context_line":"                updated_pools.append(new_pool)"},{"line_number":671,"context_line":"        return updated_pools"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"    def _notify_capacity_usage(self, context, usage):"},{"line_number":674,"context_line":"        if usage:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a8ffd7b_2cc9d878","line":671,"in_reply_to":"ba8a016a_bf071c80","updated":"2015-11-25 17:52:46.000000000","message":"I believe you are correct.","commit_id":"2a718bb104a321b9d97334456bce0f38db750631"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8efd902f6dd74402a357bcdfe74a88a489dd30d8","unresolved":false,"context_lines":[{"line_number":450,"context_line":"        capab_last_update \u003d self.service_states_last_update.get("},{"line_number":451,"context_line":"            host, {\"timestamp\": 0})"},{"line_number":452,"context_line":""},{"line_number":453,"context_line":"        # If the capabiliites is not changed and the timestamp is older,"},{"line_number":454,"context_line":"        # record the capabilities."},{"line_number":455,"context_line":"        # if (not self._get_updated_pools(capab_old, capab_copy)) and ("},{"line_number":456,"context_line":"        #        capab_last_update[\"timestamp\"] \u003c capab_old[\"timestamp\"]):"},{"line_number":457,"context_line":"        # self.service_states_last_update[host] \u003d capab_old"},{"line_number":458,"context_line":"        if (not self._get_updated_pools(capab_old, capab_copy)):"},{"line_number":459,"context_line":"            LOG.debug(\"test %s\", capab_last_update)"},{"line_number":460,"context_line":"        self.service_states[host] \u003d capab_copy"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"        LOG.debug(\"Received %(service_name)s service update from \""}],"source_content_type":"text/x-python","patch_set":43,"id":"9a68dd71_b5a9757d","line":459,"range":{"start_line":453,"start_character":0,"end_line":459,"end_character":51},"updated":"2016-01-22 14:34:37.000000000","message":"Leftover from debugging?","commit_id":"912377821cf8190e6204d70a4e3d54c61890dfca"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"8ce711287b58038ddf2220a8e4fff8d96032a4ef","unresolved":false,"context_lines":[{"line_number":450,"context_line":"        capab_last_update \u003d self.service_states_last_update.get("},{"line_number":451,"context_line":"            host, {\"timestamp\": 0})"},{"line_number":452,"context_line":""},{"line_number":453,"context_line":"        # If the capabiliites is not changed and the timestamp is older,"},{"line_number":454,"context_line":"        # record the capabilities."},{"line_number":455,"context_line":"        # if (not self._get_updated_pools(capab_old, capab_copy)) and ("},{"line_number":456,"context_line":"        #        capab_last_update[\"timestamp\"] \u003c capab_old[\"timestamp\"]):"},{"line_number":457,"context_line":"        # self.service_states_last_update[host] \u003d capab_old"},{"line_number":458,"context_line":"        if (not self._get_updated_pools(capab_old, capab_copy)):"},{"line_number":459,"context_line":"            LOG.debug(\"test %s\", capab_last_update)"},{"line_number":460,"context_line":"        self.service_states[host] \u003d capab_copy"},{"line_number":461,"context_line":""},{"line_number":462,"context_line":"        LOG.debug(\"Received %(service_name)s service update from \""}],"source_content_type":"text/x-python","patch_set":43,"id":"9a68dd71_b0b39599","line":459,"range":{"start_line":453,"start_character":0,"end_line":459,"end_character":51},"in_reply_to":"9a68dd71_b5a9757d","updated":"2016-01-23 08:34:28.000000000","message":"I removed the workflow and just want to investigate the jenkin failure. My environment did not meet the failure, so just use jenkin to help to debugging.","commit_id":"912377821cf8190e6204d70a4e3d54c61890dfca"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8efd902f6dd74402a357bcdfe74a88a489dd30d8","unresolved":false,"context_lines":[{"line_number":469,"context_line":"    def notify_service_capabilities(self, service_name, host, capabilities):"},{"line_number":470,"context_line":"        \"\"\"Notify the ceilometer with updated volume stats\"\"\""},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"        \"\"\"if service_name !\u003d \u0027volume\u0027:"},{"line_number":473,"context_line":"            LOG.debug(\u0027Ignoring %(service_name)s service update \u0027"},{"line_number":474,"context_line":"                      \u0027from %(host)s\u0027,"},{"line_number":475,"context_line":"                      {\u0027service_name\u0027: service_name, \u0027host\u0027: host})"},{"line_number":476,"context_line":"            return"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"        updated \u003d []"},{"line_number":479,"context_line":"        capa_new \u003d self.service_states.get(host, {})"},{"line_number":480,"context_line":"        timestamp \u003d timeutils.utcnow()"},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"        # Compare the capabilities and timestamps to decide notifying"},{"line_number":483,"context_line":"        if not capa_new:"},{"line_number":484,"context_line":"            updated \u003d self._get_updated_pools(capa_new, capabilities)"},{"line_number":485,"context_line":"        else:"},{"line_number":486,"context_line":"            if timestamp \u003e self.service_states[host][\"timestamp\"]:"},{"line_number":487,"context_line":"                updated \u003d self._get_updated_pools(self.service_states[host],"},{"line_number":488,"context_line":"                                                  capabilities)"},{"line_number":489,"context_line":"                if not updated:"},{"line_number":490,"context_line":"                    updated \u003d self._get_updated_pools("},{"line_number":491,"context_line":"                        self.service_states_last_update.get(host, {}),"},{"line_number":492,"context_line":"                        self.service_states.get(host, {}))"},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"        if updated:"},{"line_number":495,"context_line":"            capab_copy \u003d dict(capabilities)"},{"line_number":496,"context_line":"            capab_copy[\"timestamp\"] \u003d timestamp"},{"line_number":497,"context_line":"            # If capabilities changes, notify and record the capabilities."},{"line_number":498,"context_line":"            self.service_states_last_update[host] \u003d capab_copy"},{"line_number":499,"context_line":"            self.get_usage_and_notify(capabilities, updated, host, timestamp)"},{"line_number":500,"context_line":"        \"\"\""},{"line_number":501,"context_line":"    def has_all_capabilities(self):"},{"line_number":502,"context_line":"        return len(self._no_capabilities_hosts) \u003d\u003d 0"},{"line_number":503,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"9a68dd71_15b161e1","line":500,"range":{"start_line":472,"start_character":0,"end_line":500,"end_character":11},"updated":"2016-01-22 14:34:37.000000000","message":"Leftover from debugging?","commit_id":"912377821cf8190e6204d70a4e3d54c61890dfca"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"8ce711287b58038ddf2220a8e4fff8d96032a4ef","unresolved":false,"context_lines":[{"line_number":469,"context_line":"    def notify_service_capabilities(self, service_name, host, capabilities):"},{"line_number":470,"context_line":"        \"\"\"Notify the ceilometer with updated volume stats\"\"\""},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"        \"\"\"if service_name !\u003d \u0027volume\u0027:"},{"line_number":473,"context_line":"            LOG.debug(\u0027Ignoring %(service_name)s service update \u0027"},{"line_number":474,"context_line":"                      \u0027from %(host)s\u0027,"},{"line_number":475,"context_line":"                      {\u0027service_name\u0027: service_name, \u0027host\u0027: host})"},{"line_number":476,"context_line":"            return"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"        updated \u003d []"},{"line_number":479,"context_line":"        capa_new \u003d self.service_states.get(host, {})"},{"line_number":480,"context_line":"        timestamp \u003d timeutils.utcnow()"},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"        # Compare the capabilities and timestamps to decide notifying"},{"line_number":483,"context_line":"        if not capa_new:"},{"line_number":484,"context_line":"            updated \u003d self._get_updated_pools(capa_new, capabilities)"},{"line_number":485,"context_line":"        else:"},{"line_number":486,"context_line":"            if timestamp \u003e self.service_states[host][\"timestamp\"]:"},{"line_number":487,"context_line":"                updated \u003d self._get_updated_pools(self.service_states[host],"},{"line_number":488,"context_line":"                                                  capabilities)"},{"line_number":489,"context_line":"                if not updated:"},{"line_number":490,"context_line":"                    updated \u003d self._get_updated_pools("},{"line_number":491,"context_line":"                        self.service_states_last_update.get(host, {}),"},{"line_number":492,"context_line":"                        self.service_states.get(host, {}))"},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"        if updated:"},{"line_number":495,"context_line":"            capab_copy \u003d dict(capabilities)"},{"line_number":496,"context_line":"            capab_copy[\"timestamp\"] \u003d timestamp"},{"line_number":497,"context_line":"            # If capabilities changes, notify and record the capabilities."},{"line_number":498,"context_line":"            self.service_states_last_update[host] \u003d capab_copy"},{"line_number":499,"context_line":"            self.get_usage_and_notify(capabilities, updated, host, timestamp)"},{"line_number":500,"context_line":"        \"\"\""},{"line_number":501,"context_line":"    def has_all_capabilities(self):"},{"line_number":502,"context_line":"        return len(self._no_capabilities_hosts) \u003d\u003d 0"},{"line_number":503,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"9a68dd71_d0b88977","line":500,"range":{"start_line":472,"start_character":0,"end_line":500,"end_character":11},"in_reply_to":"9a68dd71_15b161e1","updated":"2016-01-23 08:34:28.000000000","message":"The same, just for debugging to dig out the jenkin\u0027s failure.","commit_id":"912377821cf8190e6204d70a4e3d54c61890dfca"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"bb33c665e356f8208878bcbfbc595156a5bf8c4e","unresolved":false,"context_lines":[{"line_number":346,"context_line":""},{"line_number":347,"context_line":"    host_state_cls \u003d HostState"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"    REQUIRED_KEYS \u003d frozenset(["},{"line_number":350,"context_line":"        \u0027pool_name\u0027,"},{"line_number":351,"context_line":"        \u0027total_capacity_gb\u0027,"},{"line_number":352,"context_line":"        \u0027free_capacity_gb\u0027,"},{"line_number":353,"context_line":"        \u0027allocated_capacity_gb\u0027,"},{"line_number":354,"context_line":"        \u0027provisioned_capacity_gb\u0027,"},{"line_number":355,"context_line":"        \u0027thin_provisioning_support\u0027,"},{"line_number":356,"context_line":"        \u0027thick_provisioning_support\u0027,"},{"line_number":357,"context_line":"        \u0027max_over_subscription_ratio\u0027,"},{"line_number":358,"context_line":"        \u0027reserved_percentage\u0027])"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"    def __init__(self):"},{"line_number":361,"context_line":"        self.service_states \u003d {}  # { \u003chost\u003e: {\u003cservice\u003e: {cap k : v}}}"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_85475c4a","line":358,"range":{"start_line":349,"start_character":0,"end_line":358,"end_character":31},"updated":"2016-11-24 12:59:09.000000000","message":"Would be better to model this as a o.vo, but as Capabilities object is in review, we can start with this and fix it later.","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6a46a8351e354943cd036e7d230e8d7ff48cb2d4","unresolved":false,"context_lines":[{"line_number":346,"context_line":""},{"line_number":347,"context_line":"    host_state_cls \u003d HostState"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"    REQUIRED_KEYS \u003d frozenset(["},{"line_number":350,"context_line":"        \u0027pool_name\u0027,"},{"line_number":351,"context_line":"        \u0027total_capacity_gb\u0027,"},{"line_number":352,"context_line":"        \u0027free_capacity_gb\u0027,"},{"line_number":353,"context_line":"        \u0027allocated_capacity_gb\u0027,"},{"line_number":354,"context_line":"        \u0027provisioned_capacity_gb\u0027,"},{"line_number":355,"context_line":"        \u0027thin_provisioning_support\u0027,"},{"line_number":356,"context_line":"        \u0027thick_provisioning_support\u0027,"},{"line_number":357,"context_line":"        \u0027max_over_subscription_ratio\u0027,"},{"line_number":358,"context_line":"        \u0027reserved_percentage\u0027])"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"    def __init__(self):"},{"line_number":361,"context_line":"        self.service_states \u003d {}  # { \u003chost\u003e: {\u003cservice\u003e: {cap k : v}}}"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_a8ef7a1c","line":358,"range":{"start_line":349,"start_character":0,"end_line":358,"end_character":31},"in_reply_to":"5a74a57a_85475c4a","updated":"2016-11-28 07:37:47.000000000","message":"OK.","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"bb33c665e356f8208878bcbfbc595156a5bf8c4e","unresolved":false,"context_lines":[{"line_number":460,"context_line":"        capab_last_update \u003d self.service_states_last_update.get("},{"line_number":461,"context_line":"            host, {\"timestamp\": 0})"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"        # If the capabiliites is not changed and the timestamp is older,"},{"line_number":464,"context_line":"        # record the capabilities."},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"        # There are cases: capab_old has the capabilities set,"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_a59b78c8","line":463,"range":{"start_line":463,"start_character":17,"end_line":463,"end_character":32},"updated":"2016-11-24 12:59:09.000000000","message":"capabilities are","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6a46a8351e354943cd036e7d230e8d7ff48cb2d4","unresolved":false,"context_lines":[{"line_number":460,"context_line":"        capab_last_update \u003d self.service_states_last_update.get("},{"line_number":461,"context_line":"            host, {\"timestamp\": 0})"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"        # If the capabiliites is not changed and the timestamp is older,"},{"line_number":464,"context_line":"        # record the capabilities."},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"        # There are cases: capab_old has the capabilities set,"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_88271eb5","line":463,"range":{"start_line":463,"start_character":17,"end_line":463,"end_character":32},"in_reply_to":"5a74a57a_a59b78c8","updated":"2016-11-28 07:37:47.000000000","message":"Done","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"bb33c665e356f8208878bcbfbc595156a5bf8c4e","unresolved":false,"context_lines":[{"line_number":465,"context_line":""},{"line_number":466,"context_line":"        # There are cases: capab_old has the capabilities set,"},{"line_number":467,"context_line":"        # but the timestamp may be None in it. In this case,"},{"line_number":468,"context_line":"        # after line 451, capab_old[\"timesetamp\"] can also be None."},{"line_number":469,"context_line":"        # So does capab_last_update."},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"        if (not self._get_updated_pools(capab_old, capab_copy)) and ("}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_858cbc80","line":468,"range":{"start_line":468,"start_character":21,"end_line":468,"end_character":24},"updated":"2016-11-24 12:59:09.000000000","message":"Oh, let\u0027s not mention line numbers in comments. What if someone changes this file? I think this line number is not accurate already.","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6a46a8351e354943cd036e7d230e8d7ff48cb2d4","unresolved":false,"context_lines":[{"line_number":465,"context_line":""},{"line_number":466,"context_line":"        # There are cases: capab_old has the capabilities set,"},{"line_number":467,"context_line":"        # but the timestamp may be None in it. In this case,"},{"line_number":468,"context_line":"        # after line 451, capab_old[\"timesetamp\"] can also be None."},{"line_number":469,"context_line":"        # So does capab_last_update."},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"        if (not self._get_updated_pools(capab_old, capab_copy)) and ("}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_68b48234","line":468,"range":{"start_line":468,"start_character":21,"end_line":468,"end_character":24},"in_reply_to":"5a74a57a_858cbc80","updated":"2016-11-28 07:37:47.000000000","message":"Done","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"bb33c665e356f8208878bcbfbc595156a5bf8c4e","unresolved":false,"context_lines":[{"line_number":486,"context_line":"    def notify_service_capabilities(self, service_name, host, capabilities):"},{"line_number":487,"context_line":"        \"\"\"Notify the ceilometer with updated volume stats\"\"\""},{"line_number":488,"context_line":"        if service_name !\u003d \u0027volume\u0027:"},{"line_number":489,"context_line":"            LOG.debug(\u0027Ignoring %(service_name)s service update \u0027"},{"line_number":490,"context_line":"                      \u0027from %(host)s\u0027,"},{"line_number":491,"context_line":"                      {\u0027service_name\u0027: service_name, \u0027host\u0027: host})"},{"line_number":492,"context_line":"            return"},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"        updated \u003d []"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_5a1e0364","line":491,"range":{"start_line":489,"start_character":0,"end_line":491,"end_character":67},"updated":"2016-11-24 12:59:09.000000000","message":"I don\u0027t think we need to log this, we can ignore it silently. Once [1] will get merged, we\u0027ll be free from backup service sending useless notifications.\n\n[1] https://review.openstack.org/#/c/396264/","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6a46a8351e354943cd036e7d230e8d7ff48cb2d4","unresolved":false,"context_lines":[{"line_number":486,"context_line":"    def notify_service_capabilities(self, service_name, host, capabilities):"},{"line_number":487,"context_line":"        \"\"\"Notify the ceilometer with updated volume stats\"\"\""},{"line_number":488,"context_line":"        if service_name !\u003d \u0027volume\u0027:"},{"line_number":489,"context_line":"            LOG.debug(\u0027Ignoring %(service_name)s service update \u0027"},{"line_number":490,"context_line":"                      \u0027from %(host)s\u0027,"},{"line_number":491,"context_line":"                      {\u0027service_name\u0027: service_name, \u0027host\u0027: host})"},{"line_number":492,"context_line":"            return"},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"        updated \u003d []"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_28952a86","line":491,"range":{"start_line":489,"start_character":0,"end_line":491,"end_character":67},"in_reply_to":"5a74a57a_5a1e0364","updated":"2016-11-28 07:37:47.000000000","message":"Done","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"bb33c665e356f8208878bcbfbc595156a5bf8c4e","unresolved":false,"context_lines":[{"line_number":680,"context_line":"                    self.REQUIRED_KEYS.issubset(pool) for pool in new_pools):"},{"line_number":681,"context_line":"                return []"},{"line_number":682,"context_line":"        else:"},{"line_number":683,"context_line":"            LOG.debug(\"The reported capabiilities are not well structured...\")"},{"line_number":684,"context_line":"            return []"},{"line_number":685,"context_line":""},{"line_number":686,"context_line":"        old_pools \u003d old_capa.get(\u0027pools\u0027, [])"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_85511cdb","line":683,"range":{"start_line":683,"start_character":36,"end_line":683,"end_character":49},"updated":"2016-11-24 12:59:09.000000000","message":"capabilities","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6a46a8351e354943cd036e7d230e8d7ff48cb2d4","unresolved":false,"context_lines":[{"line_number":680,"context_line":"                    self.REQUIRED_KEYS.issubset(pool) for pool in new_pools):"},{"line_number":681,"context_line":"                return []"},{"line_number":682,"context_line":"        else:"},{"line_number":683,"context_line":"            LOG.debug(\"The reported capabiilities are not well structured...\")"},{"line_number":684,"context_line":"            return []"},{"line_number":685,"context_line":""},{"line_number":686,"context_line":"        old_pools \u003d old_capa.get(\u0027pools\u0027, [])"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_688ba268","line":683,"range":{"start_line":683,"start_character":36,"end_line":683,"end_character":49},"in_reply_to":"5a74a57a_85511cdb","updated":"2016-11-28 07:37:47.000000000","message":"Done","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"bb33c665e356f8208878bcbfbc595156a5bf8c4e","unresolved":false,"context_lines":[{"line_number":604,"context_line":""},{"line_number":605,"context_line":"        self._notify_capacity_usage(context, usage)"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"    def _get_usage(self, capa_new, updated_pools, host, timestamp):"},{"line_number":608,"context_line":"        pools \u003d capa_new.get(\u0027pools\u0027)"},{"line_number":609,"context_line":"        usage \u003d []"},{"line_number":610,"context_line":"        if pools and isinstance(pools, list):"},{"line_number":611,"context_line":"            backend_usage \u003d dict(type\u003d\u0027backend\u0027,"},{"line_number":612,"context_line":"                                 name_to_id\u003dhost,"},{"line_number":613,"context_line":"                                 total\u003d0,"},{"line_number":614,"context_line":"                                 free\u003d0,"},{"line_number":615,"context_line":"                                 allocated\u003d0,"},{"line_number":616,"context_line":"                                 provisioned\u003d0,"},{"line_number":617,"context_line":"                                 virtual_free\u003d0,"},{"line_number":618,"context_line":"                                 reported_at\u003dtimestamp)"},{"line_number":619,"context_line":""},{"line_number":620,"context_line":"            # Process the usage."},{"line_number":621,"context_line":"            for pool in pools:"},{"line_number":622,"context_line":"                pool_usage \u003d self._get_pool_usage(pool, host, timestamp)"},{"line_number":623,"context_line":"                if pool_usage:"},{"line_number":624,"context_line":"                    backend_usage[\"total\"] +\u003d pool_usage[\"total\"]"},{"line_number":625,"context_line":"                    backend_usage[\"free\"] +\u003d pool_usage[\"free\"]"},{"line_number":626,"context_line":"                    backend_usage[\"allocated\"] +\u003d pool_usage[\"allocated\"]"},{"line_number":627,"context_line":"                    backend_usage[\"provisioned\"] +\u003d pool_usage[\"provisioned\"]"},{"line_number":628,"context_line":"                    backend_usage[\"virtual_free\"] +\u003d pool_usage[\"virtual_free\"]"},{"line_number":629,"context_line":"                # Only the updated pool is reported."},{"line_number":630,"context_line":"                if pool in updated_pools:"},{"line_number":631,"context_line":"                    usage.append(pool_usage)"},{"line_number":632,"context_line":"            usage.append(backend_usage)"},{"line_number":633,"context_line":"        return usage"},{"line_number":634,"context_line":""},{"line_number":635,"context_line":"    def _get_pool_usage(self, pool, host, timestamp):"},{"line_number":636,"context_line":"        total \u003d pool[\"total_capacity_gb\"]"},{"line_number":637,"context_line":"        free \u003d pool[\"free_capacity_gb\"]"},{"line_number":638,"context_line":""},{"line_number":639,"context_line":"        unknowns \u003d [\"unknown\", \"infinite\", None]"},{"line_number":640,"context_line":"        if (total in unknowns) or (free in unknowns):"},{"line_number":641,"context_line":"            return {}"},{"line_number":642,"context_line":""},{"line_number":643,"context_line":"        allocated \u003d pool[\"allocated_capacity_gb\"]"},{"line_number":644,"context_line":"        provisioned \u003d pool[\"provisioned_capacity_gb\"]"},{"line_number":645,"context_line":"        reserved \u003d pool[\"reserved_percentage\"]"},{"line_number":646,"context_line":"        ratio \u003d pool[\"max_over_subscription_ratio\"]"},{"line_number":647,"context_line":"        support \u003d pool[\"thin_provisioning_support\"]"},{"line_number":648,"context_line":""},{"line_number":649,"context_line":"        virtual_free \u003d utils.calculate_virtual_free_capacity("},{"line_number":650,"context_line":"            total,"},{"line_number":651,"context_line":"            free,"},{"line_number":652,"context_line":"            provisioned,"},{"line_number":653,"context_line":"            support,"},{"line_number":654,"context_line":"            ratio,"},{"line_number":655,"context_line":"            reserved,"},{"line_number":656,"context_line":"            support)"},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"        pool_usage \u003d dict("},{"line_number":659,"context_line":"            type\u003d\u0027pool\u0027,"},{"line_number":660,"context_line":"            name_to_id\u003d\u0027#\u0027.join([host, pool[\u0027pool_name\u0027]]),"},{"line_number":661,"context_line":"            total\u003dfloat(total),"},{"line_number":662,"context_line":"            free\u003dfloat(free),"},{"line_number":663,"context_line":"            allocated\u003dfloat(allocated),"},{"line_number":664,"context_line":"            provisioned\u003dfloat(provisioned),"},{"line_number":665,"context_line":"            virtual_free\u003dfloat(virtual_free),"},{"line_number":666,"context_line":"            reported_at\u003dtimestamp)"},{"line_number":667,"context_line":""},{"line_number":668,"context_line":"        return pool_usage"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    def _get_updated_pools(self, old_capa, new_capa):"},{"line_number":671,"context_line":"        # Judge if the capabilities should be reported."},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"        new_pools \u003d new_capa.get(\u0027pools\u0027, [])"},{"line_number":674,"context_line":"        if not new_pools:"},{"line_number":675,"context_line":"            return []"},{"line_number":676,"context_line":""},{"line_number":677,"context_line":"        if isinstance(new_pools, list):"},{"line_number":678,"context_line":"            # If the volume_stats is not well prepared, don\u0027t notify."},{"line_number":679,"context_line":"            if not all("},{"line_number":680,"context_line":"                    self.REQUIRED_KEYS.issubset(pool) for pool in new_pools):"},{"line_number":681,"context_line":"                return []"},{"line_number":682,"context_line":"        else:"},{"line_number":683,"context_line":"            LOG.debug(\"The reported capabiilities are not well structured...\")"},{"line_number":684,"context_line":"            return []"},{"line_number":685,"context_line":""},{"line_number":686,"context_line":"        old_pools \u003d old_capa.get(\u0027pools\u0027, [])"},{"line_number":687,"context_line":"        if not old_pools:"},{"line_number":688,"context_line":"            return new_pools"},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"        updated_pools \u003d []"},{"line_number":691,"context_line":""},{"line_number":692,"context_line":"        newpools \u003d {}"},{"line_number":693,"context_line":"        oldpools \u003d {}"},{"line_number":694,"context_line":"        for new_pool in new_pools:"},{"line_number":695,"context_line":"            newpools[new_pool[\u0027pool_name\u0027]] \u003d new_pool"},{"line_number":696,"context_line":""},{"line_number":697,"context_line":"        for old_pool in old_pools:"},{"line_number":698,"context_line":"            oldpools[old_pool[\u0027pool_name\u0027]] \u003d old_pool"},{"line_number":699,"context_line":""},{"line_number":700,"context_line":"        for key in newpools.keys():"},{"line_number":701,"context_line":"            if key in oldpools.keys():"},{"line_number":702,"context_line":"                for k in self.REQUIRED_KEYS:"},{"line_number":703,"context_line":"                    if newpools[key][k] !\u003d oldpools[key][k]:"},{"line_number":704,"context_line":"                        updated_pools.append(newpools[key])"},{"line_number":705,"context_line":"                        break"},{"line_number":706,"context_line":"            else:"},{"line_number":707,"context_line":"                updated_pools.append(newpools[key])"},{"line_number":708,"context_line":""},{"line_number":709,"context_line":"        return updated_pools"},{"line_number":710,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_055c2cec","line":707,"range":{"start_line":607,"start_character":0,"end_line":707,"end_character":51},"updated":"2016-11-24 12:59:09.000000000","message":"Just a note: a lot of this code will be much simpler once we\u0027ll have capabilities well-defined as o.vo.","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6a46a8351e354943cd036e7d230e8d7ff48cb2d4","unresolved":false,"context_lines":[{"line_number":604,"context_line":""},{"line_number":605,"context_line":"        self._notify_capacity_usage(context, usage)"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"    def _get_usage(self, capa_new, updated_pools, host, timestamp):"},{"line_number":608,"context_line":"        pools \u003d capa_new.get(\u0027pools\u0027)"},{"line_number":609,"context_line":"        usage \u003d []"},{"line_number":610,"context_line":"        if pools and isinstance(pools, list):"},{"line_number":611,"context_line":"            backend_usage \u003d dict(type\u003d\u0027backend\u0027,"},{"line_number":612,"context_line":"                                 name_to_id\u003dhost,"},{"line_number":613,"context_line":"                                 total\u003d0,"},{"line_number":614,"context_line":"                                 free\u003d0,"},{"line_number":615,"context_line":"                                 allocated\u003d0,"},{"line_number":616,"context_line":"                                 provisioned\u003d0,"},{"line_number":617,"context_line":"                                 virtual_free\u003d0,"},{"line_number":618,"context_line":"                                 reported_at\u003dtimestamp)"},{"line_number":619,"context_line":""},{"line_number":620,"context_line":"            # Process the usage."},{"line_number":621,"context_line":"            for pool in pools:"},{"line_number":622,"context_line":"                pool_usage \u003d self._get_pool_usage(pool, host, timestamp)"},{"line_number":623,"context_line":"                if pool_usage:"},{"line_number":624,"context_line":"                    backend_usage[\"total\"] +\u003d pool_usage[\"total\"]"},{"line_number":625,"context_line":"                    backend_usage[\"free\"] +\u003d pool_usage[\"free\"]"},{"line_number":626,"context_line":"                    backend_usage[\"allocated\"] +\u003d pool_usage[\"allocated\"]"},{"line_number":627,"context_line":"                    backend_usage[\"provisioned\"] +\u003d pool_usage[\"provisioned\"]"},{"line_number":628,"context_line":"                    backend_usage[\"virtual_free\"] +\u003d pool_usage[\"virtual_free\"]"},{"line_number":629,"context_line":"                # Only the updated pool is reported."},{"line_number":630,"context_line":"                if pool in updated_pools:"},{"line_number":631,"context_line":"                    usage.append(pool_usage)"},{"line_number":632,"context_line":"            usage.append(backend_usage)"},{"line_number":633,"context_line":"        return usage"},{"line_number":634,"context_line":""},{"line_number":635,"context_line":"    def _get_pool_usage(self, pool, host, timestamp):"},{"line_number":636,"context_line":"        total \u003d pool[\"total_capacity_gb\"]"},{"line_number":637,"context_line":"        free \u003d pool[\"free_capacity_gb\"]"},{"line_number":638,"context_line":""},{"line_number":639,"context_line":"        unknowns \u003d [\"unknown\", \"infinite\", None]"},{"line_number":640,"context_line":"        if (total in unknowns) or (free in unknowns):"},{"line_number":641,"context_line":"            return {}"},{"line_number":642,"context_line":""},{"line_number":643,"context_line":"        allocated \u003d pool[\"allocated_capacity_gb\"]"},{"line_number":644,"context_line":"        provisioned \u003d pool[\"provisioned_capacity_gb\"]"},{"line_number":645,"context_line":"        reserved \u003d pool[\"reserved_percentage\"]"},{"line_number":646,"context_line":"        ratio \u003d pool[\"max_over_subscription_ratio\"]"},{"line_number":647,"context_line":"        support \u003d pool[\"thin_provisioning_support\"]"},{"line_number":648,"context_line":""},{"line_number":649,"context_line":"        virtual_free \u003d utils.calculate_virtual_free_capacity("},{"line_number":650,"context_line":"            total,"},{"line_number":651,"context_line":"            free,"},{"line_number":652,"context_line":"            provisioned,"},{"line_number":653,"context_line":"            support,"},{"line_number":654,"context_line":"            ratio,"},{"line_number":655,"context_line":"            reserved,"},{"line_number":656,"context_line":"            support)"},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"        pool_usage \u003d dict("},{"line_number":659,"context_line":"            type\u003d\u0027pool\u0027,"},{"line_number":660,"context_line":"            name_to_id\u003d\u0027#\u0027.join([host, pool[\u0027pool_name\u0027]]),"},{"line_number":661,"context_line":"            total\u003dfloat(total),"},{"line_number":662,"context_line":"            free\u003dfloat(free),"},{"line_number":663,"context_line":"            allocated\u003dfloat(allocated),"},{"line_number":664,"context_line":"            provisioned\u003dfloat(provisioned),"},{"line_number":665,"context_line":"            virtual_free\u003dfloat(virtual_free),"},{"line_number":666,"context_line":"            reported_at\u003dtimestamp)"},{"line_number":667,"context_line":""},{"line_number":668,"context_line":"        return pool_usage"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    def _get_updated_pools(self, old_capa, new_capa):"},{"line_number":671,"context_line":"        # Judge if the capabilities should be reported."},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"        new_pools \u003d new_capa.get(\u0027pools\u0027, [])"},{"line_number":674,"context_line":"        if not new_pools:"},{"line_number":675,"context_line":"            return []"},{"line_number":676,"context_line":""},{"line_number":677,"context_line":"        if isinstance(new_pools, list):"},{"line_number":678,"context_line":"            # If the volume_stats is not well prepared, don\u0027t notify."},{"line_number":679,"context_line":"            if not all("},{"line_number":680,"context_line":"                    self.REQUIRED_KEYS.issubset(pool) for pool in new_pools):"},{"line_number":681,"context_line":"                return []"},{"line_number":682,"context_line":"        else:"},{"line_number":683,"context_line":"            LOG.debug(\"The reported capabiilities are not well structured...\")"},{"line_number":684,"context_line":"            return []"},{"line_number":685,"context_line":""},{"line_number":686,"context_line":"        old_pools \u003d old_capa.get(\u0027pools\u0027, [])"},{"line_number":687,"context_line":"        if not old_pools:"},{"line_number":688,"context_line":"            return new_pools"},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"        updated_pools \u003d []"},{"line_number":691,"context_line":""},{"line_number":692,"context_line":"        newpools \u003d {}"},{"line_number":693,"context_line":"        oldpools \u003d {}"},{"line_number":694,"context_line":"        for new_pool in new_pools:"},{"line_number":695,"context_line":"            newpools[new_pool[\u0027pool_name\u0027]] \u003d new_pool"},{"line_number":696,"context_line":""},{"line_number":697,"context_line":"        for old_pool in old_pools:"},{"line_number":698,"context_line":"            oldpools[old_pool[\u0027pool_name\u0027]] \u003d old_pool"},{"line_number":699,"context_line":""},{"line_number":700,"context_line":"        for key in newpools.keys():"},{"line_number":701,"context_line":"            if key in oldpools.keys():"},{"line_number":702,"context_line":"                for k in self.REQUIRED_KEYS:"},{"line_number":703,"context_line":"                    if newpools[key][k] !\u003d oldpools[key][k]:"},{"line_number":704,"context_line":"                        updated_pools.append(newpools[key])"},{"line_number":705,"context_line":"                        break"},{"line_number":706,"context_line":"            else:"},{"line_number":707,"context_line":"                updated_pools.append(newpools[key])"},{"line_number":708,"context_line":""},{"line_number":709,"context_line":"        return updated_pools"},{"line_number":710,"context_line":""}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_88eabe0d","line":707,"range":{"start_line":607,"start_character":0,"end_line":707,"end_character":51},"in_reply_to":"5a74a57a_055c2cec","updated":"2016-11-28 07:37:47.000000000","message":"Yes.","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"0c2e0fe067ca17c42e41720a44f39792e4e241db","unresolved":false,"context_lines":[{"line_number":640,"context_line":"        ratio \u003d pool[\"max_over_subscription_ratio\"]"},{"line_number":641,"context_line":"        support \u003d pool[\"thin_provisioning_support\"]"},{"line_number":642,"context_line":""},{"line_number":643,"context_line":"        virtual_free \u003d vol_utils.calculate_virtual_free_capacity("},{"line_number":644,"context_line":"            total,"},{"line_number":645,"context_line":"            free,"},{"line_number":646,"context_line":"            provisioned,"}],"source_content_type":"text/x-python","patch_set":51,"id":"5a74a57a_ef4aeaab","line":643,"range":{"start_line":643,"start_character":23,"end_line":643,"end_character":32},"updated":"2016-11-30 03:00:48.000000000","message":"This needs to be called for cinder.utils, but volume_utils is cinder.volume.utils.","commit_id":"7a0ee18e016afcb43333e352210b914e7c609753"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"d5b3385cfb13b32abd4acdeaf7612df6bf25d017","unresolved":false,"context_lines":[{"line_number":460,"context_line":"        capab_last_update \u003d self.service_states_last_update.get("},{"line_number":461,"context_line":"            host, {\"timestamp\": 0})"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"        # If the capabilites is not changed and the timestamp is older,"},{"line_number":464,"context_line":"        # record the capabilities."},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"        # There are cases: capab_old has the capabilities set,"}],"source_content_type":"text/x-python","patch_set":53,"id":"3a71b18c_3b3fd826","line":463,"range":{"start_line":463,"start_character":17,"end_line":463,"end_character":31},"updated":"2016-12-01 10:42:36.000000000","message":"capabilities are","commit_id":"0d1057075e9dbc78ef7f13e82866a09be4231d5b"}],"cinder/scheduler/manager.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"bb33c665e356f8208878bcbfbc595156a5bf8c4e","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                                                host,"},{"line_number":89,"context_line":"                                                capabilities)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def notify_service_capabilities(self, context, service_name\u003dNone,"},{"line_number":92,"context_line":"                                    host\u003dNone, capabilities\u003dNone, **kwargs):"},{"line_number":93,"context_line":"        \"\"\"Process a capability update from a service node.\"\"\""},{"line_number":94,"context_line":"        if capabilities is None:"},{"line_number":95,"context_line":"            capabilities \u003d {}"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_ba639740","line":92,"range":{"start_line":91,"start_character":0,"end_line":92,"end_character":76},"updated":"2016-11-24 12:59:09.000000000","message":"I know this is copied from the method above, but I think we should be explicit with our RPC methods. IMO the method signature should look like this:\n\n    def notify_service_capabilities(self, context, service_name, host,\n                                    capabilities):","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6a46a8351e354943cd036e7d230e8d7ff48cb2d4","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                                                host,"},{"line_number":89,"context_line":"                                                capabilities)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def notify_service_capabilities(self, context, service_name\u003dNone,"},{"line_number":92,"context_line":"                                    host\u003dNone, capabilities\u003dNone, **kwargs):"},{"line_number":93,"context_line":"        \"\"\"Process a capability update from a service node.\"\"\""},{"line_number":94,"context_line":"        if capabilities is None:"},{"line_number":95,"context_line":"            capabilities \u003d {}"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_885f1ee4","line":92,"range":{"start_line":91,"start_character":0,"end_line":92,"end_character":76},"in_reply_to":"5a74a57a_ba639740","updated":"2016-11-28 07:37:47.000000000","message":"I agree.","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"d5b3385cfb13b32abd4acdeaf7612df6bf25d017","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                                                capabilities)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def notify_service_capabilities(self, context, service_name,"},{"line_number":92,"context_line":"                                    host, capabilities, **kwargs):"},{"line_number":93,"context_line":"        \"\"\"Process a capability update from a service node.\"\"\""},{"line_number":94,"context_line":"        if capabilities is None:"},{"line_number":95,"context_line":"            capabilities \u003d {}"}],"source_content_type":"text/x-python","patch_set":53,"id":"3a71b18c_7b779002","line":92,"range":{"start_line":92,"start_character":54,"end_line":92,"end_character":64},"updated":"2016-12-01 10:42:36.000000000","message":"Will the code fail without **kwargs here?","commit_id":"0d1057075e9dbc78ef7f13e82866a09be4231d5b"}],"cinder/scheduler/rpcapi.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"bb33c665e356f8208878bcbfbc595156a5bf8c4e","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                   service_name\u003dservice_name, host\u003dhost,"},{"line_number":142,"context_line":"                   capabilities\u003dcapabilities)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def notify_service_capabilities(self, ctxt,"},{"line_number":145,"context_line":"                                    service_name, host,"},{"line_number":146,"context_line":"                                    capabilities):"},{"line_number":147,"context_line":"        cctxt \u003d self._get_cctxt(version\u003d\u00273.1\u0027)"},{"line_number":148,"context_line":"        cctxt.cast(ctxt, \u0027notify_service_capabilities\u0027,"},{"line_number":149,"context_line":"                   service_name\u003dservice_name, host\u003dhost,"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_5ae603b5","line":146,"range":{"start_line":144,"start_character":0,"end_line":146,"end_character":50},"updated":"2016-11-24 12:59:09.000000000","message":"nit: We can format that in only 2 lines.","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6a46a8351e354943cd036e7d230e8d7ff48cb2d4","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                   service_name\u003dservice_name, host\u003dhost,"},{"line_number":142,"context_line":"                   capabilities\u003dcapabilities)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def notify_service_capabilities(self, ctxt,"},{"line_number":145,"context_line":"                                    service_name, host,"},{"line_number":146,"context_line":"                                    capabilities):"},{"line_number":147,"context_line":"        cctxt \u003d self._get_cctxt(version\u003d\u00273.1\u0027)"},{"line_number":148,"context_line":"        cctxt.cast(ctxt, \u0027notify_service_capabilities\u0027,"},{"line_number":149,"context_line":"                   service_name\u003dservice_name, host\u003dhost,"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_c85596c2","line":146,"range":{"start_line":144,"start_character":0,"end_line":146,"end_character":50},"in_reply_to":"5a74a57a_5ae603b5","updated":"2016-11-28 07:37:47.000000000","message":"Done","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"}],"cinder/tests/unit/scheduler/test_host_manager.py":[{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"375102b4a7204dfc5d25f78ac0850e883a001d29","unresolved":false,"context_lines":[{"line_number":580,"context_line":"        self.assertEqual(len(expected), len(res))"},{"line_number":581,"context_line":"        self.assertEqual(sorted(expected), sorted(res))"},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"        self.assertEqual(res[\"host1@backend1\"][\"total\"], 50.02)"},{"line_number":584,"context_line":"        self.assertEqual(res[\"host1@backend1\"][\"free\"], 46.02)"},{"line_number":585,"context_line":"        self.assertEqual(res[\"host1@backend1\"][\"allocated\"], 4.0)"},{"line_number":586,"context_line":"        self.assertEqual(res[\"host1@backend1\"][\"provisioned\"], 4.0)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a50d1a3_b46bbf84","line":583,"updated":"2015-08-01 15:07:13.000000000","message":"self.assertEqual(50.02, res[\"host1@backend1\"][\"total\"])\n\nPlease change the order of parameters below as well.","commit_id":"22d863a83095bc1b250e310a3a3ef13c5de1ce26"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"a411df8c497b43983760d776c519a81afaffd935","unresolved":false,"context_lines":[{"line_number":381,"context_line":""},{"line_number":382,"context_line":"        pools \u003d ["},{"line_number":383,"context_line":"            dict(name\u003d\u0027host1@backend1#pool1\u0027,"},{"line_number":384,"context_line":"                 capabilities\u003d(dict(pool_name\u003d\u0027pool1\u0027,"},{"line_number":385,"context_line":"                                    filter_function\u003dNone,"},{"line_number":386,"context_line":"                                    volume_backend_name\u003d\u0027backend1\u0027,"},{"line_number":387,"context_line":"                                    total_capacity_gb\u003d30.01,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_fb81cbc3","line":384,"updated":"2015-08-07 08:39:35.000000000","message":"Can you put the capabilities creation into a common method, as you can see\nthere is too much code in common.","commit_id":"f22609842851459eb9c6675d6b3d1a14be37c619"},{"author":{"_account_id":8202,"name":"chenzongliang","email":"chenzongliang@huawei.com","username":"zongliang"},"change_message_id":"b6cd3f952a4bc030d37552f431dc61d9b53b182e","unresolved":false,"context_lines":[{"line_number":504,"context_line":"        self.assertEqual(8, len(res))"},{"line_number":505,"context_line":""},{"line_number":506,"context_line":"        expected \u003d {"},{"line_number":507,"context_line":"            \"host1@backend1#pool1\": {"},{"line_number":508,"context_line":"                \"name_to_id\": \u0027host1@backend1#pool1\u0027,"},{"line_number":509,"context_line":"                \"type\": \"pool\","},{"line_number":510,"context_line":"                \"total\": 30.01,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_1b879cd8","line":507,"updated":"2015-08-09 10:12:09.000000000","message":"the same as above,may be you can generate the capabilities random","commit_id":"f22609842851459eb9c6675d6b3d1a14be37c619"},{"author":{"_account_id":10674,"name":"Yusuke Hayashi","email":"yusuke.hayashi.710@gmail.com","username":"YusukeHayashi"},"change_message_id":"4e10807399a246070f109b873482f55f9ade04e5","unresolved":false,"context_lines":[{"line_number":583,"context_line":"        res1 \u003d self.host_manager._get_usage(volume_stats1,"},{"line_number":584,"context_line":"                                            updated_pools1, host, timestamp)"},{"line_number":585,"context_line":"        self.assertEqual(len(expected1), len(res1))"},{"line_number":586,"context_line":"        self.assertEqual(sorted(expected1), sorted(res1))"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"        res2 \u003d self.host_manager._get_usage(volume_stats2,"},{"line_number":589,"context_line":"                                            updated_pools2, host, timestamp)"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a29b11f_26f50956","line":586,"updated":"2015-10-22 03:38:07.000000000","message":"This is imcompatible with python3.4.\nI think you need to fix as below:\n   for expected in expected1:\n       self.assertIn(expected, res1)","commit_id":"bbac0d2c52762b00f7a07b6a6c919815829b3ec8"},{"author":{"_account_id":16917,"name":"Alex O\u0027Rourke","email":"alex.orourke@hpe.com","username":"aorourke"},"change_message_id":"8189459df9d5c93b1291f73958fd3cdb58341942","unresolved":false,"context_lines":[{"line_number":583,"context_line":"        res1 \u003d self.host_manager._get_usage(volume_stats1,"},{"line_number":584,"context_line":"                                            updated_pools1, host, timestamp)"},{"line_number":585,"context_line":"        self.assertEqual(len(expected1), len(res1))"},{"line_number":586,"context_line":"        self.assertEqual(sorted(expected1), sorted(res1))"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"        res2 \u003d self.host_manager._get_usage(volume_stats2,"},{"line_number":589,"context_line":"                                            updated_pools2, host, timestamp)"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a29b11f_6fb675fa","line":586,"in_reply_to":"3a29b11f_26f50956","updated":"2015-10-22 05:11:23.000000000","message":"+1","commit_id":"bbac0d2c52762b00f7a07b6a6c919815829b3ec8"},{"author":{"_account_id":10674,"name":"Yusuke Hayashi","email":"yusuke.hayashi.710@gmail.com","username":"YusukeHayashi"},"change_message_id":"4e10807399a246070f109b873482f55f9ade04e5","unresolved":false,"context_lines":[{"line_number":588,"context_line":"        res2 \u003d self.host_manager._get_usage(volume_stats2,"},{"line_number":589,"context_line":"                                            updated_pools2, host, timestamp)"},{"line_number":590,"context_line":"        self.assertEqual(len(expected2), len(res2))"},{"line_number":591,"context_line":"        self.assertEqual(sorted(expected2), sorted(res2))"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":""},{"line_number":594,"context_line":"class HostStateTestCase(test.TestCase):"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a29b11f_266ae9ee","line":591,"updated":"2015-10-22 03:38:07.000000000","message":"same as above","commit_id":"bbac0d2c52762b00f7a07b6a6c919815829b3ec8"},{"author":{"_account_id":13203,"name":"Wilson Liu","email":"295988511@qq.com","username":"Bob-OpenStack"},"change_message_id":"7904583f3dd7874e7f54c573e70fadc81ce88eeb","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        service_states \u003d self.host_manager.service_states"},{"line_number":132,"context_line":"        service_states_last \u003d self.host_manager.service_states_last"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        self.assertDictMatch(service_states, {})"},{"line_number":135,"context_line":"        self.assertDictMatch(service_states_last, {})"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        _mock_utcnow.side_effect \u003d [31337, 31338, 31339, 31340,"}],"source_content_type":"text/x-python","patch_set":30,"id":"fa80f949_afc98eae","line":134,"updated":"2015-11-03 14:04:46.000000000","message":"The expected value should be the first parameter:\nself.assertDictMatch({}, service_states)","commit_id":"014cbf1aca7d809fa222f5dc936215486e282621"},{"author":{"_account_id":13203,"name":"Wilson Liu","email":"295988511@qq.com","username":"Bob-OpenStack"},"change_message_id":"7904583f3dd7874e7f54c573e70fadc81ce88eeb","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        service_states_last \u003d self.host_manager.service_states_last"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        self.assertDictMatch(service_states, {})"},{"line_number":135,"context_line":"        self.assertDictMatch(service_states_last, {})"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        _mock_utcnow.side_effect \u003d [31337, 31338, 31339, 31340,"},{"line_number":138,"context_line":"                                    31341, 31342]"}],"source_content_type":"text/x-python","patch_set":30,"id":"fa80f949_cfce52b4","line":135,"updated":"2015-11-03 14:04:46.000000000","message":"ditto","commit_id":"014cbf1aca7d809fa222f5dc936215486e282621"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"717ea59502c36a69cbd23682d0a0f475c3d6d5a6","unresolved":false,"context_lines":[{"line_number":331,"context_line":"        #    own turn to notify the changed capab2."},{"line_number":332,"context_line":"        #    In this case, we have notified the same capabilities twice."},{"line_number":333,"context_line":"        #"},{"line_number":334,"context_line":"        # S0: notify_service_capabilities()"},{"line_number":335,"context_line":"        self.host_manager.notify_service_capabilities(service_name, \u0027host1\u0027,"},{"line_number":336,"context_line":"                                                      capab2)"},{"line_number":337,"context_line":"        self.assertDictMatch("}],"source_content_type":"text/x-python","patch_set":35,"id":"1a7b0d38_dca19047","line":334,"updated":"2015-12-29 09:04:14.000000000","message":"Could those cases be split into small tests, that\u0027s feel better to maintain.","commit_id":"27254751d6c0b035cbd4f7b17bbf2dec4903bc82"}],"cinder/tests/unit/scheduler/test_rpcapi.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"bb33c665e356f8208878bcbfbc595156a5bf8c4e","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                                 rpc_method\u003d\u0027cast\u0027,"},{"line_number":102,"context_line":"                                 service_name\u003d\u0027fake_name\u0027,"},{"line_number":103,"context_line":"                                 host\u003d\u0027fake_host\u0027,"},{"line_number":104,"context_line":"                                 capabilities\u003d\u0027fake_capabilities\u0027,"},{"line_number":105,"context_line":"                                 version\u003d\u00273.1\u0027)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def test_create_volume_serialization(self):"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_3afea738","line":104,"range":{"start_line":104,"start_character":46,"end_line":104,"end_character":65},"updated":"2016-11-24 12:59:09.000000000","message":"Can we make this a dictionary?","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6a46a8351e354943cd036e7d230e8d7ff48cb2d4","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                                 rpc_method\u003d\u0027cast\u0027,"},{"line_number":102,"context_line":"                                 service_name\u003d\u0027fake_name\u0027,"},{"line_number":103,"context_line":"                                 host\u003d\u0027fake_host\u0027,"},{"line_number":104,"context_line":"                                 capabilities\u003d\u0027fake_capabilities\u0027,"},{"line_number":105,"context_line":"                                 version\u003d\u00273.1\u0027)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def test_create_volume_serialization(self):"}],"source_content_type":"text/x-python","patch_set":49,"id":"5a74a57a_486a6682","line":104,"range":{"start_line":104,"start_character":46,"end_line":104,"end_character":65},"in_reply_to":"5a74a57a_3afea738","updated":"2016-11-28 07:37:47.000000000","message":"Done","commit_id":"e82cc7fbd3fe957ab7d4077636bc0a54af4fc4ac"}],"cinder/volume/utils.py":[{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"6abf9ba587150f6db395d5b21d8ca66acfabe748","unresolved":false,"context_lines":[{"line_number":165,"context_line":"                                            usage_info)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"def _usage_from_capacity(context, capacity, **extra_usage_info):"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    capacity_info \u003d {"},{"line_number":171,"context_line":"        \u0027name_to_id\u0027: capacity[\u0027name_to_id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_9fbf17d0","line":168,"updated":"2015-08-04 03:12:17.000000000","message":"context isn\u0027t used here, can be removed.","commit_id":"22d863a83095bc1b250e310a3a3ef13c5de1ce26"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"d5c996261a26e34f063a1c978eebf09c556ce1e3","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"def notify_about_capacity_usage(context, capacity, suffix,"},{"line_number":185,"context_line":"                                extra_usage_info\u003d None, host\u003dNone):"},{"line_number":186,"context_line":"    if not host:"},{"line_number":187,"context_line":"        host \u003d CONF.host"},{"line_number":188,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_9c7e38e3","line":185,"updated":"2015-08-04 09:11:05.000000000","message":"Remove extra space after \"\u003d\" from extra_usage_info\u003d None.","commit_id":"71ab3a8a4db794655f76f02ed327d2b4f2311504"},{"author":{"_account_id":17718,"name":"Lallana","email":"gaozhiqiang2@huawei.com","username":"Lallana"},"change_message_id":"3c33d7a55a3a96602f89615766f0bccba2c21d9c","unresolved":false,"context_lines":[{"line_number":561,"context_line":""},{"line_number":562,"context_line":"def matching_backend_name(src_volume_type, volume_type):"},{"line_number":563,"context_line":"    if src_volume_type.get(\u0027volume_backend_name\u0027) and \\"},{"line_number":564,"context_line":"            volume_type.get(\u0027volume_backend_name\u0027):"},{"line_number":565,"context_line":"        return src_volume_type.get(\u0027volume_backend_name\u0027) \u003d\u003d \\"},{"line_number":566,"context_line":"            volume_type.get(\u0027volume_backend_name\u0027)"},{"line_number":567,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_3c09f431","line":564,"updated":"2015-08-28 10:04:24.000000000","message":"Please wrap in () and remove use of \\ for line continuation.","commit_id":"345885e68021d1940fc0dcf12ca66c8bd052e9e8"},{"author":{"_account_id":9003,"name":"Tom Barron","email":"tpb@dyncloud.net","username":"tbarron"},"change_message_id":"d1f5d57558e4baedff19e2e21cd7dc72f39ccfdd","unresolved":false,"context_lines":[{"line_number":561,"context_line":""},{"line_number":562,"context_line":"def matching_backend_name(src_volume_type, volume_type):"},{"line_number":563,"context_line":"    if src_volume_type.get(\u0027volume_backend_name\u0027) and \\"},{"line_number":564,"context_line":"            volume_type.get(\u0027volume_backend_name\u0027):"},{"line_number":565,"context_line":"        return src_volume_type.get(\u0027volume_backend_name\u0027) \u003d\u003d \\"},{"line_number":566,"context_line":"            volume_type.get(\u0027volume_backend_name\u0027)"},{"line_number":567,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_da2f98f4","line":564,"in_reply_to":"da20952f_3c09f431","updated":"2015-08-28 10:40:53.000000000","message":"We are following this rule now, but the proposed change set does not touch this method so that cleanup can be done in a separate patch.  Or if it is done, then the commit message will need to be changed to mention that as well since it is an unrelated change.","commit_id":"345885e68021d1940fc0dcf12ca66c8bd052e9e8"}],"releasenotes/notes/capacity-headroom-4b07701f1df9e5c4.yaml":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"d5b3385cfb13b32abd4acdeaf7612df6bf25d017","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Cinder gets capacity info including virtual"},{"line_number":4,"context_line":"    free capacity etc from backend, and sends"},{"line_number":5,"context_line":"    out notifications about the info."}],"source_content_type":"text/x-yaml","patch_set":53,"id":"3a71b18c_1b405c56","line":5,"range":{"start_line":3,"start_character":4,"end_line":5,"end_character":37},"updated":"2016-12-01 10:42:36.000000000","message":"Maybe we can reword this into:\n\n  - Cinder is now collecting capacity data, including virtual free capacity,\n    from the backends. A notification that includes that data is periodically\n    emitted.","commit_id":"0d1057075e9dbc78ef7f13e82866a09be4231d5b"}]}
