)]}'
{"climate/plugins/oshosts/reservation_pool.py":[{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self.pool \u003d pool"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def __str__(self):"},{"line_number":81,"context_line":"        return self.msg % (self.pool)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"class ReservationPool(object):"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOWY%3D","line":81,"updated":"2013-11-28 17:59:27.000000000","message":"We do not have needs in using () in case of one argument for strings template. Maybe we may remove them here.","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        if az_name is None:"},{"line_number":152,"context_line":"            LOG.debug(\u0027Creating pool aggregate: %s\u0027"},{"line_number":153,"context_line":"                      \u0027without Availability Zone\u0027 % name"},{"line_number":154,"context_line":"                      )"},{"line_number":155,"context_line":"            agg \u003d self.nova.aggregates.create(name)"},{"line_number":156,"context_line":"        else:"},{"line_number":157,"context_line":"            LOG.debug(\u0027Creating pool aggregate: %s\u0027"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOV0%3D","line":154,"updated":"2013-11-28 17:59:27.000000000","message":"Placing ) on next line is useful only in case like:\n\nfn(\n    ....\n)\n\nHere you may place it on previous line","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        else:"},{"line_number":157,"context_line":"            LOG.debug(\u0027Creating pool aggregate: %s\u0027"},{"line_number":158,"context_line":"                      \u0027with Availability Zone %s\u0027 % (name, az_name)"},{"line_number":159,"context_line":"                      )"},{"line_number":160,"context_line":"            agg \u003d self.nova.aggregates.create(name, az_name)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        meta \u003d {CLIMATE_OWNER: self.ctx.tenant_id}"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOVs%3D","line":159,"updated":"2013-11-28 17:59:27.000000000","message":"the same","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"        LOG.info(\"removing host \u0027%s\u0027 \""},{"line_number":239,"context_line":"                 \"to aggregate freepool %s\" % (host,"},{"line_number":240,"context_line":"                                               freepool_agg.name))"},{"line_number":241,"context_line":"        self.remove_computehost(freepool_agg.id, host)"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"        LOG.info(\"adding host \u0027%s\u0027 to aggregate %s\" % (host, agg.id))"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOWA%3D","line":240,"updated":"2013-11-28 17:59:27.000000000","message":"You may place freepool_agg.name on the previous line","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"ee2613cdb27eedc26c9694c35fb8cf53f43890a4","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        auth_url \u003d \"%s://%s:%s/v2.0\" % (cfg.CONF.os_auth_protocol,"},{"line_number":91,"context_line":"                                        cfg.CONF.os_auth_host,"},{"line_number":92,"context_line":"                                        cfg.CONF.os_auth_port"},{"line_number":93,"context_line":"                                        )"},{"line_number":94,"context_line":"        self.nova \u003d client.Client(\u00272\u0027,"},{"line_number":95,"context_line":"                                  username\u003dcfg.CONF.os_admin_username,"},{"line_number":96,"context_line":"                                  api_key\u003dcfg.CONF.os_admin_password,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAATn%2F%2BMvU%3D","line":93,"updated":"2013-11-29 09:46:56.000000000","message":"the same here: put \u0027)\u0027 on the previous line or at least add comma after cfg.CONF.os_auth_port. You moved \u0027)\u0027 on the last patch set, so keep the same here, I think.","commit_id":"1fb7cd2a080a865a8698ea4aa4426c94a0ceadce"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"af677f912a6fa565fc0ab56777631c1b09e07187","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        auth_url \u003d \"%s://%s:%s/v2.0\" % (cfg.CONF.os_auth_protocol,"},{"line_number":91,"context_line":"                                        cfg.CONF.os_auth_host,"},{"line_number":92,"context_line":"                                        cfg.CONF.os_auth_port"},{"line_number":93,"context_line":"                                        )"},{"line_number":94,"context_line":"        self.nova \u003d client.Client(\u00272\u0027,"},{"line_number":95,"context_line":"                                  username\u003dcfg.CONF.os_admin_username,"},{"line_number":96,"context_line":"                                  api_key\u003dcfg.CONF.os_admin_password,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAATn%2F%2BMQA%3D","line":93,"in_reply_to":"AAAATn%2F%2BMvU%3D","updated":"2013-11-29 12:43:29.000000000","message":"Done","commit_id":"1fb7cd2a080a865a8698ea4aa4426c94a0ceadce"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"ee2613cdb27eedc26c9694c35fb8cf53f43890a4","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                                  api_key\u003dcfg.CONF.os_admin_password,"},{"line_number":97,"context_line":"                                  auth_url\u003dauth_url,"},{"line_number":98,"context_line":"                                  project_id\u003dcfg.CONF.os_admin_tenant_name"},{"line_number":99,"context_line":"                                  )"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def get_aggregate_from_name(self, name):"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAATn%2F%2BMvQ%3D","line":99,"updated":"2013-11-29 09:46:56.000000000","message":"the same","commit_id":"1fb7cd2a080a865a8698ea4aa4426c94a0ceadce"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"af677f912a6fa565fc0ab56777631c1b09e07187","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                                  api_key\u003dcfg.CONF.os_admin_password,"},{"line_number":97,"context_line":"                                  auth_url\u003dauth_url,"},{"line_number":98,"context_line":"                                  project_id\u003dcfg.CONF.os_admin_tenant_name"},{"line_number":99,"context_line":"                                  )"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def get_aggregate_from_name(self, name):"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAATn%2F%2BMQE%3D","line":99,"in_reply_to":"AAAATn%2F%2BMvQ%3D","updated":"2013-11-29 12:43:29.000000000","message":"Done","commit_id":"1fb7cd2a080a865a8698ea4aa4426c94a0ceadce"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"3adfd0fe39ccede5f5050053cc5f1ed67c04d4a5","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"TENANT_ID_KEY \u003d \u0027climate:tenant\u0027"},{"line_number":39,"context_line":"CLIMATE_OWNER \u003d \u0027climate:owner\u0027"},{"line_number":40,"context_line":"CLIMATE_AZ_PREFIX \u003d \u0027climate:\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class NoFreePool(Exception):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F%2BJv8%3D","line":40,"updated":"2013-12-01 17:48:47.000000000","message":"These should be config values.","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"135cd4b25188c0d9c6fd7fc9b670b672fb5e7101","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"TENANT_ID_KEY \u003d \u0027climate:tenant\u0027"},{"line_number":39,"context_line":"CLIMATE_OWNER \u003d \u0027climate:owner\u0027"},{"line_number":40,"context_line":"CLIMATE_AZ_PREFIX \u003d \u0027climate:\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class NoFreePool(Exception):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F9%2BPc%3D","line":40,"in_reply_to":"AAAATn%2F%2BJv8%3D","updated":"2013-12-04 08:27:23.000000000","message":"Done","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"3adfd0fe39ccede5f5050053cc5f1ed67c04d4a5","unresolved":false,"context_lines":[{"line_number":40,"context_line":"CLIMATE_AZ_PREFIX \u003d \u0027climate:\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class NoFreePool(Exception):"},{"line_number":44,"context_line":"    pass"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F%2BJq4%3D","line":43,"updated":"2013-12-01 17:48:47.000000000","message":"I think, these exception should be derived from ClimateException or its descendants.","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"135cd4b25188c0d9c6fd7fc9b670b672fb5e7101","unresolved":false,"context_lines":[{"line_number":40,"context_line":"CLIMATE_AZ_PREFIX \u003d \u0027climate:\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class NoFreePool(Exception):"},{"line_number":44,"context_line":"    pass"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F9%2BCk%3D","line":43,"in_reply_to":"AAAATn%2F%2BJq4%3D","updated":"2013-12-04 08:27:23.000000000","message":"Done","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"3adfd0fe39ccede5f5050053cc5f1ed67c04d4a5","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        if agg_id is not None:"},{"line_number":121,"context_line":"            return self.nova.aggregates.get(agg_id)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def get_aggregate_from_name_or_id(self, whatever):"},{"line_number":124,"context_line":"        \"\"\"Return an aggregate by name or an id.\"\"\""},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        aggregate \u003d self.get_aggregate_from_id(whatever)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F%2BJqk%3D","line":123,"updated":"2013-12-01 17:48:47.000000000","message":"These three methods behave and are used very inconsistent.\n\nThe first one returns None telling that there is no such aggregate. The second one will raise an exception from novaclient. This one can do one or another.\n\nYou should always raise AggregateNotFound if there is no such aggregate and handle this exception in the code later if it is needed.","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7d5561e088832d06a4085d1f74f6f2a4a7081cee","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        if agg_id is not None:"},{"line_number":121,"context_line":"            return self.nova.aggregates.get(agg_id)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def get_aggregate_from_name_or_id(self, whatever):"},{"line_number":124,"context_line":"        \"\"\"Return an aggregate by name or an id.\"\"\""},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        aggregate \u003d self.get_aggregate_from_id(whatever)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F97YM%3D","line":123,"in_reply_to":"AAAATn%2F%2BJqk%3D","updated":"2013-12-04 20:36:54.000000000","message":"Done","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"3adfd0fe39ccede5f5050053cc5f1ed67c04d4a5","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        if az:"},{"line_number":147,"context_line":"            az_name \u003d \"%s%s\" % (CLIMATE_AZ_PREFIX, name)"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        if az_name is None:"},{"line_number":150,"context_line":"            LOG.debug(\u0027Creating pool aggregate: %s\u0027"},{"line_number":151,"context_line":"                      \u0027without Availability Zone\u0027 % name)"},{"line_number":152,"context_line":"            agg \u003d self.nova.aggregates.create(name)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F%2BJqU%3D","line":149,"updated":"2013-12-01 17:48:47.000000000","message":"This should be an else: branch for previous if:.","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7d5561e088832d06a4085d1f74f6f2a4a7081cee","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        if az:"},{"line_number":147,"context_line":"            az_name \u003d \"%s%s\" % (CLIMATE_AZ_PREFIX, name)"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        if az_name is None:"},{"line_number":150,"context_line":"            LOG.debug(\u0027Creating pool aggregate: %s\u0027"},{"line_number":151,"context_line":"                      \u0027without Availability Zone\u0027 % name)"},{"line_number":152,"context_line":"            agg \u003d self.nova.aggregates.create(name)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F97V8%3D","line":149,"in_reply_to":"AAAATn%2F%2BJqU%3D","updated":"2013-12-04 20:36:54.000000000","message":"Done","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"3adfd0fe39ccede5f5050053cc5f1ed67c04d4a5","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            LOG.debug(\u0027Creating pool aggregate: %s\u0027"},{"line_number":151,"context_line":"                      \u0027without Availability Zone\u0027 % name)"},{"line_number":152,"context_line":"            agg \u003d self.nova.aggregates.create(name)"},{"line_number":153,"context_line":"        else:"},{"line_number":154,"context_line":"            LOG.debug(\u0027Creating pool aggregate: %s\u0027"},{"line_number":155,"context_line":"                      \u0027with Availability Zone %s\u0027 % (name, az_name))"},{"line_number":156,"context_line":"            agg \u003d self.nova.aggregates.create(name, az_name)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F%2BJqQ%3D","line":153,"updated":"2013-12-01 17:48:47.000000000","message":"And this should be in that if:.","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7d5561e088832d06a4085d1f74f6f2a4a7081cee","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            LOG.debug(\u0027Creating pool aggregate: %s\u0027"},{"line_number":151,"context_line":"                      \u0027without Availability Zone\u0027 % name)"},{"line_number":152,"context_line":"            agg \u003d self.nova.aggregates.create(name)"},{"line_number":153,"context_line":"        else:"},{"line_number":154,"context_line":"            LOG.debug(\u0027Creating pool aggregate: %s\u0027"},{"line_number":155,"context_line":"                      \u0027with Availability Zone %s\u0027 % (name, az_name))"},{"line_number":156,"context_line":"            agg \u003d self.nova.aggregates.create(name, az_name)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F97V4%3D","line":153,"in_reply_to":"AAAATn%2F%2BJqQ%3D","updated":"2013-12-04 20:36:54.000000000","message":"Done","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"3adfd0fe39ccede5f5050053cc5f1ed67c04d4a5","unresolved":false,"context_lines":[{"line_number":239,"context_line":"        try:"},{"line_number":240,"context_line":"            return self.nova.aggregates.add_host(agg.id, host)"},{"line_number":241,"context_line":"        except nova_exceptions.ClientException as e:"},{"line_number":242,"context_line":"            LOG.exception(e)"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def add_computehost_to_freepool(self, host):"},{"line_number":245,"context_line":"        freepool_agg \u003d self.get(self.freepool_name)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F%2BJq0%3D","line":242,"updated":"2013-12-01 17:48:47.000000000","message":"We shouldn\u0027t discard exceptions like this.\n\nIt\u0027s discarded here but not handled in the next method. Is there anything to it?","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7d5561e088832d06a4085d1f74f6f2a4a7081cee","unresolved":false,"context_lines":[{"line_number":239,"context_line":"        try:"},{"line_number":240,"context_line":"            return self.nova.aggregates.add_host(agg.id, host)"},{"line_number":241,"context_line":"        except nova_exceptions.ClientException as e:"},{"line_number":242,"context_line":"            LOG.exception(e)"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def add_computehost_to_freepool(self, host):"},{"line_number":245,"context_line":"        freepool_agg \u003d self.get(self.freepool_name)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F97So%3D","line":242,"in_reply_to":"AAAATn%2F%2BJq0%3D","updated":"2013-12-04 20:36:54.000000000","message":"Done","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"3adfd0fe39ccede5f5050053cc5f1ed67c04d4a5","unresolved":false,"context_lines":[{"line_number":276,"context_line":"            try:"},{"line_number":277,"context_line":"                self.nova.aggregates.remove_host(agg.id, host)"},{"line_number":278,"context_line":"                self.nova.aggregates.add_host(freepool_agg.id, host)"},{"line_number":279,"context_line":"            except nova_exceptions.ClientException as e:"},{"line_number":280,"context_line":"                raise CantRemoveHost(e)"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    def remove_computehost_from_freepool(self, hosts):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F%2BJqo%3D","line":279,"updated":"2013-12-01 17:48:47.000000000","message":"This can happen on either remove_host or add_host. Errors should be more descriptive.\n\nIt should be wise to either rollback removal (for all hosts or only for current one) or try to proceed with the remaining hosts raising exception after the loop.","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7d5561e088832d06a4085d1f74f6f2a4a7081cee","unresolved":false,"context_lines":[{"line_number":276,"context_line":"            try:"},{"line_number":277,"context_line":"                self.nova.aggregates.remove_host(agg.id, host)"},{"line_number":278,"context_line":"                self.nova.aggregates.add_host(freepool_agg.id, host)"},{"line_number":279,"context_line":"            except nova_exceptions.ClientException as e:"},{"line_number":280,"context_line":"                raise CantRemoveHost(e)"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    def remove_computehost_from_freepool(self, hosts):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F944Y%3D","line":279,"in_reply_to":"AAAATn%2F%2BJqo%3D","updated":"2013-12-04 20:36:54.000000000","message":"Done","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"3adfd0fe39ccede5f5050053cc5f1ed67c04d4a5","unresolved":false,"context_lines":[{"line_number":304,"context_line":""},{"line_number":305,"context_line":"        agg \u003d self.get_aggregate_from_name_or_id(pool)"},{"line_number":306,"context_line":"        if agg is None:"},{"line_number":307,"context_line":"            raise nova_exceptions.NotFound(\"No aggregate \u0027%s\u0027\" % pool)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"        return self.nova.aggregates.set_metadata(agg.id, metadata)"},{"line_number":310,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F%2BJqM%3D","line":307,"updated":"2013-12-01 17:48:47.000000000","message":"Don\u0027t raise exceptions from nova_exceptions directly.","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"135cd4b25188c0d9c6fd7fc9b670b672fb5e7101","unresolved":false,"context_lines":[{"line_number":304,"context_line":""},{"line_number":305,"context_line":"        agg \u003d self.get_aggregate_from_name_or_id(pool)"},{"line_number":306,"context_line":"        if agg is None:"},{"line_number":307,"context_line":"            raise nova_exceptions.NotFound(\"No aggregate \u0027%s\u0027\" % pool)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"        return self.nova.aggregates.set_metadata(agg.id, metadata)"},{"line_number":310,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F9%2BBI%3D","line":307,"in_reply_to":"AAAATn%2F%2BJqM%3D","updated":"2013-12-04 08:27:23.000000000","message":"Done","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"3adfd0fe39ccede5f5050053cc5f1ed67c04d4a5","unresolved":false,"context_lines":[{"line_number":313,"context_line":""},{"line_number":314,"context_line":"        agg \u003d self.get_aggregate_from_name_or_id(pool)"},{"line_number":315,"context_line":"        if agg is None:"},{"line_number":316,"context_line":"            raise nova_exceptions.NotFound(\"Can\u0027t add project to an\""},{"line_number":317,"context_line":"                                           \"nonexistent aggregate %s\" % pool)"},{"line_number":318,"context_line":"        metadata \u003d {project_id: None}"},{"line_number":319,"context_line":"        return self.nova.aggregates.set_metadata(agg.id, metadata)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F%2BJqI%3D","line":316,"updated":"2013-12-01 17:48:47.000000000","message":"ditto","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"135cd4b25188c0d9c6fd7fc9b670b672fb5e7101","unresolved":false,"context_lines":[{"line_number":313,"context_line":""},{"line_number":314,"context_line":"        agg \u003d self.get_aggregate_from_name_or_id(pool)"},{"line_number":315,"context_line":"        if agg is None:"},{"line_number":316,"context_line":"            raise nova_exceptions.NotFound(\"Can\u0027t add project to an\""},{"line_number":317,"context_line":"                                           \"nonexistent aggregate %s\" % pool)"},{"line_number":318,"context_line":"        metadata \u003d {project_id: None}"},{"line_number":319,"context_line":"        return self.nova.aggregates.set_metadata(agg.id, metadata)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F9%2BBE%3D","line":316,"in_reply_to":"AAAATn%2F%2BJqI%3D","updated":"2013-12-04 08:27:23.000000000","message":"Done","commit_id":"6222537479d2f2a6aba30b8a469d9818db23db9a"}],"climate/tests/test_reservation_pool.py":[{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"7836ef0d5ebee569dbc4260e3241e70d85c32366","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        self.p_aggregate \u003d self.patch(self.pool, \u0027get_aggregate_from_whatever\u0027)"},{"line_number":72,"context_line":"        self.p_aggregate.side_effect \u003d get_fake_aggregate"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def test_create(self):"},{"line_number":75,"context_line":"        self.nova.aggregates.create \u003d mock.MagicMock("},{"line_number":76,"context_line":"            return_value\u003dself.fake_aggregate"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F%2BUlY%3D","line":73,"updated":"2013-11-27 12:15:22.000000000","message":"I think you need to create tests for functions like _get_aggregate_from_name, \n_get_aggregate_from_id, get_aggregate_from_whatever. If you have some problems with patch them - feel free to ask me questions, or just read unit tests for manager at https://review.openstack.org/#/c/53896/","commit_id":"385fe00e64ff48e81553a372c6e1d2b2059cd551"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"6ebe139577dca8b5221e2ef3c10e53b90afa3ce2","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        self.p_aggregate \u003d self.patch(self.pool, \u0027get_aggregate_from_whatever\u0027)"},{"line_number":72,"context_line":"        self.p_aggregate.side_effect \u003d get_fake_aggregate"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def test_create(self):"},{"line_number":75,"context_line":"        self.nova.aggregates.create \u003d mock.MagicMock("},{"line_number":76,"context_line":"            return_value\u003dself.fake_aggregate"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F%2BT4M%3D","line":73,"in_reply_to":"AAAATn%2F%2BUlY%3D","updated":"2013-11-27 14:49:25.000000000","message":"Done","commit_id":"385fe00e64ff48e81553a372c6e1d2b2059cd551"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 Openstack Fondation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOSo%3D","line":1,"updated":"2013-11-28 17:59:27.000000000","message":"In this file there are a lot of .assert_called_once_with placed on next line to the beginning of the call. I think you may to choose the same indent for all of these calls (somewhere you have 2 tabs, somewhere 4, etc.). Also I think 1 tab is enough really for this case... All these test lines won\u0027t look better if you add more tabs :)","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        self.fake_aggregate \u003d AggregateFake(i\u003d123,"},{"line_number":43,"context_line":"                                            name\u003d\u0027fooname\u0027,"},{"line_number":44,"context_line":"                                            hosts\u003d[\u0027host1\u0027, \u0027host2\u0027]"},{"line_number":45,"context_line":"                                            )"},{"line_number":46,"context_line":"        self.freepool_name \u003d cfg.CONF[\u0027physical:host\u0027].aggregate_freepool_name"},{"line_number":47,"context_line":"        self.fake_freepool \u003d AggregateFake(i\u003d456,"},{"line_number":48,"context_line":"                                           name\u003dself.freepool_name,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOVg%3D","line":45,"updated":"2013-11-28 17:59:27.000000000","message":"As in previous file, or place comma after hosts param (in case there will be more args, you won\u0027t need to change two lines)","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        self.fake_freepool \u003d AggregateFake(i\u003d456,"},{"line_number":48,"context_line":"                                           name\u003dself.freepool_name,"},{"line_number":49,"context_line":"                                           hosts\u003d[\u0027host3\u0027]"},{"line_number":50,"context_line":"                                           )"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        self.set_context(context.ClimateContext(tenant_id\u003dself.tenant_id))"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOVc%3D","line":50,"updated":"2013-11-28 17:59:27.000000000","message":"the same","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def test_get_agg_from_id(self):"},{"line_number":77,"context_line":"        self.pool.get_aggregate_from_id(123)"},{"line_number":78,"context_line":"        self.nova.aggregates.get\\"},{"line_number":79,"context_line":"                 .assert_called_once_with(123)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        self.nova.aggregates.get.reset_mock()"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOS8%3D","line":78,"updated":"2013-11-28 17:59:27.000000000","message":"self.nova.aggregates.get.assert_called_once_with(?)","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        self.nova.aggregates.get.reset_mock()"},{"line_number":82,"context_line":"        self.pool.get_aggregate_from_id(\"456\")"},{"line_number":83,"context_line":"        self.nova.aggregates.get\\"},{"line_number":84,"context_line":"                 .assert_called_once_with(456)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        self.nova.aggregates.get.reset_mock()"},{"line_number":87,"context_line":"        self.pool.get_aggregate_from_id(self.fake_aggregate)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOS4%3D","line":84,"updated":"2013-11-28 17:59:27.000000000","message":"self.nova.aggregates.get.assert_called_once_with(?)","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        self.nova.aggregates.get.reset_mock()"},{"line_number":107,"context_line":"        self.pool.get_aggregate_from_name_or_id(123)"},{"line_number":108,"context_line":"        self.nova.aggregates.get\\"},{"line_number":109,"context_line":"                 .assert_called_once_with(123)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        self.nova.aggregates.get.reset_mock()"},{"line_number":112,"context_line":"        self.pool.get_aggregate_from_name_or_id(\"456\")"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOTE%3D","line":109,"updated":"2013-11-28 17:59:27.000000000","message":"self.nova.aggregates.get.assert_called_once_with(..) will look better","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        self.nova.aggregates.get.reset_mock()"},{"line_number":112,"context_line":"        self.pool.get_aggregate_from_name_or_id(\"456\")"},{"line_number":113,"context_line":"        self.nova.aggregates.get\\"},{"line_number":114,"context_line":"                 .assert_called_once_with(456)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        self.nova.aggregates.get.reset_mock()"},{"line_number":117,"context_line":"        self.pool.get_aggregate_from_name_or_id(self.fake_aggregate)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOTA%3D","line":114,"updated":"2013-11-28 17:59:27.000000000","message":"self.nova.aggregates.get.assert_called_once_with(?)","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        for h in self.fake_aggregate.hosts:"},{"line_number":226,"context_line":"            self.nova.aggregates.remove_host\\"},{"line_number":227,"context_line":"                                .assert_any_call(self.fake_aggregate.id,"},{"line_number":228,"context_line":"                                                 h)"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    def test_get_computehosts(self):"},{"line_number":231,"context_line":"        self._patch_get_agg_from_whatever()"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOUU%3D","line":228,"updated":"2013-11-28 17:59:27.000000000","message":"place on the line with first arg","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        self.nova.aggregates.set_metadata\\"},{"line_number":239,"context_line":"                 .assert_called_once_with(self.fake_aggregate.id,"},{"line_number":240,"context_line":"                                          {\u0027projectX\u0027: rp.TENANT_ID_KEY}"},{"line_number":241,"context_line":"                                          )"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    def test_remove_project(self):"},{"line_number":244,"context_line":"        self._patch_get_agg_from_whatever()"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOUc%3D","line":241,"updated":"2013-11-28 17:59:27.000000000","message":"the same","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"6e463a98307a671f475c01bef55833331283a4ad","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        self.nova.aggregates.set_metadata\\"},{"line_number":247,"context_line":"                 .assert_called_once_with(self.fake_aggregate.id,"},{"line_number":248,"context_line":"                                          {\u0027projectY\u0027: None}"},{"line_number":249,"context_line":"                                          )"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAATn%2F%2BOUg%3D","line":249,"updated":"2013-11-28 17:59:27.000000000","message":"the same","commit_id":"0e6d1931bacea900aaaf80df9dd9e6e15100c07e"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"ee2613cdb27eedc26c9694c35fb8cf53f43890a4","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        for host in agg.hosts:"},{"line_number":147,"context_line":"            self.nova.aggregates.remove_host.assert_any_call(agg.id, host)"},{"line_number":148,"context_line":"            self.nova.aggregates.add_host.assert_any_call("},{"line_number":149,"context_line":"                self.fake_freepool.name, host)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        # can\u0027t delete aggregate with hosts"},{"line_number":152,"context_line":"        self.assertRaises(rp.AggregateHaveHost,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAATn%2F%2BMwM%3D","line":149,"updated":"2013-11-29 09:46:56.000000000","message":"In case of having first arg on the next line after \u0027(\u0027 you need to move \u0027)\u0027 on the separated line too.","commit_id":"1fb7cd2a080a865a8698ea4aa4426c94a0ceadce"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"af677f912a6fa565fc0ab56777631c1b09e07187","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        for host in agg.hosts:"},{"line_number":147,"context_line":"            self.nova.aggregates.remove_host.assert_any_call(agg.id, host)"},{"line_number":148,"context_line":"            self.nova.aggregates.add_host.assert_any_call("},{"line_number":149,"context_line":"                self.fake_freepool.name, host)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        # can\u0027t delete aggregate with hosts"},{"line_number":152,"context_line":"        self.assertRaises(rp.AggregateHaveHost,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAATn%2F%2BMPM%3D","line":149,"in_reply_to":"AAAATn%2F%2BMwM%3D","updated":"2013-11-29 12:43:29.000000000","message":"Done","commit_id":"1fb7cd2a080a865a8698ea4aa4426c94a0ceadce"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"ee2613cdb27eedc26c9694c35fb8cf53f43890a4","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        self._patch_get_agg_from_whatever()"},{"line_number":169,"context_line":"        agg \u003d self.pool.get(\u0027foo\u0027)"},{"line_number":170,"context_line":"        self.assertEqual(self.fake_aggregate,"},{"line_number":171,"context_line":"                         agg)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def test_add_computehost(self):"},{"line_number":174,"context_line":"        self._patch_get_agg_from_whatever()"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAATn%2F%2BMwA%3D","line":171,"updated":"2013-11-29 09:46:56.000000000","message":"move on the previous line, please","commit_id":"1fb7cd2a080a865a8698ea4aa4426c94a0ceadce"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"af677f912a6fa565fc0ab56777631c1b09e07187","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        self._patch_get_agg_from_whatever()"},{"line_number":169,"context_line":"        agg \u003d self.pool.get(\u0027foo\u0027)"},{"line_number":170,"context_line":"        self.assertEqual(self.fake_aggregate,"},{"line_number":171,"context_line":"                         agg)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def test_add_computehost(self):"},{"line_number":174,"context_line":"        self._patch_get_agg_from_whatever()"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAATn%2F%2BMPw%3D","line":171,"in_reply_to":"AAAATn%2F%2BMwA%3D","updated":"2013-11-29 12:43:29.000000000","message":"Done","commit_id":"1fb7cd2a080a865a8698ea4aa4426c94a0ceadce"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"84128aa25cd6a5c9ee00e658dec5e6de4e97f4dd","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        self.nova \u003d mock.MagicMock()"},{"line_number":58,"context_line":"        mock.patch(\u0027novaclient.client.Client\u0027,"},{"line_number":59,"context_line":"                   return_value\u003dself.nova).start()"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        self.nova.aggregates.set_metadata \u003d mock.MagicMock()"},{"line_number":62,"context_line":"        self.nova.aggregates.remove_host \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAATn%2F9w%2Bc%3D","line":59,"updated":"2013-12-06 07:59:28.000000000","message":"no need to do it like this. do it simplier:\n\nself.nova \u003d self.patch(novaclient.client, \u0027Client\u0027)\n\nand you\u0027ll get an object with MagicMock type.","commit_id":"7e65cf14955ffcd909ad732974f047e3efdbb6bd"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8fd8e41ca8f7bae29c79c00052a41430c4a2f698","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        self.nova \u003d mock.MagicMock()"},{"line_number":58,"context_line":"        mock.patch(\u0027novaclient.client.Client\u0027,"},{"line_number":59,"context_line":"                   return_value\u003dself.nova).start()"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        self.nova.aggregates.set_metadata \u003d mock.MagicMock()"},{"line_number":62,"context_line":"        self.nova.aggregates.remove_host \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAATn%2F9vH8%3D","line":59,"in_reply_to":"AAAATn%2F9w%2Bc%3D","updated":"2013-12-06 15:16:32.000000000","message":"Done","commit_id":"7e65cf14955ffcd909ad732974f047e3efdbb6bd"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"84128aa25cd6a5c9ee00e658dec5e6de4e97f4dd","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        self.patch(self.pool, \u0027get_aggregate_from_name_or_id\u0027)\\"},{"line_number":77,"context_line":"            .side_effect \u003d get_fake_aggregate"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def test_get_agg_from_whatever(self):"},{"line_number":80,"context_line":"        def fake_aggregate_get(id):"},{"line_number":81,"context_line":"            if id \u003d\u003d self.fake_aggregate.id:"},{"line_number":82,"context_line":"                return self.fake_aggregate"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAATn%2F9w%2BQ%3D","line":79,"updated":"2013-12-06 07:59:28.000000000","message":"please rename method close to the code","commit_id":"7e65cf14955ffcd909ad732974f047e3efdbb6bd"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8fd8e41ca8f7bae29c79c00052a41430c4a2f698","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        self.patch(self.pool, \u0027get_aggregate_from_name_or_id\u0027)\\"},{"line_number":77,"context_line":"            .side_effect \u003d get_fake_aggregate"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def test_get_agg_from_whatever(self):"},{"line_number":80,"context_line":"        def fake_aggregate_get(id):"},{"line_number":81,"context_line":"            if id \u003d\u003d self.fake_aggregate.id:"},{"line_number":82,"context_line":"                return self.fake_aggregate"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAATn%2F9vgU%3D","line":79,"in_reply_to":"AAAATn%2F9w%2BQ%3D","updated":"2013-12-06 15:16:32.000000000","message":"Done","commit_id":"7e65cf14955ffcd909ad732974f047e3efdbb6bd"},{"author":{"_account_id":7535,"name":"Nikolay Starodubtsev","email":"starodubcevna@gmail.com","username":"Kezar"},"change_message_id":"84128aa25cd6a5c9ee00e658dec5e6de4e97f4dd","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                          self.freepool_name,"},{"line_number":226,"context_line":"                          \u0027hostXX\u0027)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def test_remove_allcomputehosts(self):"},{"line_number":229,"context_line":"        self._patch_get_agg_from_whatever()"},{"line_number":230,"context_line":"        self.pool.remove_all_computehosts(\u0027pool\u0027)"},{"line_number":231,"context_line":"        for host in self.fake_aggregate.hosts:"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAATn%2F9w8g%3D","line":228,"updated":"2013-12-06 07:59:28.000000000","message":"test_remove_all_computehosts - will be better, as for me.","commit_id":"7e65cf14955ffcd909ad732974f047e3efdbb6bd"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8fd8e41ca8f7bae29c79c00052a41430c4a2f698","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                          self.freepool_name,"},{"line_number":226,"context_line":"                          \u0027hostXX\u0027)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def test_remove_allcomputehosts(self):"},{"line_number":229,"context_line":"        self._patch_get_agg_from_whatever()"},{"line_number":230,"context_line":"        self.pool.remove_all_computehosts(\u0027pool\u0027)"},{"line_number":231,"context_line":"        for host in self.fake_aggregate.hosts:"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAATn%2F9vgI%3D","line":228,"in_reply_to":"AAAATn%2F9w8g%3D","updated":"2013-12-06 15:16:32.000000000","message":"Done","commit_id":"7e65cf14955ffcd909ad732974f047e3efdbb6bd"}],"climate/utils/reservation_pool.py":[{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"28b50666e91ca5998731e332aa1ec5809bc8997a","unresolved":false,"context_lines":[{"line_number":16,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":17,"context_line":"# under the License."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from climate import context"},{"line_number":20,"context_line":"from climate.openstack.common import log as logging"},{"line_number":21,"context_line":"from oslo.config import cfg"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B8YQ%3D","line":19,"updated":"2013-11-18 09:55:24.000000000","message":"Please set imports in the hacking friendly order.","commit_id":"f213649ec15a19e00620c8e4c7aedb4903d96eb4"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"28b50666e91ca5998731e332aa1ec5809bc8997a","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            if name \u003d\u003d agg.name:"},{"line_number":82,"context_line":"                return agg"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _get_aggregate_from_id(self, id):"},{"line_number":85,"context_line":"        \"\"\"id can be an aggregate or an id.\"\"\""},{"line_number":86,"context_line":"        try:"},{"line_number":87,"context_line":"            i \u003d int(id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B8Z4%3D","line":84,"updated":"2013-11-18 09:55:24.000000000","message":"Let\u0027s use aggregate_id or something not to use built-in names.","commit_id":"f213649ec15a19e00620c8e4c7aedb4903d96eb4"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"f25fa4dde5a3ba2ef4eba052b5b641d8006c1c45","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        try:"},{"line_number":87,"context_line":"            i \u003d int(id)"},{"line_number":88,"context_line":"            return self.nova.aggregates.get(i)"},{"line_number":89,"context_line":"        except Exception, e:"},{"line_number":90,"context_line":"            if hasattr(id, \u0027id\u0027):"},{"line_number":91,"context_line":"                # pool is an aggregate"},{"line_number":92,"context_line":"                return self.nova.aggregates.get(id.id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B7jg%3D","line":89,"updated":"2013-11-18 13:20:34.000000000","message":"Not Python3.3 friendly. Please change to \u0027except Exception as e\u0027","commit_id":"f213649ec15a19e00620c8e4c7aedb4903d96eb4"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"28b50666e91ca5998731e332aa1ec5809bc8997a","unresolved":false,"context_lines":[{"line_number":103,"context_line":"    def _get_aggregate_name(self):"},{"line_number":104,"context_line":"        return str(uuidgen.uuid4())"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def create(self, name\u003dNone, az\u003dTrue):"},{"line_number":107,"context_line":"        \"\"\"Create a Pool (an Aggregate).\"\"\""},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        name \u003d self._get_aggregate_name()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B8as%3D","line":106,"updated":"2013-11-18 09:55:24.000000000","message":"You use _get_aggregate_name function to get name. No use to pass it to this method.","commit_id":"f213649ec15a19e00620c8e4c7aedb4903d96eb4"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"f25fa4dde5a3ba2ef4eba052b5b641d8006c1c45","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            setmeta \u003d self.nova.aggregates.set_metadata"},{"line_number":119,"context_line":"            setmeta(a, {CLIMATE_OWNER: self.ctx.tenant_id})"},{"line_number":120,"context_line":"            return a"},{"line_number":121,"context_line":"        except Exception, e:"},{"line_number":122,"context_line":"            raise e"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def delete(self, pool, force\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B7jY%3D","line":121,"updated":"2013-11-18 13:20:34.000000000","message":"Not Python3.3 friendly. Please change to \u0027except Exception as e\u0027","commit_id":"f213649ec15a19e00620c8e4c7aedb4903d96eb4"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"f25fa4dde5a3ba2ef4eba052b5b641d8006c1c45","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        try:"},{"line_number":155,"context_line":"            self.nova.aggregates.delete(agg.id)"},{"line_number":156,"context_line":"        except Exception, e:"},{"line_number":157,"context_line":"            LOG.error(e)"},{"line_number":158,"context_line":"            raise e"},{"line_number":159,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B7jU%3D","line":156,"updated":"2013-11-18 13:20:34.000000000","message":"Not Python3.3 friendly. Please change to \u0027except Exception as e\u0027","commit_id":"f213649ec15a19e00620c8e4c7aedb4903d96eb4"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"f25fa4dde5a3ba2ef4eba052b5b641d8006c1c45","unresolved":false,"context_lines":[{"line_number":211,"context_line":"            self.remove_computehost(free_pool_agg.id, host)"},{"line_number":212,"context_line":"            LOG.info(\"adding host \u0027%s\u0027 to aggregate %s\" % (host, agg.id))"},{"line_number":213,"context_line":"            return self.nova.aggregates.add_host(agg.id, host)"},{"line_number":214,"context_line":"        except CantRemoveHost, e:"},{"line_number":215,"context_line":"            LOG.error(\"Can\u0027t remove host %s from free_pool %s\" % (host,"},{"line_number":216,"context_line":"                                                                  agg.name))"},{"line_number":217,"context_line":"            LOG.error(e)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B7jQ%3D","line":214,"updated":"2013-11-18 13:20:34.000000000","message":"The same here.","commit_id":"f213649ec15a19e00620c8e4c7aedb4903d96eb4"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"f25fa4dde5a3ba2ef4eba052b5b641d8006c1c45","unresolved":false,"context_lines":[{"line_number":215,"context_line":"            LOG.error(\"Can\u0027t remove host %s from free_pool %s\" % (host,"},{"line_number":216,"context_line":"                                                                  agg.name))"},{"line_number":217,"context_line":"            LOG.error(e)"},{"line_number":218,"context_line":"        except Exception, e:"},{"line_number":219,"context_line":"            raise e"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def remove_all_computehost(self, pool):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B7jM%3D","line":218,"updated":"2013-11-18 13:20:34.000000000","message":"The same here.","commit_id":"f213649ec15a19e00620c8e4c7aedb4903d96eb4"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"28b50666e91ca5998731e332aa1ec5809bc8997a","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        hosts \u003d self.get_computehosts(pool)"},{"line_number":225,"context_line":"        self.remove_computehost(pool, hosts)"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"    def remove_computehost(self, pool, hosts\u003d[]):"},{"line_number":228,"context_line":"        \"\"\"Remove compute host(s) from an aggregate.\"\"\""},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        if not isinstance(hosts, list):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B8aI%3D","line":227,"updated":"2013-11-18 09:55:24.000000000","message":"Let\u0027s avoid mutable default arguments values if there is no need in this hack.","commit_id":"f213649ec15a19e00620c8e4c7aedb4903d96eb4"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"f25fa4dde5a3ba2ef4eba052b5b641d8006c1c45","unresolved":false,"context_lines":[{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                self.nova.aggregates.remove_host(agg.id, h)"},{"line_number":248,"context_line":"                self.nova.aggregates.add_host(free_pool_agg.id, h)"},{"line_number":249,"context_line":"            except Exception, e:"},{"line_number":250,"context_line":"                raise CantRemoveHost(e)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def add_project(self, pool, project_id):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B7jI%3D","line":249,"updated":"2013-11-18 13:20:34.000000000","message":"The same here.","commit_id":"f213649ec15a19e00620c8e4c7aedb4903d96eb4"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"db6899d27b249051f6c3a003ae23ab25cac2b6ce","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- encoding: utf-8 -*-"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright © 2013 OpenStack Foundation"},{"line_number":4,"context_line":"#"},{"line_number":5,"context_line":"# Author: Swann Croiset \u003cswann.croiset@bull.net\u003e"},{"line_number":6,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2Bs1o%3D","line":3,"updated":"2013-11-21 11:26:55.000000000","message":"I think we may want to have all these copyrights in one style like (c), not utf-8 symbol. In this case we may remove encoding line in the comments.","commit_id":"01bcd25c8aacef72bead91f09c16e644e6f801ce"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"bae271448829d5a72abd9ea410b4a17ea13570df","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- encoding: utf-8 -*-"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Copyright © 2013 OpenStack Foundation"},{"line_number":4,"context_line":"#"},{"line_number":5,"context_line":"# Author: Swann Croiset \u003cswann.croiset@bull.net\u003e"},{"line_number":6,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2BoeE%3D","line":3,"in_reply_to":"AAAATn%2F%2Bs1o%3D","updated":"2013-11-22 08:13:38.000000000","message":"I like utf8 :)\nbut ok I\u0027ll remove it","commit_id":"01bcd25c8aacef72bead91f09c16e644e6f801ce"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"db6899d27b249051f6c3a003ae23ab25cac2b6ce","unresolved":false,"context_lines":[{"line_number":61,"context_line":"class AggregateWrapper(object):"},{"line_number":62,"context_line":"    def __init__(self):"},{"line_number":63,"context_line":"        self.ctx \u003d context.Context.current()"},{"line_number":64,"context_line":"        #TODO(scroiset): use catalog to find the url"},{"line_number":65,"context_line":"        auth_url \u003d \"%s://%s:%s/v2.0\" % (cfg.CONF.os_auth_protocol,"},{"line_number":66,"context_line":"                                        cfg.CONF.os_auth_host,"},{"line_number":67,"context_line":"                                        cfg.CONF.os_auth_port"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2Bs1E%3D","line":64,"updated":"2013-11-21 11:26:55.000000000","message":"I think you may rebase from https://review.openstack.org/#/c/52296/ and use url_for method from utils.base module","commit_id":"01bcd25c8aacef72bead91f09c16e644e6f801ce"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"bae271448829d5a72abd9ea410b4a17ea13570df","unresolved":false,"context_lines":[{"line_number":61,"context_line":"class AggregateWrapper(object):"},{"line_number":62,"context_line":"    def __init__(self):"},{"line_number":63,"context_line":"        self.ctx \u003d context.Context.current()"},{"line_number":64,"context_line":"        #TODO(scroiset): use catalog to find the url"},{"line_number":65,"context_line":"        auth_url \u003d \"%s://%s:%s/v2.0\" % (cfg.CONF.os_auth_protocol,"},{"line_number":66,"context_line":"                                        cfg.CONF.os_auth_host,"},{"line_number":67,"context_line":"                                        cfg.CONF.os_auth_port"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2Bodg%3D","line":64,"in_reply_to":"AAAATn%2F%2Bs1E%3D","updated":"2013-11-22 08:13:38.000000000","message":"Yeah, but for now I\u0027ll prefer to address this in a next patch.","commit_id":"01bcd25c8aacef72bead91f09c16e644e6f801ce"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"opts \u003d ["},{"line_number":30,"context_line":"    cfg.StrOpt(\u0027aggregate_free_pool_name\u0027,"},{"line_number":31,"context_line":"               default\u003d\u0027free_pool\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Name of the special aggregate where all hosts \u0027"},{"line_number":33,"context_line":"                    \u0027are candidate for physical host reservation\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Bexc%3D","line":30,"updated":"2013-11-26 09:57:59.000000000","message":"freepool, not free_pool","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"opts \u003d ["},{"line_number":30,"context_line":"    cfg.StrOpt(\u0027aggregate_free_pool_name\u0027,"},{"line_number":31,"context_line":"               default\u003d\u0027free_pool\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Name of the special aggregate where all hosts \u0027"},{"line_number":33,"context_line":"                    \u0027are candidate for physical host reservation\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Ba3U%3D","line":30,"in_reply_to":"AAAATn%2F%2Bexc%3D","updated":"2013-11-26 12:04:23.000000000","message":"Done","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"opts \u003d ["},{"line_number":30,"context_line":"    cfg.StrOpt(\u0027aggregate_free_pool_name\u0027,"},{"line_number":31,"context_line":"               default\u003d\u0027free_pool\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Name of the special aggregate where all hosts \u0027"},{"line_number":33,"context_line":"                    \u0027are candidate for physical host reservation\u0027)"},{"line_number":34,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BexM%3D","line":31,"updated":"2013-11-26 09:57:59.000000000","message":"idem","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"opts \u003d ["},{"line_number":30,"context_line":"    cfg.StrOpt(\u0027aggregate_free_pool_name\u0027,"},{"line_number":31,"context_line":"               default\u003d\u0027free_pool\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Name of the special aggregate where all hosts \u0027"},{"line_number":33,"context_line":"                    \u0027are candidate for physical host reservation\u0027)"},{"line_number":34,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Ba3Q%3D","line":31,"in_reply_to":"AAAATn%2F%2BexM%3D","updated":"2013-11-26 12:04:23.000000000","message":"Done","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class NoFreePool(Exception):"},{"line_number":44,"context_line":"    pass"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"class HostNotInFreePool(Exception):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Bevo%3D","line":44,"updated":"2013-11-26 09:57:59.000000000","message":"-1, please use exceptions.py instead","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class NoFreePool(Exception):"},{"line_number":44,"context_line":"    pass"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"class HostNotInFreePool(Exception):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BazQ%3D","line":44,"in_reply_to":"AAAATn%2F%2Bevo%3D","updated":"2013-11-26 12:04:23.000000000","message":"The exception is here, so declare it here.","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    pass"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"class AggregateWrapper(object):"},{"line_number":60,"context_line":"    def __init__(self):"},{"line_number":61,"context_line":"        self.ctx \u003d context.Context.current()"},{"line_number":62,"context_line":"        #TODO(scroiset): use catalog to find the url"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbQ0%3D","line":59,"updated":"2013-11-26 09:57:59.000000000","message":"I would prefer ReservationPool","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    pass"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"class AggregateWrapper(object):"},{"line_number":60,"context_line":"    def __init__(self):"},{"line_number":61,"context_line":"        self.ctx \u003d context.Context.current()"},{"line_number":62,"context_line":"        #TODO(scroiset): use catalog to find the url"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Bays%3D","line":59,"in_reply_to":"AAAATn%2F%2BbQ0%3D","updated":"2013-11-26 12:04:23.000000000","message":"Done","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    def __init__(self):"},{"line_number":61,"context_line":"        self.ctx \u003d context.Context.current()"},{"line_number":62,"context_line":"        #TODO(scroiset): use catalog to find the url"},{"line_number":63,"context_line":"        auth_url \u003d \"%s://%s:%s/v2.0\" % (cfg.CONF.os_auth_protocol,"},{"line_number":64,"context_line":"                                        cfg.CONF.os_auth_host,"},{"line_number":65,"context_line":"                                        cfg.CONF.os_auth_port"},{"line_number":66,"context_line":"                                        )"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbPs%3D","line":63,"updated":"2013-11-26 09:57:59.000000000","message":"Let\u0027s discuss about version discovery. We can leave with it for a first release, but ideally we should autodetect which version to hit. Keystone guys and others have same concern.","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    def __init__(self):"},{"line_number":61,"context_line":"        self.ctx \u003d context.Context.current()"},{"line_number":62,"context_line":"        #TODO(scroiset): use catalog to find the url"},{"line_number":63,"context_line":"        auth_url \u003d \"%s://%s:%s/v2.0\" % (cfg.CONF.os_auth_protocol,"},{"line_number":64,"context_line":"                                        cfg.CONF.os_auth_host,"},{"line_number":65,"context_line":"                                        cfg.CONF.os_auth_port"},{"line_number":66,"context_line":"                                        )"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BayM%3D","line":63,"in_reply_to":"AAAATn%2F%2BbPs%3D","updated":"2013-11-26 12:04:23.000000000","message":"yes let it as is, We\u0027ll adress this in a future patch.\n\nAs agreed with Dina in a previous patchset","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        auth_url \u003d \"%s://%s:%s/v2.0\" % (cfg.CONF.os_auth_protocol,"},{"line_number":64,"context_line":"                                        cfg.CONF.os_auth_host,"},{"line_number":65,"context_line":"                                        cfg.CONF.os_auth_port"},{"line_number":66,"context_line":"                                        )"},{"line_number":67,"context_line":"        self.nova \u003d client.Client(\u00272\u0027,"},{"line_number":68,"context_line":"                                  username\u003dcfg.CONF.os_admin_username,"},{"line_number":69,"context_line":"                                  api_key\u003dcfg.CONF.os_admin_password,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbPY%3D","line":66,"updated":"2013-11-26 09:57:59.000000000","message":"please handle \"except KeyError\" here if the conflags are omitted","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        auth_url \u003d \"%s://%s:%s/v2.0\" % (cfg.CONF.os_auth_protocol,"},{"line_number":64,"context_line":"                                        cfg.CONF.os_auth_host,"},{"line_number":65,"context_line":"                                        cfg.CONF.os_auth_port"},{"line_number":66,"context_line":"                                        )"},{"line_number":67,"context_line":"        self.nova \u003d client.Client(\u00272\u0027,"},{"line_number":68,"context_line":"                                  username\u003dcfg.CONF.os_admin_username,"},{"line_number":69,"context_line":"                                  api_key\u003dcfg.CONF.os_admin_password,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Bax0%3D","line":66,"in_reply_to":"AAAATn%2F%2BbPY%3D","updated":"2013-11-26 12:04:23.000000000","message":"no need since all these config have a default value.","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                                        cfg.CONF.os_auth_host,"},{"line_number":65,"context_line":"                                        cfg.CONF.os_auth_port"},{"line_number":66,"context_line":"                                        )"},{"line_number":67,"context_line":"        self.nova \u003d client.Client(\u00272\u0027,"},{"line_number":68,"context_line":"                                  username\u003dcfg.CONF.os_admin_username,"},{"line_number":69,"context_line":"                                  api_key\u003dcfg.CONF.os_admin_password,"},{"line_number":70,"context_line":"                                  auth_url\u003dauth_url,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbQY%3D","line":67,"updated":"2013-11-26 09:57:59.000000000","message":"put an explicit key\u003d\u00272\u0027","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                                        cfg.CONF.os_auth_host,"},{"line_number":65,"context_line":"                                        cfg.CONF.os_auth_port"},{"line_number":66,"context_line":"                                        )"},{"line_number":67,"context_line":"        self.nova \u003d client.Client(\u00272\u0027,"},{"line_number":68,"context_line":"                                  username\u003dcfg.CONF.os_admin_username,"},{"line_number":69,"context_line":"                                  api_key\u003dcfg.CONF.os_admin_password,"},{"line_number":70,"context_line":"                                  auth_url\u003dauth_url,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Baxo%3D","line":67,"in_reply_to":"AAAATn%2F%2BbQY%3D","updated":"2013-11-26 12:04:23.000000000","message":"what do you mean ?","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                                  api_key\u003dcfg.CONF.os_admin_password,"},{"line_number":70,"context_line":"                                  auth_url\u003dauth_url,"},{"line_number":71,"context_line":"                                  project_id\u003dcfg.CONF.os_admin_tenant_name"},{"line_number":72,"context_line":"                                  )"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def _get_aggregate_from_name(self, name):"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbOo%3D","line":72,"updated":"2013-11-26 09:57:59.000000000","message":"same remark as L67, we need to handle CONF.values which can be None","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                                  api_key\u003dcfg.CONF.os_admin_password,"},{"line_number":70,"context_line":"                                  auth_url\u003dauth_url,"},{"line_number":71,"context_line":"                                  project_id\u003dcfg.CONF.os_admin_tenant_name"},{"line_number":72,"context_line":"                                  )"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def _get_aggregate_from_name(self, name):"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Baxc%3D","line":72,"in_reply_to":"AAAATn%2F%2BbOo%3D","updated":"2013-11-26 12:04:23.000000000","message":"same answer","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        for agg in all_aggregates:"},{"line_number":80,"context_line":"            if name \u003d\u003d agg.name:"},{"line_number":81,"context_line":"                return agg"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _get_aggregate_from_id(self, aggregate_or_id):"},{"line_number":84,"context_line":"        \"\"\"id can be an aggregate or an id.\"\"\""},{"line_number":85,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbMs%3D","line":82,"updated":"2013-11-26 09:57:59.000000000","message":"please use \"for agg in ...: else: return None\"","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        for agg in all_aggregates:"},{"line_number":80,"context_line":"            if name \u003d\u003d agg.name:"},{"line_number":81,"context_line":"                return agg"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _get_aggregate_from_id(self, aggregate_or_id):"},{"line_number":84,"context_line":"        \"\"\"id can be an aggregate or an id.\"\"\""},{"line_number":85,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Baus%3D","line":82,"in_reply_to":"AAAATn%2F%2BbMs%3D","updated":"2013-11-26 12:04:23.000000000","message":"Done","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        try:"},{"line_number":86,"context_line":"            i \u003d int(aggregate_or_id)"},{"line_number":87,"context_line":"            return self.nova.aggregates.get(i)"},{"line_number":88,"context_line":"        except Exception as e:"},{"line_number":89,"context_line":"            if hasattr(aggregate_or_id, \u0027id\u0027):"},{"line_number":90,"context_line":"                # pool is an aggregate"},{"line_number":91,"context_line":"                return self.nova.aggregates.get(aggregate_or_id.id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbLU%3D","line":88,"updated":"2013-11-26 09:57:59.000000000","message":"Be careful, KeyBoardError is also an exception, please define which Exception you want to prevent explicitely","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        try:"},{"line_number":86,"context_line":"            i \u003d int(aggregate_or_id)"},{"line_number":87,"context_line":"            return self.nova.aggregates.get(i)"},{"line_number":88,"context_line":"        except Exception as e:"},{"line_number":89,"context_line":"            if hasattr(aggregate_or_id, \u0027id\u0027):"},{"line_number":90,"context_line":"                # pool is an aggregate"},{"line_number":91,"context_line":"                return self.nova.aggregates.get(aggregate_or_id.id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BauM%3D","line":88,"in_reply_to":"AAAATn%2F%2BbLU%3D","updated":"2013-11-26 12:04:23.000000000","message":"Done","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            i \u003d int(aggregate_or_id)"},{"line_number":87,"context_line":"            return self.nova.aggregates.get(i)"},{"line_number":88,"context_line":"        except Exception as e:"},{"line_number":89,"context_line":"            if hasattr(aggregate_or_id, \u0027id\u0027):"},{"line_number":90,"context_line":"                # pool is an aggregate"},{"line_number":91,"context_line":"                return self.nova.aggregates.get(aggregate_or_id.id)"},{"line_number":92,"context_line":"            raise e"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbLE%3D","line":89,"updated":"2013-11-26 09:57:59.000000000","message":"I would prefer use of type(Aggregate) instead of if hasattr()","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            i \u003d int(aggregate_or_id)"},{"line_number":87,"context_line":"            return self.nova.aggregates.get(i)"},{"line_number":88,"context_line":"        except Exception as e:"},{"line_number":89,"context_line":"            if hasattr(aggregate_or_id, \u0027id\u0027):"},{"line_number":90,"context_line":"                # pool is an aggregate"},{"line_number":91,"context_line":"                return self.nova.aggregates.get(aggregate_or_id.id)"},{"line_number":92,"context_line":"            raise e"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Bass%3D","line":89,"in_reply_to":"AAAATn%2F%2BbLE%3D","updated":"2013-11-26 12:04:23.000000000","message":"I\u0027m fine with hasattr() ..\nto avoid importing novaclient.v1_1.aggregates.Aggregate","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            if hasattr(aggregate_or_id, \u0027id\u0027):"},{"line_number":90,"context_line":"                # pool is an aggregate"},{"line_number":91,"context_line":"                return self.nova.aggregates.get(aggregate_or_id.id)"},{"line_number":92,"context_line":"            raise e"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def get_aggregate_from_whatever(self, whatever):"},{"line_number":95,"context_line":"        \"\"\"Return an aggregate by name or an id.\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbK4%3D","line":92,"updated":"2013-11-26 09:57:59.000000000","message":"maybe all the things above could be handled using getattr(aggregate_or_id, \u0027id\u0027, aggregate_or_id) ?\n\nWhat will you also raise?","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            if hasattr(aggregate_or_id, \u0027id\u0027):"},{"line_number":90,"context_line":"                # pool is an aggregate"},{"line_number":91,"context_line":"                return self.nova.aggregates.get(aggregate_or_id.id)"},{"line_number":92,"context_line":"            raise e"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def get_aggregate_from_whatever(self, whatever):"},{"line_number":95,"context_line":"        \"\"\"Return an aggregate by name or an id.\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Baqs%3D","line":92,"in_reply_to":"AAAATn%2F%2BbK4%3D","updated":"2013-11-26 12:04:23.000000000","message":"no more re-raise, just return None","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            return a"},{"line_number":100,"context_line":"        return self._get_aggregate_from_name(whatever)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _get_aggregate_name(self):"},{"line_number":103,"context_line":"        return str(uuidgen.uuid4())"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def create(self, az\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbJ4%3D","line":102,"updated":"2013-11-26 09:57:59.000000000","message":"please rename to generate_aggregate_name or check if there is a name (self.name) and only if not, generate it","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            return a"},{"line_number":100,"context_line":"        return self._get_aggregate_from_name(whatever)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _get_aggregate_name(self):"},{"line_number":103,"context_line":"        return str(uuidgen.uuid4())"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def create(self, az\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Bao8%3D","line":102,"in_reply_to":"AAAATn%2F%2BbJ4%3D","updated":"2013-11-26 12:04:23.000000000","message":"Ok, I rename it, but it\u0027s still a private method.","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return self._get_aggregate_from_name(whatever)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _get_aggregate_name(self):"},{"line_number":103,"context_line":"        return str(uuidgen.uuid4())"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def create(self, az\u003dTrue):"},{"line_number":106,"context_line":"        \"\"\"Create a Pool (an Aggregate).\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbKI%3D","line":103,"updated":"2013-11-26 09:57:59.000000000","message":"please use unicode(uuidutils.generate_uuid()) instead","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return self._get_aggregate_from_name(whatever)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _get_aggregate_name(self):"},{"line_number":103,"context_line":"        return str(uuidgen.uuid4())"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def create(self, az\u003dTrue):"},{"line_number":106,"context_line":"        \"\"\"Create a Pool (an Aggregate).\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Bapw%3D","line":103,"in_reply_to":"AAAATn%2F%2BbKI%3D","updated":"2013-11-26 12:04:23.000000000","message":"no more use uuidutils as ML threads","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":102,"context_line":"    def _get_aggregate_name(self):"},{"line_number":103,"context_line":"        return str(uuidgen.uuid4())"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def create(self, az\u003dTrue):"},{"line_number":106,"context_line":"        \"\"\"Create a Pool (an Aggregate).\"\"\""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        name \u003d self._get_aggregate_name()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbJY%3D","line":105,"updated":"2013-11-26 09:57:59.000000000","message":"create(self, az\u003dNone) instead","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":102,"context_line":"    def _get_aggregate_name(self):"},{"line_number":103,"context_line":"        return str(uuidgen.uuid4())"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def create(self, az\u003dTrue):"},{"line_number":106,"context_line":"        \"\"\"Create a Pool (an Aggregate).\"\"\""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        name \u003d self._get_aggregate_name()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Baqg%3D","line":105,"in_reply_to":"AAAATn%2F%2BbJY%3D","updated":"2013-11-26 12:04:23.000000000","message":"why ?\nsee my change","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        if az:"},{"line_number":111,"context_line":"            az \u003d \"%s%s\" % (CLIMATE_AZ_PREFIX, name)"},{"line_number":112,"context_line":"        else:"},{"line_number":113,"context_line":"            az \u003d None"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        LOG.debug(\u0027Creating pool aggregate: %s with AZ %s\u0027 % (name, az))"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbJU%3D","line":112,"updated":"2013-11-26 09:57:59.000000000","message":"not needed if az\u003dNone when set","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            return"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        hosts \u003d agg.hosts"},{"line_number":139,"context_line":"        if len(hosts) \u003e 0 and not force:"},{"line_number":140,"context_line":"            raise AggregateHaveHost(\"Can\u0027t delete \""},{"line_number":141,"context_line":"                                    \"Aggregate \u0027%s\u0027, \""},{"line_number":142,"context_line":"                                    \"host(s) attached \""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbCI%3D","line":139,"updated":"2013-11-26 09:57:59.000000000","message":"\"if hosts and not force\" instead","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            return"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        hosts \u003d agg.hosts"},{"line_number":139,"context_line":"        if len(hosts) \u003e 0 and not force:"},{"line_number":140,"context_line":"            raise AggregateHaveHost(\"Can\u0027t delete \""},{"line_number":141,"context_line":"                                    \"Aggregate \u0027%s\u0027, \""},{"line_number":142,"context_line":"                                    \"host(s) attached \""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Bamw%3D","line":139,"in_reply_to":"AAAATn%2F%2BbCI%3D","updated":"2013-11-26 12:04:23.000000000","message":"IMHO it\u0027s more readable with len() here","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        hosts \u003d agg.hosts"},{"line_number":139,"context_line":"        if len(hosts) \u003e 0 and not force:"},{"line_number":140,"context_line":"            raise AggregateHaveHost(\"Can\u0027t delete \""},{"line_number":141,"context_line":"                                    \"Aggregate \u0027%s\u0027, \""},{"line_number":142,"context_line":"                                    \"host(s) attached \""},{"line_number":143,"context_line":"                                    \"to it ; %s\" % (pool,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbCA%3D","line":140,"updated":"2013-11-26 09:57:59.000000000","message":"see how we deal exceptions using vars","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        try:"},{"line_number":153,"context_line":"            self.nova.aggregates.delete(agg.id)"},{"line_number":154,"context_line":"        except Exception as e:"},{"line_number":155,"context_line":"            LOG.error(e)"},{"line_number":156,"context_line":"            raise e"},{"line_number":157,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbBs%3D","line":154,"updated":"2013-11-26 09:57:59.000000000","message":"same remark","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        try:"},{"line_number":153,"context_line":"            self.nova.aggregates.delete(agg.id)"},{"line_number":154,"context_line":"        except Exception as e:"},{"line_number":155,"context_line":"            LOG.error(e)"},{"line_number":156,"context_line":"            raise e"},{"line_number":157,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BadE%3D","line":154,"in_reply_to":"AAAATn%2F%2BbBs%3D","updated":"2013-11-26 12:04:23.000000000","message":"I let raising nova exception","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        agg \u003d self.get_aggregate_from_whatever(pool)"},{"line_number":167,"context_line":"        if agg is None:"},{"line_number":168,"context_line":"            return None"},{"line_number":169,"context_line":"        return agg"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def get_computehosts(self, pool):"},{"line_number":172,"context_line":"        \"\"\"Return a list of compute host names for an aggregate.\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbBg%3D","line":169,"updated":"2013-11-26 09:57:59.000000000","message":"not needed, return agg is sufficient","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        agg \u003d self.get_aggregate_from_whatever(pool)"},{"line_number":167,"context_line":"        if agg is None:"},{"line_number":168,"context_line":"            return None"},{"line_number":169,"context_line":"        return agg"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def get_computehosts(self, pool):"},{"line_number":172,"context_line":"        \"\"\"Return a list of compute host names for an aggregate.\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Bagw%3D","line":169,"in_reply_to":"AAAATn%2F%2BbBg%3D","updated":"2013-11-26 12:04:23.000000000","message":"Done","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        if agg:"},{"line_number":177,"context_line":"            return agg.hosts"},{"line_number":178,"context_line":"        return []"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"    def add_computehost(self, pool, host):"},{"line_number":181,"context_line":"        \"\"\"Add a compute host to an aggregate"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BbAY%3D","line":178,"updated":"2013-11-26 09:57:59.000000000","message":"return agg.hosts or [] (to be tested)","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        if agg:"},{"line_number":177,"context_line":"            return agg.hosts"},{"line_number":178,"context_line":"        return []"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"    def add_computehost(self, pool, host):"},{"line_number":181,"context_line":"        \"\"\"Add a compute host to an aggregate"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Bac8%3D","line":178,"in_reply_to":"AAAATn%2F%2BbAY%3D","updated":"2013-11-26 12:04:23.000000000","message":"No, agg can be None","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        Return the related aggregate."},{"line_number":185,"context_line":"        Raise an aggregate exception if something wrong."},{"line_number":186,"context_line":"        \"\"\""},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        agg \u003d self.get_aggregate_from_whatever(pool)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        if agg is None or agg.id is None:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Ba7s%3D","line":187,"updated":"2013-11-26 09:57:59.000000000","message":"we need to have a add_compute to freepool also","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":214,"context_line":"                                                                  agg.name))"},{"line_number":215,"context_line":"            LOG.error(e)"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    def remove_all_computehost(self, pool):"},{"line_number":218,"context_line":"        \"\"\"Remove all compute hosts attached to an aggregate.\"\"\""},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        hosts \u003d self.get_computehosts(pool)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Ba7k%3D","line":217,"updated":"2013-11-26 09:57:59.000000000","message":"typo : remove_all_computehosts","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":214,"context_line":"                                                                  agg.name))"},{"line_number":215,"context_line":"            LOG.error(e)"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    def remove_all_computehost(self, pool):"},{"line_number":218,"context_line":"        \"\"\"Remove all compute hosts attached to an aggregate.\"\"\""},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        hosts \u003d self.get_computehosts(pool)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Bagg%3D","line":217,"in_reply_to":"AAAATn%2F%2Ba7k%3D","updated":"2013-11-26 12:04:23.000000000","message":"Done","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def remove_computehost(self, pool, hosts):"},{"line_number":224,"context_line":"        \"\"\"Remove compute host(s) from an aggregate.\"\"\""},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        if not isinstance(hosts, list):"},{"line_number":227,"context_line":"            hosts \u003d [hosts]"},{"line_number":228,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Ba6c%3D","line":225,"updated":"2013-11-26 09:57:59.000000000","message":"same remark as for the add_computehost, we need to have a special case for adding an host to a freepool","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e80fdf56b569a2ff8d24e864cf17833d51d4e94c","unresolved":false,"context_lines":[{"line_number":267,"context_line":"        return self.nova.aggregates.set_metadata(agg.id, metadata)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"ReservationPool \u003d AggregateWrapper"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2Beu8%3D","line":270,"updated":"2013-11-26 09:57:59.000000000","message":"why keeping AggregateWrapper ?","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"442e5e84785638f5f3db41dce647a7c37fc7535b","unresolved":false,"context_lines":[{"line_number":267,"context_line":"        return self.nova.aggregates.set_metadata(agg.id, metadata)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"ReservationPool \u003d AggregateWrapper"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2BagI%3D","line":270,"in_reply_to":"AAAATn%2F%2Beu8%3D","updated":"2013-11-26 12:04:23.000000000","message":"removed","commit_id":"c224a5ccd826739196ab7e8f69b15aaa728cf556"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"405039a1f590f86ff2cfdae331c050199b180dd4","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    cfg.StrOpt(\u0027aggregate_freepool_name\u0027,"},{"line_number":31,"context_line":"               default\u003d\u0027freepool\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Name of the special aggregate where all hosts \u0027"},{"line_number":33,"context_line":"                    \u0027are candidate for physical host reservation\u0027)"},{"line_number":34,"context_line":"]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"cfg.CONF.register_opts(opts)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BQXg%3D","line":33,"updated":"2013-11-28 09:51:21.000000000","message":"Please always add a comma at the end of last list item.","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a3702a7cfd83bc48bf24676fb6b64883f37d9cec","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    cfg.StrOpt(\u0027aggregate_freepool_name\u0027,"},{"line_number":31,"context_line":"               default\u003d\u0027freepool\u0027,"},{"line_number":32,"context_line":"               help\u003d\u0027Name of the special aggregate where all hosts \u0027"},{"line_number":33,"context_line":"                    \u0027are candidate for physical host reservation\u0027)"},{"line_number":34,"context_line":"]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"cfg.CONF.register_opts(opts)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BPvw%3D","line":33,"in_reply_to":"AAAATn%2F%2BQXg%3D","updated":"2013-11-28 14:36:21.000000000","message":"Done","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"405039a1f590f86ff2cfdae331c050199b180dd4","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                    \u0027are candidate for physical host reservation\u0027)"},{"line_number":34,"context_line":"]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"cfg.CONF.register_opts(opts)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"TENANT_ID_KEY \u003d \u0027climate:tenant\u0027"},{"line_number":39,"context_line":"CLIMATE_OWNER \u003d \u0027climate:owner\u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BQW8%3D","line":36,"updated":"2013-11-28 09:51:21.000000000","message":"This config option should not reside in the [DEFAULT] group.","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a3702a7cfd83bc48bf24676fb6b64883f37d9cec","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                    \u0027are candidate for physical host reservation\u0027)"},{"line_number":34,"context_line":"]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"cfg.CONF.register_opts(opts)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"TENANT_ID_KEY \u003d \u0027climate:tenant\u0027"},{"line_number":39,"context_line":"CLIMATE_OWNER \u003d \u0027climate:owner\u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BPvs%3D","line":36,"in_reply_to":"AAAATn%2F%2BQW8%3D","updated":"2013-11-28 14:36:21.000000000","message":"Done","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"405039a1f590f86ff2cfdae331c050199b180dd4","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        \"\"\"id can be an aggregate or an id.\"\"\""},{"line_number":103,"context_line":"        try:"},{"line_number":104,"context_line":"            i \u003d int(aggregate_or_id)"},{"line_number":105,"context_line":"            return self.nova.aggregates.get(i)"},{"line_number":106,"context_line":"        except (ValueError, TypeError):"},{"line_number":107,"context_line":"            if hasattr(aggregate_or_id, \u0027id\u0027) and aggregate_or_id.id:"},{"line_number":108,"context_line":"                # pool is an aggregate"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BQWo%3D","line":105,"updated":"2013-11-28 09:51:21.000000000","message":"Minimize try: block, move \u0027return\u0027 out of it.","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a3702a7cfd83bc48bf24676fb6b64883f37d9cec","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        \"\"\"id can be an aggregate or an id.\"\"\""},{"line_number":103,"context_line":"        try:"},{"line_number":104,"context_line":"            i \u003d int(aggregate_or_id)"},{"line_number":105,"context_line":"            return self.nova.aggregates.get(i)"},{"line_number":106,"context_line":"        except (ValueError, TypeError):"},{"line_number":107,"context_line":"            if hasattr(aggregate_or_id, \u0027id\u0027) and aggregate_or_id.id:"},{"line_number":108,"context_line":"                # pool is an aggregate"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BPuU%3D","line":105,"in_reply_to":"AAAATn%2F%2BQWo%3D","updated":"2013-11-28 14:36:21.000000000","message":"Done","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"405039a1f590f86ff2cfdae331c050199b180dd4","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                return self.nova.aggregates.get(aggregate_or_id.id)"},{"line_number":110,"context_line":"            return None"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def get_aggregate_from_whatever(self, whatever):"},{"line_number":113,"context_line":"        \"\"\"Return an aggregate by name or an id.\"\"\""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        a \u003d self.get_aggregate_from_id(whatever)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BQV4%3D","line":112,"updated":"2013-11-28 09:51:21.000000000","message":"Replace \u0027whatever\u0027 with \u0027name_or_id\u0027 here.","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a3702a7cfd83bc48bf24676fb6b64883f37d9cec","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                return self.nova.aggregates.get(aggregate_or_id.id)"},{"line_number":110,"context_line":"            return None"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def get_aggregate_from_whatever(self, whatever):"},{"line_number":113,"context_line":"        \"\"\"Return an aggregate by name or an id.\"\"\""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        a \u003d self.get_aggregate_from_id(whatever)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BPto%3D","line":112,"in_reply_to":"AAAATn%2F%2BQV4%3D","updated":"2013-11-28 14:36:21.000000000","message":"Done","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"405039a1f590f86ff2cfdae331c050199b180dd4","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    def get_aggregate_from_whatever(self, whatever):"},{"line_number":113,"context_line":"        \"\"\"Return an aggregate by name or an id.\"\"\""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        a \u003d self.get_aggregate_from_id(whatever)"},{"line_number":116,"context_line":"        if a is not None:"},{"line_number":117,"context_line":"            return a"},{"line_number":118,"context_line":"        return self.get_aggregate_from_name(whatever)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BQVo%3D","line":115,"updated":"2013-11-28 09:51:21.000000000","message":"Use better var names. \u0027aggregate\u0027 would be better here.","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a3702a7cfd83bc48bf24676fb6b64883f37d9cec","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    def get_aggregate_from_whatever(self, whatever):"},{"line_number":113,"context_line":"        \"\"\"Return an aggregate by name or an id.\"\"\""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        a \u003d self.get_aggregate_from_id(whatever)"},{"line_number":116,"context_line":"        if a is not None:"},{"line_number":117,"context_line":"            return a"},{"line_number":118,"context_line":"        return self.get_aggregate_from_name(whatever)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BPuA%3D","line":115,"in_reply_to":"AAAATn%2F%2BQVo%3D","updated":"2013-11-28 14:36:21.000000000","message":"Done","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"405039a1f590f86ff2cfdae331c050199b180dd4","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        \"\"\"Return an aggregate by name or an id.\"\"\""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        a \u003d self.get_aggregate_from_id(whatever)"},{"line_number":116,"context_line":"        if a is not None:"},{"line_number":117,"context_line":"            return a"},{"line_number":118,"context_line":"        return self.get_aggregate_from_name(whatever)"},{"line_number":119,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BQVY%3D","line":116,"updated":"2013-11-28 09:51:21.000000000","message":"Logic should be inverted here:\n\n    if aggregate is None:\n        aggregate \u003d \u003c...\u003e\n    return aggregate","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a3702a7cfd83bc48bf24676fb6b64883f37d9cec","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        \"\"\"Return an aggregate by name or an id.\"\"\""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        a \u003d self.get_aggregate_from_id(whatever)"},{"line_number":116,"context_line":"        if a is not None:"},{"line_number":117,"context_line":"            return a"},{"line_number":118,"context_line":"        return self.get_aggregate_from_name(whatever)"},{"line_number":119,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BPtU%3D","line":116,"in_reply_to":"AAAATn%2F%2BQVY%3D","updated":"2013-11-28 14:36:21.000000000","message":"Done","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"405039a1f590f86ff2cfdae331c050199b180dd4","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            return a"},{"line_number":118,"context_line":"        return self.get_aggregate_from_name(whatever)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _generate_aggregate_name(self):"},{"line_number":121,"context_line":"        return str(uuidgen.uuid4())"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def create(self, az\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BQVM%3D","line":120,"updated":"2013-11-28 09:51:21.000000000","message":"Method does not depend on class or instance. Should be @staticmethod","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a3702a7cfd83bc48bf24676fb6b64883f37d9cec","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            return a"},{"line_number":118,"context_line":"        return self.get_aggregate_from_name(whatever)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _generate_aggregate_name(self):"},{"line_number":121,"context_line":"        return str(uuidgen.uuid4())"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def create(self, az\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BPPA%3D","line":120,"in_reply_to":"AAAATn%2F%2BQVM%3D","updated":"2013-11-28 14:36:21.000000000","message":"Done","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"405039a1f590f86ff2cfdae331c050199b180dd4","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        return str(uuidgen.uuid4())"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def create(self, az\u003dTrue):"},{"line_number":124,"context_line":"        \"\"\"Create a Pool (an Aggregate) with or without AZ.\"\"\""},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        name \u003d self._generate_aggregate_name()"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BQUI%3D","line":124,"updated":"2013-11-28 09:51:21.000000000","message":"Please unfold \u0027AZ\u0027 here and in this method. It is not clear what does it mean from the code.","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a3702a7cfd83bc48bf24676fb6b64883f37d9cec","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        return str(uuidgen.uuid4())"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def create(self, az\u003dTrue):"},{"line_number":124,"context_line":"        \"\"\"Create a Pool (an Aggregate) with or without AZ.\"\"\""},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        name \u003d self._generate_aggregate_name()"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BPrs%3D","line":124,"in_reply_to":"AAAATn%2F%2BQUI%3D","updated":"2013-11-28 14:36:21.000000000","message":"Done","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"405039a1f590f86ff2cfdae331c050199b180dd4","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        LOG.debug(\u0027Creating pool aggregate: %s with AZ %s\u0027 % (name, az_name))"},{"line_number":133,"context_line":"        agg \u003d self.nova.aggregates.create(name, az_name)"},{"line_number":134,"context_line":"        setmeta \u003d self.nova.aggregates.set_metadata"},{"line_number":135,"context_line":"        setmeta(agg, {CLIMATE_OWNER: self.ctx.tenant_id})"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        return agg"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BQTs%3D","line":135,"updated":"2013-11-28 09:51:21.000000000","message":"It would be prettier to store argument in a variable and pass it to the method if you don\u0027t want to wrap method call.","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a3702a7cfd83bc48bf24676fb6b64883f37d9cec","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        LOG.debug(\u0027Creating pool aggregate: %s with AZ %s\u0027 % (name, az_name))"},{"line_number":133,"context_line":"        agg \u003d self.nova.aggregates.create(name, az_name)"},{"line_number":134,"context_line":"        setmeta \u003d self.nova.aggregates.set_metadata"},{"line_number":135,"context_line":"        setmeta(agg, {CLIMATE_OWNER: self.ctx.tenant_id})"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        return agg"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BPrk%3D","line":135,"in_reply_to":"AAAATn%2F%2BQTs%3D","updated":"2013-11-28 14:36:21.000000000","message":"Done","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"405039a1f590f86ff2cfdae331c050199b180dd4","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        if len(hosts) \u003e 0 and not force:"},{"line_number":157,"context_line":"            raise AggregateHaveHost(agg)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        for h in hosts:"},{"line_number":160,"context_line":"            LOG.debug(\"Removing host \u0027%s\u0027 from aggregate \""},{"line_number":161,"context_line":"                      \"\u0027%s\u0027)\" % (h, agg.id))"},{"line_number":162,"context_line":"            self.nova.aggregates.remove_host(agg.id, h)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BQTY%3D","line":159,"updated":"2013-11-28 09:51:21.000000000","message":"Please don\u0027t abbreviate variable names to one letter.","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a3702a7cfd83bc48bf24676fb6b64883f37d9cec","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        if len(hosts) \u003e 0 and not force:"},{"line_number":157,"context_line":"            raise AggregateHaveHost(agg)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        for h in hosts:"},{"line_number":160,"context_line":"            LOG.debug(\"Removing host \u0027%s\u0027 from aggregate \""},{"line_number":161,"context_line":"                      \"\u0027%s\u0027)\" % (h, agg.id))"},{"line_number":162,"context_line":"            self.nova.aggregates.remove_host(agg.id, h)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BPrc%3D","line":159,"in_reply_to":"AAAATn%2F%2BQTY%3D","updated":"2013-11-28 14:36:21.000000000","message":"Done","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"405039a1f590f86ff2cfdae331c050199b180dd4","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        if host not in freepool_agg.hosts:"},{"line_number":207,"context_line":"            raise HostNotInFreePool(host, freepool_agg.name)"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        try:"},{"line_number":210,"context_line":"            LOG.info(\"removing host \u0027%s\u0027 \""},{"line_number":211,"context_line":"                     \"to aggregate freepool %s\" % (host,"},{"line_number":212,"context_line":"                                                   freepool_agg.name))"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BQSo%3D","line":209,"updated":"2013-11-28 09:51:21.000000000","message":"Minimize try: block. You should leave one method call only in it.","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a3702a7cfd83bc48bf24676fb6b64883f37d9cec","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        if host not in freepool_agg.hosts:"},{"line_number":207,"context_line":"            raise HostNotInFreePool(host, freepool_agg.name)"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        try:"},{"line_number":210,"context_line":"            LOG.info(\"removing host \u0027%s\u0027 \""},{"line_number":211,"context_line":"                     \"to aggregate freepool %s\" % (host,"},{"line_number":212,"context_line":"                                                   freepool_agg.name))"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BPn0%3D","line":209,"in_reply_to":"AAAATn%2F%2BQSo%3D","updated":"2013-11-28 14:36:21.000000000","message":"Done","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":708,"name":"Yuriy Taraday","email":"yuriy@taraday.nl","username":"yorik-sar"},"change_message_id":"405039a1f590f86ff2cfdae331c050199b180dd4","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            agg \u003d self.get_aggregate_from_whatever(pool)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        if agg is None:"},{"line_number":250,"context_line":"            raise nova_exceptions.NotFound(\"Aggregate \u0027%s\u0027 not found!\" % pool)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        freepool_agg \u003d self.get(cfg.CONF.aggregate_freepool_name)"},{"line_number":253,"context_line":"        if freepool_agg is None:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BQQU%3D","line":250,"updated":"2013-11-28 09:51:21.000000000","message":"It is a bad habit to raise other libraries\u0027 exceptions.","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"a3702a7cfd83bc48bf24676fb6b64883f37d9cec","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            agg \u003d self.get_aggregate_from_whatever(pool)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        if agg is None:"},{"line_number":250,"context_line":"            raise nova_exceptions.NotFound(\"Aggregate \u0027%s\u0027 not found!\" % pool)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        freepool_agg \u003d self.get(cfg.CONF.aggregate_freepool_name)"},{"line_number":253,"context_line":"        if freepool_agg is None:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAATn%2F%2BPmc%3D","line":250,"in_reply_to":"AAAATn%2F%2BQQU%3D","updated":"2013-11-28 14:36:21.000000000","message":"Done","commit_id":"bb5f7e40c3a946d1c401028114f59ff912be582a"}],"tests/test_reservation_pool.py":[{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"28b50666e91ca5998731e332aa1ec5809bc8997a","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from climate import config"},{"line_number":19,"context_line":"from climate import context"},{"line_number":20,"context_line":"from climate import test"},{"line_number":21,"context_line":"from climate.utils import reservation_pool as rp"},{"line_number":22,"context_line":"from oslo.config import cfg"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B8YY%3D","line":20,"updated":"2013-11-18 09:55:24.000000000","message":"Please group imports in the appropriate way.","commit_id":"f213649ec15a19e00620c8e4c7aedb4903d96eb4"}]}
