)]}'
{"nova/compute/claims.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"c3ad00740a349f2fe8a28a569047cf0538aa1124","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        # Raise exception ComputeResourcesUnavailable if claim failed"},{"line_number":84,"context_line":"        self._claim_test(limits)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @property"},{"line_number":87,"context_line":"    def disk_gb(self):"},{"line_number":88,"context_line":"        return self.request.root_gb + self.request.ephemeral_gb"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    @property"},{"line_number":91,"context_line":"    def memory_mb(self):"},{"line_number":92,"context_line":"        return self.request.memory_mb"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    @property"},{"line_number":95,"context_line":"    def vcpus(self):"},{"line_number":96,"context_line":"        return self.request.vcpus"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    @property"},{"line_number":99,"context_line":"    def numa_topology(self):"},{"line_number":100,"context_line":"        return self.request.numa_topology"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    @property"},{"line_number":103,"context_line":"    def total_memory_mb(self):"},{"line_number":104,"context_line":"        raise NotImplemented(\"ClaimBase doesn\u0027t implement total_memory_mb.\")"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    @property"},{"line_number":107,"context_line":"    def used_memory_mb(self):"},{"line_number":108,"context_line":"        raise NotImplemented(\"ClaimBase doesn\u0027t implement used_memory_mb.\")"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    @property"},{"line_number":111,"context_line":"    def total_disk_gb(self):"},{"line_number":112,"context_line":"        raise NotImplemented(\"ClaimBase doesn\u0027t implement total_disk_gb.\")"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    @property"},{"line_number":115,"context_line":"    def used_disk_gb(self):"},{"line_number":116,"context_line":"        raise NotImplemented(\"ClaimBase doesn\u0027t implement used_disk_gb.\")"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    @property"},{"line_number":119,"context_line":"    def total_vcpus(self):"},{"line_number":120,"context_line":"        raise NotImplemented(\"ClaimBase doesn\u0027t implement total_vcpus.\")"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    @property"},{"line_number":123,"context_line":"    def used_vcpus(self):"},{"line_number":124,"context_line":"        raise NotImplemented(\"ClaimBase doesn\u0027t implement used_vcpus.\")"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    @property"},{"line_number":127,"context_line":"    def pci_requests(self):"},{"line_number":128,"context_line":"        raise NotImplemented(\"ClaimBase doesn\u0027t implement pci_requests.\")"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    @property"},{"line_number":131,"context_line":"    def host_topology(self):"},{"line_number":132,"context_line":"        raise NotImplemented(\"ClaimBase doesn\u0027t implement host_topology.\")"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    @property"},{"line_number":135,"context_line":"    def host_pci_stats(self):"},{"line_number":136,"context_line":"        raise NotImplemented(\"ClaimBase doesn\u0027t implement host_pci_stats.\")"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def abort(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_e3a2b7fc","line":135,"range":{"start_line":86,"start_character":4,"end_line":135,"end_character":29},"updated":"2016-01-05 12:38:52.000000000","message":"After reading this code for a bit - I don\u0027t think that these belong on the claim class. We should have another class that has a unified API towards getting these from different types of objects holding resources.","commit_id":"a3d347d04d4f236f2bd47e0005253bfa03c79e89"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"c3ad00740a349f2fe8a28a569047cf0538aa1124","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                {\u0027type\u0027: type_, \u0027limit\u0027: limit, \u0027free\u0027: free, \u0027unit\u0027: unit})"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        if requested \u003e free:"},{"line_number":241,"context_line":"            return (_(\u0027Free %(type)s %(free).02f \u0027"},{"line_number":242,"context_line":"                      \u0027%(unit)s \u003c requested %(requested)d %(unit)s\u0027) %"},{"line_number":243,"context_line":"                      {\u0027type\u0027: type_, \u0027free\u0027: free, \u0027unit\u0027: unit,"},{"line_number":244,"context_line":"                       \u0027requested\u0027: requested})"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"class Claim(ClaimBase):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_e30cf7ee","line":244,"range":{"start_line":241,"start_character":19,"end_line":244,"end_character":47},"updated":"2016-01-05 12:38:52.000000000","message":"I\u0027ve personally always hated that these methods return strings. It\u0027s a terrible API, but I guess we don\u0027t (can\u0027t) fix everything now.","commit_id":"a3d347d04d4f236f2bd47e0005253bfa03c79e89"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3cd6dc34fb9900fa38b51680875053a23a34517b","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def __init__(self, context, instance, tracker, resources, overhead\u003dNone,"},{"line_number":79,"context_line":"                 limits\u003dNone):"},{"line_number":80,"context_line":"        super(Claim, self).__init__()"},{"line_number":81,"context_line":"        # Stash a copy of the instance at the current point of time"},{"line_number":82,"context_line":"        self.instance \u003d instance.obj_clone()"},{"line_number":83,"context_line":"        self._numa_topology_loaded \u003d False"},{"line_number":84,"context_line":"        self.tracker \u003d tracker"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_3f118d04","side":"PARENT","line":81,"updated":"2016-01-06 14:24:23.000000000","message":"request instead of instance?","commit_id":"d03b3dafd7af8e3c22a1e62d5249463fabc630cb"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"598094f73daa495f4aee37a53d1b78e51d8fd0a8","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    basic part of a complete claim class, and should be extended to be used by"},{"line_number":39,"context_line":"    scheduler or compute node."},{"line_number":40,"context_line":"    \"\"\""},{"line_number":41,"context_line":"    class Request(object):"},{"line_number":42,"context_line":"        __slots__ \u003d [\u0027disk_gb\u0027,"},{"line_number":43,"context_line":"                     \u0027memory_mb\u0027,"},{"line_number":44,"context_line":"                     \u0027vcpus\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_b0bbe2e4","line":41,"range":{"start_line":41,"start_character":10,"end_line":41,"end_character":17},"updated":"2016-01-13 12:30:13.000000000","message":"There is very little benefit in having this be an internal class (nothing wrong with it either except it\u0027s really not something we do in Nova at all).\n\nI\u0027d just make it a private module level class so that it\u0027s clear we don\u0027t want it used outside - currently it\u0027s just namespaced weirdly but still fair game to anyone reading the code to use it.","commit_id":"2edb0bc0a50dfca0812b0ad6f15af32204b80095"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"2f3b7b3cd908aa29400a354720ac520b135e67bb","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    basic part of a complete claim class, and should be extended to be used by"},{"line_number":39,"context_line":"    scheduler or compute node."},{"line_number":40,"context_line":"    \"\"\""},{"line_number":41,"context_line":"    class Request(object):"},{"line_number":42,"context_line":"        __slots__ \u003d [\u0027disk_gb\u0027,"},{"line_number":43,"context_line":"                     \u0027memory_mb\u0027,"},{"line_number":44,"context_line":"                     \u0027vcpus\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_141a7517","line":41,"range":{"start_line":41,"start_character":10,"end_line":41,"end_character":17},"in_reply_to":"da6ed579_b0bbe2e4","updated":"2016-01-15 02:28:56.000000000","message":"Done. I don\u0027t see any examples in nova about how to name a private module level class. But I can imagine this convention is to add a prefix \u0027_\u0027.","commit_id":"2edb0bc0a50dfca0812b0ad6f15af32204b80095"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"598094f73daa495f4aee37a53d1b78e51d8fd0a8","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    def pci_requests(self):"},{"line_number":122,"context_line":"        return self._request.pci_requests"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _prepare_request(self, request):"},{"line_number":125,"context_line":"        \"\"\"Prepare resource request for claim.\"\"\""},{"line_number":126,"context_line":"        pass"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_cdf27d6f","line":124,"range":{"start_line":124,"start_character":31,"end_line":124,"end_character":38},"updated":"2016-01-13 12:30:13.000000000","message":"Why do we have to pass it in when it\u0027s always self._request \u003c- this just seems clumsy to me really and needlessly obfuscated.","commit_id":"2edb0bc0a50dfca0812b0ad6f15af32204b80095"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"2f3b7b3cd908aa29400a354720ac520b135e67bb","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    def pci_requests(self):"},{"line_number":122,"context_line":"        return self._request.pci_requests"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _prepare_request(self, request):"},{"line_number":125,"context_line":"        \"\"\"Prepare resource request for claim.\"\"\""},{"line_number":126,"context_line":"        pass"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_b4284934","line":124,"range":{"start_line":124,"start_character":31,"end_line":124,"end_character":38},"in_reply_to":"da6ed579_cdf27d6f","updated":"2016-01-15 02:28:56.000000000","message":"Done","commit_id":"2edb0bc0a50dfca0812b0ad6f15af32204b80095"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"598094f73daa495f4aee37a53d1b78e51d8fd0a8","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        \"\"\"Prepare resource request for claim.\"\"\""},{"line_number":126,"context_line":"        pass"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def _prepare_resources(self, resources):"},{"line_number":129,"context_line":"        \"\"\"Prepare available resources.\"\"\""},{"line_number":130,"context_line":"        pass"},{"line_number":131,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_2d047948","line":128,"range":{"start_line":128,"start_character":33,"end_line":128,"end_character":42},"updated":"2016-01-13 12:30:13.000000000","message":"same here","commit_id":"2edb0bc0a50dfca0812b0ad6f15af32204b80095"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"2f3b7b3cd908aa29400a354720ac520b135e67bb","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        \"\"\"Prepare resource request for claim.\"\"\""},{"line_number":126,"context_line":"        pass"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def _prepare_resources(self, resources):"},{"line_number":129,"context_line":"        \"\"\"Prepare available resources.\"\"\""},{"line_number":130,"context_line":"        pass"},{"line_number":131,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_54246d5c","line":128,"range":{"start_line":128,"start_character":33,"end_line":128,"end_character":42},"in_reply_to":"da6ed579_2d047948","updated":"2016-01-15 02:28:56.000000000","message":"Done","commit_id":"2edb0bc0a50dfca0812b0ad6f15af32204b80095"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"598094f73daa495f4aee37a53d1b78e51d8fd0a8","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        \"\"\"Prepare available resources.\"\"\""},{"line_number":130,"context_line":"        pass"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def _prepare_logs(self):"},{"line_number":133,"context_line":"        self._log_info \u003d LOG.info"},{"line_number":134,"context_line":"        self._log_debug \u003d LOG.debug"},{"line_number":135,"context_line":"        self._log_warn \u003d LOG.warn"},{"line_number":136,"context_line":"        self._log_error \u003d LOG.error"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _test_pci(self):"},{"line_number":139,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_cd1cbd79","line":136,"range":{"start_line":132,"start_character":4,"end_line":136,"end_character":35},"updated":"2016-01-13 12:30:13.000000000","message":"I personally don\u0027t like this at all - instance is basically a required argument for __init__ in both subclasses so it may as well be in the super class - this fiddling with aliasing functions just makes no sense if the only purpose is to pass the instance as a kwarg.","commit_id":"2edb0bc0a50dfca0812b0ad6f15af32204b80095"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"2f3b7b3cd908aa29400a354720ac520b135e67bb","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        \"\"\"Prepare available resources.\"\"\""},{"line_number":130,"context_line":"        pass"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def _prepare_logs(self):"},{"line_number":133,"context_line":"        self._log_info \u003d LOG.info"},{"line_number":134,"context_line":"        self._log_debug \u003d LOG.debug"},{"line_number":135,"context_line":"        self._log_warn \u003d LOG.warn"},{"line_number":136,"context_line":"        self._log_error \u003d LOG.error"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _test_pci(self):"},{"line_number":139,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_d4985d1e","line":136,"range":{"start_line":132,"start_character":4,"end_line":136,"end_character":35},"in_reply_to":"da6ed579_cd1cbd79","updated":"2016-01-15 02:28:56.000000000","message":"Sorry, I don\u0027t see any workaround here.\n\nThis is useful because there is a third subclass `nova.scheduler.claims.Claim`. This class uses RequestSpec instead of Instance object to request resources. Thus the log behavior is somewhat different because RequestSpec cannot be applied to the log parameter \"instance\", e.g. `LOG.info(..., instance\u003drequest_spec)`. In order to make the BaseClaim logic reusable with logs, I had to partial all the log method in the BaseClaim, so the subclasses can change the default behavior as needed.\n\nIf there are other solutions, please kindly tell me.","commit_id":"2edb0bc0a50dfca0812b0ad6f15af32204b80095"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"1c7deba5737bf01484bb5f06ebec669068bda1b7","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        \"\"\"Prepare available resources.\"\"\""},{"line_number":130,"context_line":"        pass"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def _prepare_logs(self):"},{"line_number":133,"context_line":"        self._log_info \u003d LOG.info"},{"line_number":134,"context_line":"        self._log_debug \u003d LOG.debug"},{"line_number":135,"context_line":"        self._log_warn \u003d LOG.warn"},{"line_number":136,"context_line":"        self._log_error \u003d LOG.error"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _test_pci(self):"},{"line_number":139,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_cf63e440","line":136,"range":{"start_line":132,"start_character":4,"end_line":136,"end_character":35},"in_reply_to":"da6ed579_d4985d1e","updated":"2016-01-15 02:31:37.000000000","message":"s/partial/prepare","commit_id":"2edb0bc0a50dfca0812b0ad6f15af32204b80095"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"56d0c3a1c628cdc029b33f2b7a3cd80d81966e40","unresolved":false,"context_lines":[{"line_number":348,"context_line":"        request.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":349,"context_line":"            self.instance_type, image_meta)"},{"line_number":350,"context_line":""},{"line_number":351,"context_line":"        pci_requests \u003d objects.InstancePCIRequests.get_by_instance_uuid("},{"line_number":352,"context_line":"            self.context, self.instance.uuid)"},{"line_number":353,"context_line":"        if pci_requests:"},{"line_number":354,"context_line":"            request.pci_requests \u003d pci_requests.requests"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_ec637818","line":351,"range":{"start_line":351,"start_character":8,"end_line":351,"end_character":20},"updated":"2016-01-11 14:49:47.000000000","message":"Why this `pci_requests`(used in _test_numa_topology()) isn\u0027t generated from `objects.InstancePCIRequests.get_by_instance_uuid_and_newness()` like #L357 below?","commit_id":"2edb0bc0a50dfca0812b0ad6f15af32204b80095"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"2f3b7b3cd908aa29400a354720ac520b135e67bb","unresolved":false,"context_lines":[{"line_number":348,"context_line":"        request.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":349,"context_line":"            self.instance_type, image_meta)"},{"line_number":350,"context_line":""},{"line_number":351,"context_line":"        pci_requests \u003d objects.InstancePCIRequests.get_by_instance_uuid("},{"line_number":352,"context_line":"            self.context, self.instance.uuid)"},{"line_number":353,"context_line":"        if pci_requests:"},{"line_number":354,"context_line":"            request.pci_requests \u003d pci_requests.requests"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_af2230a1","line":351,"range":{"start_line":351,"start_character":8,"end_line":351,"end_character":20},"in_reply_to":"da6ed579_f0563ad1","updated":"2016-01-15 02:28:56.000000000","message":"I\u0027ll try to fix it in the separate patch. It looks very strange that there are 2 versions of pci_requests in MoveClaim.\n\nMoreover, if there is only one version of pci_requests, more logic can be abstracted to ClaimBase. It will make the code cleaner and easier to understand.","commit_id":"2edb0bc0a50dfca0812b0ad6f15af32204b80095"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"598094f73daa495f4aee37a53d1b78e51d8fd0a8","unresolved":false,"context_lines":[{"line_number":348,"context_line":"        request.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":349,"context_line":"            self.instance_type, image_meta)"},{"line_number":350,"context_line":""},{"line_number":351,"context_line":"        pci_requests \u003d objects.InstancePCIRequests.get_by_instance_uuid("},{"line_number":352,"context_line":"            self.context, self.instance.uuid)"},{"line_number":353,"context_line":"        if pci_requests:"},{"line_number":354,"context_line":"            request.pci_requests \u003d pci_requests.requests"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_f0563ad1","line":351,"range":{"start_line":351,"start_character":8,"end_line":351,"end_character":20},"in_reply_to":"fa69d971_ec637818","updated":"2016-01-13 12:30:13.000000000","message":"hmmm it might be a bug actually that\u0027s a good point - not realted to this refactoring patch though.","commit_id":"2edb0bc0a50dfca0812b0ad6f15af32204b80095"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"8516b7b93c5a03020add9351ca50add9c9e612d3","unresolved":false,"context_lines":[{"line_number":307,"context_line":"            self._resources.host_pci_stats \u003d self.tracker.pci_tracker.stats"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"    def _prepare_logs(self):"},{"line_number":310,"context_line":"        self._log_info \u003d partial(LOG.info, instance\u003dself.instance)"},{"line_number":311,"context_line":"        self._log_debug \u003d partial(LOG.debug, instance\u003dself.instance)"},{"line_number":312,"context_line":"        self._log_warn \u003d partial(LOG.warn, instance\u003dself.instance)"},{"line_number":313,"context_line":"        self._log_error \u003d partial(LOG.error, instance\u003dself.instance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba63e191_f33e62d9","line":310,"range":{"start_line":310,"start_character":43,"end_line":310,"end_character":65},"updated":"2016-01-19 16:39:21.000000000","message":"So the only reason you add this _prepare_logs (which I honestly don\u0027t like at all), is to curry in the instance in subclasses where it is being passed to __init__.\n\nWhat I think we should do is just make the instance a positional arg on the BaseClaim (which never gets instantiated anyway) and write all the logging using self.instance in the base class as well.\n\nIt makes little sense to not have the instance passed in to any of the possible subclasses, so why not have it in the \"abstract base\" too?","commit_id":"375b1516b2ab96c191f9151b65121e1fa37f2e4b"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"1cc0b3edd67bc8256d6ce1f1dc197351e3dc17c0","unresolved":false,"context_lines":[{"line_number":307,"context_line":"            self._resources.host_pci_stats \u003d self.tracker.pci_tracker.stats"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"    def _prepare_logs(self):"},{"line_number":310,"context_line":"        self._log_info \u003d partial(LOG.info, instance\u003dself.instance)"},{"line_number":311,"context_line":"        self._log_debug \u003d partial(LOG.debug, instance\u003dself.instance)"},{"line_number":312,"context_line":"        self._log_warn \u003d partial(LOG.warn, instance\u003dself.instance)"},{"line_number":313,"context_line":"        self._log_error \u003d partial(LOG.error, instance\u003dself.instance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba63e191_ac5f0fe4","line":310,"range":{"start_line":310,"start_character":43,"end_line":310,"end_character":65},"in_reply_to":"ba63e191_f33e62d9","updated":"2016-01-20 04:59:25.000000000","message":"It makes sense, thanks for clarifying again.","commit_id":"375b1516b2ab96c191f9151b65121e1fa37f2e4b"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"eafb764091af09a0f01b6452efb0899280868862","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        self.host_pci_stats \u003d None"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"class ClaimBase(object):"},{"line_number":80,"context_line":"    \"\"\"A declaration which requires free resources, and checks whether the"},{"line_number":81,"context_line":"    resources can meet the request. This abstract class only implements the"},{"line_number":82,"context_line":"    basic part of a complete claim class, and should be extended to be used by"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_e70d63e9","line":79,"updated":"2016-01-26 16:50:31.000000000","message":"Now that this base class is shared between the scheduler and compute, should it not be in a common place? nova.claims?","commit_id":"00a131388615488e01bdac00f08be08883bb220b"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"83e55ca407f0b0797329e76918c5215fbfbffe1f","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        self.host_pci_stats \u003d None"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"class ClaimBase(object):"},{"line_number":80,"context_line":"    \"\"\"A declaration which requires free resources, and checks whether the"},{"line_number":81,"context_line":"    resources can meet the request. This abstract class only implements the"},{"line_number":82,"context_line":"    basic part of a complete claim class, and should be extended to be used by"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a5ae5dd_8646514d","line":79,"in_reply_to":"9a68dd71_e70d63e9","updated":"2016-02-06 09:12:35.000000000","message":"Done","commit_id":"00a131388615488e01bdac00f08be08883bb220b"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"eafb764091af09a0f01b6452efb0899280868862","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"class ClaimBase(object):"},{"line_number":80,"context_line":"    \"\"\"A declaration which requires free resources, and checks whether the"},{"line_number":81,"context_line":"    resources can meet the request. This abstract class only implements the"},{"line_number":82,"context_line":"    basic part of a complete claim class, and should be extended to be used by"},{"line_number":83,"context_line":"    scheduler or compute node."}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_a6b8cc2b","line":80,"updated":"2016-01-26 16:50:31.000000000","message":"Should we use abstract base classes (abc module) here?","commit_id":"00a131388615488e01bdac00f08be08883bb220b"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"83e55ca407f0b0797329e76918c5215fbfbffe1f","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"class ClaimBase(object):"},{"line_number":80,"context_line":"    \"\"\"A declaration which requires free resources, and checks whether the"},{"line_number":81,"context_line":"    resources can meet the request. This abstract class only implements the"},{"line_number":82,"context_line":"    basic part of a complete claim class, and should be extended to be used by"},{"line_number":83,"context_line":"    scheduler or compute node."}],"source_content_type":"text/x-python","patch_set":6,"id":"5a5ae5dd_26767da4","line":80,"in_reply_to":"9a68dd71_a6b8cc2b","updated":"2016-02-06 09:12:35.000000000","message":"Done","commit_id":"00a131388615488e01bdac00f08be08883bb220b"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"eafb764091af09a0f01b6452efb0899280868862","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    def pci_requests(self):"},{"line_number":136,"context_line":"        return self._request.pci_requests"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _prepare_request(self):"},{"line_number":139,"context_line":"        \"\"\"Prepare resource request for claim.\"\"\""},{"line_number":140,"context_line":"        pass"},{"line_number":141,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_c6e38032","line":138,"updated":"2016-01-26 16:50:31.000000000","message":"If using abc, this should be an abstract method.","commit_id":"00a131388615488e01bdac00f08be08883bb220b"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"83e55ca407f0b0797329e76918c5215fbfbffe1f","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    def pci_requests(self):"},{"line_number":136,"context_line":"        return self._request.pci_requests"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _prepare_request(self):"},{"line_number":139,"context_line":"        \"\"\"Prepare resource request for claim.\"\"\""},{"line_number":140,"context_line":"        pass"},{"line_number":141,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5a5ae5dd_467b798c","line":138,"in_reply_to":"9a68dd71_c6e38032","updated":"2016-02-06 09:12:35.000000000","message":"Done","commit_id":"00a131388615488e01bdac00f08be08883bb220b"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"eafb764091af09a0f01b6452efb0899280868862","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        \"\"\"Prepare resource request for claim.\"\"\""},{"line_number":140,"context_line":"        pass"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def _prepare_resources(self):"},{"line_number":143,"context_line":"        \"\"\"Prepare available resources.\"\"\""},{"line_number":144,"context_line":"        pass"},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_66cf34b4","line":142,"updated":"2016-01-26 16:50:31.000000000","message":"If using abc, this should be an abstract method.","commit_id":"00a131388615488e01bdac00f08be08883bb220b"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"83e55ca407f0b0797329e76918c5215fbfbffe1f","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        \"\"\"Prepare resource request for claim.\"\"\""},{"line_number":140,"context_line":"        pass"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def _prepare_resources(self):"},{"line_number":143,"context_line":"        \"\"\"Prepare available resources.\"\"\""},{"line_number":144,"context_line":"        pass"},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5a5ae5dd_e66b85b7","line":142,"in_reply_to":"9a68dd71_66cf34b4","updated":"2016-02-06 09:12:35.000000000","message":"Done","commit_id":"00a131388615488e01bdac00f08be08883bb220b"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"eafb764091af09a0f01b6452efb0899280868862","unresolved":false,"context_lines":[{"line_number":273,"context_line":"    def __init__(self, context, instance, tracker, resources, overhead\u003dNone,"},{"line_number":274,"context_line":"                 limits\u003dNone):"},{"line_number":275,"context_line":"        self.tracker \u003d tracker"},{"line_number":276,"context_line":"        self.resources \u003d resources"},{"line_number":277,"context_line":"        self.overhead \u003d overhead or {\u0027memory_mb\u0027: 0}"},{"line_number":278,"context_line":"        self.context \u003d context"},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_e65d6449","line":276,"updated":"2016-01-26 16:50:31.000000000","message":"Is this attribute required by any code that uses this class? If not, we could avoid storing it here by changing the ClaimBase constructor to accept a resources argument that then gets passed to _prepare_resources.","commit_id":"00a131388615488e01bdac00f08be08883bb220b"},{"author":{"_account_id":15648,"name":"Yingxin","email":"yingxin.cheng@intel.com","username":"Yingxin"},"change_message_id":"83e55ca407f0b0797329e76918c5215fbfbffe1f","unresolved":false,"context_lines":[{"line_number":273,"context_line":"    def __init__(self, context, instance, tracker, resources, overhead\u003dNone,"},{"line_number":274,"context_line":"                 limits\u003dNone):"},{"line_number":275,"context_line":"        self.tracker \u003d tracker"},{"line_number":276,"context_line":"        self.resources \u003d resources"},{"line_number":277,"context_line":"        self.overhead \u003d overhead or {\u0027memory_mb\u0027: 0}"},{"line_number":278,"context_line":"        self.context \u003d context"},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5a5ae5dd_463e198d","line":276,"in_reply_to":"9a68dd71_e65d6449","updated":"2016-02-06 09:12:35.000000000","message":"Not really\n1. This code is not restricted to claim resources from multiple resource objects or even no resource in NopClaim.\n2. It looks clear to me if not pass the resource object to parent and then change its name to the argument of _prepare_resources.","commit_id":"00a131388615488e01bdac00f08be08883bb220b"}]}
