)]}'
{"watcher/decision_engine/model/collector/nova.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b17bba13296b7b883fc89fafd9b5c2586ae82bda","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        :type node: :py:class:`~novaclient.v2.hypervisors.Hypervisor`"},{"line_number":304,"context_line":"        \"\"\""},{"line_number":305,"context_line":"        inventories \u003d self.placement_helper.get_inventories(node.id)"},{"line_number":306,"context_line":"        vcpus \u003d inventories[\u0027VCPU\u0027].get(\u0027total\u0027, node.vcpus)"},{"line_number":307,"context_line":"        cpu_reserved \u003d inventories[\u0027VCPU\u0027].get(\u0027reserved\u0027, 0)"},{"line_number":308,"context_line":"        cpu_ratio \u003d inventories[\u0027VCPU\u0027].get(\u0027allocation_ratio\u0027, 1.0)"},{"line_number":309,"context_line":"        memory_mb \u003d inventories[\u0027MEMORY_MB\u0027].get(\u0027total\u0027, node.memory_mb)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_7166542c","line":306,"range":{"start_line":306,"start_character":28,"end_line":306,"end_character":34},"updated":"2019-07-10 01:21:24.000000000","message":"nit: You could use the enums from the os-resource-classes library:\n\nhttps://pypi.org/project/os-resource-classes/","commit_id":"d9eacf8b666a53ff2c7346d6fa431f6ecb33b63d"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"c3523efce519be1cf1bd923c74e874e9d6aa3666","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        :type node: :py:class:`~novaclient.v2.hypervisors.Hypervisor`"},{"line_number":304,"context_line":"        \"\"\""},{"line_number":305,"context_line":"        inventories \u003d self.placement_helper.get_inventories(node.id)"},{"line_number":306,"context_line":"        vcpus \u003d inventories[\u0027VCPU\u0027].get(\u0027total\u0027, node.vcpus)"},{"line_number":307,"context_line":"        cpu_reserved \u003d inventories[\u0027VCPU\u0027].get(\u0027reserved\u0027, 0)"},{"line_number":308,"context_line":"        cpu_ratio \u003d inventories[\u0027VCPU\u0027].get(\u0027allocation_ratio\u0027, 1.0)"},{"line_number":309,"context_line":"        memory_mb \u003d inventories[\u0027MEMORY_MB\u0027].get(\u0027total\u0027, node.memory_mb)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_3ceaf074","line":306,"range":{"start_line":306,"start_character":28,"end_line":306,"end_character":34},"in_reply_to":"7faddb67_7166542c","updated":"2019-07-10 08:44:27.000000000","message":"Done","commit_id":"d9eacf8b666a53ff2c7346d6fa431f6ecb33b63d"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"da08e885da6d13155c827378af64b14c2ff2336a","unresolved":false,"context_lines":[{"line_number":353,"context_line":"            \"uuid\": node.service[\"host\"],"},{"line_number":354,"context_line":"            \"hostname\": node.hypervisor_hostname,"},{"line_number":355,"context_line":"            \"memory\": memory_mb,"},{"line_number":356,"context_line":"            \"ram_ratio\": ram_ratio,"},{"line_number":357,"context_line":"            \"memory_mb_reserved\": memory_mb_reserved,"},{"line_number":358,"context_line":"            \"memory_mb_used\": memory_used,"},{"line_number":359,"context_line":"            \"disk\": node.free_disk_gb,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_8e6a71ea","line":356,"updated":"2019-07-16 08:11:30.000000000","message":"I think the name memory_ratio would be more inline with the other attributes.","commit_id":"8594cbf629579670cede355e937dcf9016406cc7"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"f72223ac5326b7477fc2b22d701a38bdc8f2dcd1","unresolved":false,"context_lines":[{"line_number":353,"context_line":"            \"uuid\": node.service[\"host\"],"},{"line_number":354,"context_line":"            \"hostname\": node.hypervisor_hostname,"},{"line_number":355,"context_line":"            \"memory\": memory_mb,"},{"line_number":356,"context_line":"            \"ram_ratio\": ram_ratio,"},{"line_number":357,"context_line":"            \"memory_mb_reserved\": memory_mb_reserved,"},{"line_number":358,"context_line":"            \"memory_mb_used\": memory_used,"},{"line_number":359,"context_line":"            \"disk\": node.free_disk_gb,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_3b1b5dca","line":356,"in_reply_to":"7faddb67_8e6a71ea","updated":"2019-07-18 05:46:45.000000000","message":"Done","commit_id":"8594cbf629579670cede355e937dcf9016406cc7"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"da08e885da6d13155c827378af64b14c2ff2336a","unresolved":false,"context_lines":[{"line_number":363,"context_line":"            \"disk_ratio\": disk_ratio,"},{"line_number":364,"context_line":"            \"vcpus\": vcpus,"},{"line_number":365,"context_line":"            \"vcpu_reserved\": vcpu_reserved,"},{"line_number":366,"context_line":"            \"cpu_ratio\": cpu_ratio,"},{"line_number":367,"context_line":"            \"vcpus_used\": vcpus_used,"},{"line_number":368,"context_line":"            \"state\": node.state,"},{"line_number":369,"context_line":"            \"status\": node.status,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_ce64e924","line":366,"updated":"2019-07-16 08:11:30.000000000","message":"I would suggest to call this vcpu_ratio instead","commit_id":"8594cbf629579670cede355e937dcf9016406cc7"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"f72223ac5326b7477fc2b22d701a38bdc8f2dcd1","unresolved":false,"context_lines":[{"line_number":363,"context_line":"            \"disk_ratio\": disk_ratio,"},{"line_number":364,"context_line":"            \"vcpus\": vcpus,"},{"line_number":365,"context_line":"            \"vcpu_reserved\": vcpu_reserved,"},{"line_number":366,"context_line":"            \"cpu_ratio\": cpu_ratio,"},{"line_number":367,"context_line":"            \"vcpus_used\": vcpus_used,"},{"line_number":368,"context_line":"            \"state\": node.state,"},{"line_number":369,"context_line":"            \"status\": node.status,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_db7b29f2","line":366,"in_reply_to":"7faddb67_ce64e924","updated":"2019-07-18 05:46:45.000000000","message":"Done","commit_id":"8594cbf629579670cede355e937dcf9016406cc7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3ac1bf691d1fab670f55837819043fc8d3bc3846","unresolved":false,"context_lines":[{"line_number":310,"context_line":"        :param node: A node hypervisor instance"},{"line_number":311,"context_line":"        :type node: :py:class:`~novaclient.v2.hypervisors.Hypervisor`"},{"line_number":312,"context_line":"        \"\"\""},{"line_number":313,"context_line":"        inventories \u003d self.placement_helper.get_inventories(node.id)"},{"line_number":314,"context_line":"        if inventories:"},{"line_number":315,"context_line":"            vcpus \u003d inventories[orc.VCPU].get(\u0027total\u0027, node.vcpus)"},{"line_number":316,"context_line":"            vcpu_reserved \u003d inventories[orc.VCPU].get(\u0027reserved\u0027, 0)"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_eaee06ec","line":313,"updated":"2019-07-23 12:59:40.000000000","message":"Do you want to handle a 404 case here and hit the else block if the resource provider does not exist for some reason?","commit_id":"3d741d05aa6abde7d8332334909944fb710e109d"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"f44e811a4f1c101140bce3569d0d715f26e894b0","unresolved":false,"context_lines":[{"line_number":310,"context_line":"        :param node: A node hypervisor instance"},{"line_number":311,"context_line":"        :type node: :py:class:`~novaclient.v2.hypervisors.Hypervisor`"},{"line_number":312,"context_line":"        \"\"\""},{"line_number":313,"context_line":"        inventories \u003d self.placement_helper.get_inventories(node.id)"},{"line_number":314,"context_line":"        if inventories:"},{"line_number":315,"context_line":"            vcpus \u003d inventories[orc.VCPU].get(\u0027total\u0027, node.vcpus)"},{"line_number":316,"context_line":"            vcpu_reserved \u003d inventories[orc.VCPU].get(\u0027reserved\u0027, 0)"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_67cc8161","line":313,"in_reply_to":"7faddb67_eaee06ec","updated":"2019-07-24 02:15:16.000000000","message":"PlacementHelper has handled the exception.","commit_id":"3d741d05aa6abde7d8332334909944fb710e109d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3ac1bf691d1fab670f55837819043fc8d3bc3846","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        \"\"\""},{"line_number":313,"context_line":"        inventories \u003d self.placement_helper.get_inventories(node.id)"},{"line_number":314,"context_line":"        if inventories:"},{"line_number":315,"context_line":"            vcpus \u003d inventories[orc.VCPU].get(\u0027total\u0027, node.vcpus)"},{"line_number":316,"context_line":"            vcpu_reserved \u003d inventories[orc.VCPU].get(\u0027reserved\u0027, 0)"},{"line_number":317,"context_line":"            vcpu_ratio \u003d inventories[orc.VCPU].get(\u0027allocation_ratio\u0027, 1.0)"},{"line_number":318,"context_line":"            memory_mb \u003d inventories[orc.MEMORY_MB].get("}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_cabf8ace","line":315,"range":{"start_line":315,"start_character":55,"end_line":315,"end_character":65},"updated":"2019-07-23 12:59:40.000000000","message":"Here and elsewhere, you don\u0027t really need to use dict.get() with a default value since these are required parameters in the response of the resource provider inventory.\n\nThe thing that\u0027s not guaranteed to be in the response is the resource class, so that\u0027s what you should probably guard against, i.e.:\n\nif orc.VCPU in inventories:\n   vcpus \u003d inventories[orc.VCPU][\u0027total\u0027]\n   ...","commit_id":"3d741d05aa6abde7d8332334909944fb710e109d"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"f44e811a4f1c101140bce3569d0d715f26e894b0","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        \"\"\""},{"line_number":313,"context_line":"        inventories \u003d self.placement_helper.get_inventories(node.id)"},{"line_number":314,"context_line":"        if inventories:"},{"line_number":315,"context_line":"            vcpus \u003d inventories[orc.VCPU].get(\u0027total\u0027, node.vcpus)"},{"line_number":316,"context_line":"            vcpu_reserved \u003d inventories[orc.VCPU].get(\u0027reserved\u0027, 0)"},{"line_number":317,"context_line":"            vcpu_ratio \u003d inventories[orc.VCPU].get(\u0027allocation_ratio\u0027, 1.0)"},{"line_number":318,"context_line":"            memory_mb \u003d inventories[orc.MEMORY_MB].get("}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_473dc52a","line":315,"range":{"start_line":315,"start_character":55,"end_line":315,"end_character":65},"in_reply_to":"7faddb67_cabf8ace","updated":"2019-07-24 02:15:16.000000000","message":"Thanks, I will update it","commit_id":"3d741d05aa6abde7d8332334909944fb710e109d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3ac1bf691d1fab670f55837819043fc8d3bc3846","unresolved":false,"context_lines":[{"line_number":320,"context_line":"            memory_mb_reserved \u003d inventories[orc.MEMORY_MB].get(\u0027reserved\u0027, 0)"},{"line_number":321,"context_line":"            memory_ratio \u003d inventories[orc.MEMORY_MB].get("},{"line_number":322,"context_line":"                \u0027allocation_ratio\u0027, 1.0)"},{"line_number":323,"context_line":"            disk_capacity \u003d inventories[orc.DISK_GB].get("},{"line_number":324,"context_line":"                \u0027total\u0027, node.local_gb)"},{"line_number":325,"context_line":"            disk_gb_reserved \u003d inventories[orc.DISK_GB].get(\u0027reserved\u0027, 0)"},{"line_number":326,"context_line":"            disk_ratio \u003d inventories[orc.DISK_GB].get("}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_aa880e22","line":323,"range":{"start_line":323,"start_character":28,"end_line":323,"end_character":52},"updated":"2019-07-23 12:59:40.000000000","message":"In the future when nova supports shared storage providers [1] this might not be in the resource provider inventory for the compute node.\n\n[1] https://review.opendev.org/#/c/650188/","commit_id":"3d741d05aa6abde7d8332334909944fb710e109d"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"f44e811a4f1c101140bce3569d0d715f26e894b0","unresolved":false,"context_lines":[{"line_number":320,"context_line":"            memory_mb_reserved \u003d inventories[orc.MEMORY_MB].get(\u0027reserved\u0027, 0)"},{"line_number":321,"context_line":"            memory_ratio \u003d inventories[orc.MEMORY_MB].get("},{"line_number":322,"context_line":"                \u0027allocation_ratio\u0027, 1.0)"},{"line_number":323,"context_line":"            disk_capacity \u003d inventories[orc.DISK_GB].get("},{"line_number":324,"context_line":"                \u0027total\u0027, node.local_gb)"},{"line_number":325,"context_line":"            disk_gb_reserved \u003d inventories[orc.DISK_GB].get(\u0027reserved\u0027, 0)"},{"line_number":326,"context_line":"            disk_ratio \u003d inventories[orc.DISK_GB].get("}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_e77cf1ec","line":323,"range":{"start_line":323,"start_character":28,"end_line":323,"end_character":52},"in_reply_to":"7faddb67_aa880e22","updated":"2019-07-24 02:15:16.000000000","message":"thanks!","commit_id":"3d741d05aa6abde7d8332334909944fb710e109d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3ac1bf691d1fab670f55837819043fc8d3bc3846","unresolved":false,"context_lines":[{"line_number":328,"context_line":"        else:"},{"line_number":329,"context_line":"            vcpus \u003d node.vcpus"},{"line_number":330,"context_line":"            vcpu_reserved \u003d 0"},{"line_number":331,"context_line":"            vcpu_ratio \u003d 1.0"},{"line_number":332,"context_line":"            memory_mb \u003d node.memory_mb"},{"line_number":333,"context_line":"            memory_mb_reserved \u003d 0"},{"line_number":334,"context_line":"            memory_ratio \u003d 1.0"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_2ae5fe0a","line":331,"updated":"2019-07-23 12:59:40.000000000","message":"The default in nova is 16.0 but I guess this is safer if we don\u0027t know.","commit_id":"3d741d05aa6abde7d8332334909944fb710e109d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3ac1bf691d1fab670f55837819043fc8d3bc3846","unresolved":false,"context_lines":[{"line_number":341,"context_line":"        if usages:"},{"line_number":342,"context_line":"            vcpus_used \u003d usages.get(orc.VCPU, node.vcpus_used)"},{"line_number":343,"context_line":"            memory_used \u003d usages.get(orc.MEMORY_MB, node.memory_mb_used)"},{"line_number":344,"context_line":"            disk_used \u003d usages.get(orc.DISK_GB, node.local_gb_used)"},{"line_number":345,"context_line":"        else:"},{"line_number":346,"context_line":"            vcpus_used \u003d node.vcpus_used"},{"line_number":347,"context_line":"            memory_used \u003d node.memory_mb_used"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_0a73624f","line":344,"range":{"start_line":344,"start_character":31,"end_line":344,"end_character":34},"updated":"2019-07-23 12:59:40.000000000","message":"This looks better in the case that the resource class isn\u0027t in the usages dict. Still need to be aware of that shared storage provider case at some point, but that\u0027s likely not something that will be done in Train.","commit_id":"3d741d05aa6abde7d8332334909944fb710e109d"}],"watcher/decision_engine/model/element/node.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b17bba13296b7b883fc89fafd9b5c2586ae82bda","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        \"disk_gb_used\": wfields.NonNegativeIntegerField(),"},{"line_number":49,"context_line":"        \"vcpus\": wfields.NonNegativeIntegerField(),"},{"line_number":50,"context_line":"        \"vcpus_used\": wfields.NonNegativeIntegerField(),"},{"line_number":51,"context_line":"        \"cpu_reserved\": wfields.NonNegativeIntegerField(),"},{"line_number":52,"context_line":"        \"ram_ratio\": wfields.NonNegativeIntegerField(),"},{"line_number":53,"context_line":"        \"cpu_ratio\": wfields.NonNegativeIntegerField(),"},{"line_number":54,"context_line":"        \"disk_ratio\": wfields.NonNegativeIntegerField(),"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_51beb865","line":51,"range":{"start_line":51,"start_character":9,"end_line":51,"end_character":12},"updated":"2019-07-10 01:21:24.000000000","message":"You might want to make this vcpu_reserved to match the pattern with memory_mb and disk_gb (and to match the VCPU resource class).","commit_id":"d9eacf8b666a53ff2c7346d6fa431f6ecb33b63d"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"c3523efce519be1cf1bd923c74e874e9d6aa3666","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        \"disk_gb_used\": wfields.NonNegativeIntegerField(),"},{"line_number":49,"context_line":"        \"vcpus\": wfields.NonNegativeIntegerField(),"},{"line_number":50,"context_line":"        \"vcpus_used\": wfields.NonNegativeIntegerField(),"},{"line_number":51,"context_line":"        \"cpu_reserved\": wfields.NonNegativeIntegerField(),"},{"line_number":52,"context_line":"        \"ram_ratio\": wfields.NonNegativeIntegerField(),"},{"line_number":53,"context_line":"        \"cpu_ratio\": wfields.NonNegativeIntegerField(),"},{"line_number":54,"context_line":"        \"disk_ratio\": wfields.NonNegativeIntegerField(),"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_b7ab591b","line":51,"range":{"start_line":51,"start_character":9,"end_line":51,"end_character":12},"in_reply_to":"7faddb67_51beb865","updated":"2019-07-10 08:44:27.000000000","message":"Done","commit_id":"d9eacf8b666a53ff2c7346d6fa431f6ecb33b63d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b17bba13296b7b883fc89fafd9b5c2586ae82bda","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        \"vcpus\": wfields.NonNegativeIntegerField(),"},{"line_number":50,"context_line":"        \"vcpus_used\": wfields.NonNegativeIntegerField(),"},{"line_number":51,"context_line":"        \"cpu_reserved\": wfields.NonNegativeIntegerField(),"},{"line_number":52,"context_line":"        \"ram_ratio\": wfields.NonNegativeIntegerField(),"},{"line_number":53,"context_line":"        \"cpu_ratio\": wfields.NonNegativeIntegerField(),"},{"line_number":54,"context_line":"        \"disk_ratio\": wfields.NonNegativeIntegerField(),"},{"line_number":55,"context_line":"    }"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def accept(self, visitor):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_f18324a8","line":54,"range":{"start_line":52,"start_character":8,"end_line":54,"end_character":56},"updated":"2019-07-10 01:21:24.000000000","message":"These should be floats.\n\nhttps://developer.openstack.org/api-ref/placement/?expanded\u003dlist-resource-provider-inventories-detail#list-resource-provider-inventories","commit_id":"d9eacf8b666a53ff2c7346d6fa431f6ecb33b63d"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"c3523efce519be1cf1bd923c74e874e9d6aa3666","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        \"vcpus\": wfields.NonNegativeIntegerField(),"},{"line_number":50,"context_line":"        \"vcpus_used\": wfields.NonNegativeIntegerField(),"},{"line_number":51,"context_line":"        \"cpu_reserved\": wfields.NonNegativeIntegerField(),"},{"line_number":52,"context_line":"        \"ram_ratio\": wfields.NonNegativeIntegerField(),"},{"line_number":53,"context_line":"        \"cpu_ratio\": wfields.NonNegativeIntegerField(),"},{"line_number":54,"context_line":"        \"disk_ratio\": wfields.NonNegativeIntegerField(),"},{"line_number":55,"context_line":"    }"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def accept(self, visitor):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_3728c932","line":54,"range":{"start_line":52,"start_character":8,"end_line":54,"end_character":56},"in_reply_to":"7faddb67_f18324a8","updated":"2019-07-10 08:44:27.000000000","message":"Done","commit_id":"d9eacf8b666a53ff2c7346d6fa431f6ecb33b63d"},{"author":{"_account_id":29911,"name":"Dantali0n","email":"info@dantalion.nl","username":"Dantali0n"},"change_message_id":"da08e885da6d13155c827378af64b14c2ff2336a","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def accept(self, visitor):"},{"line_number":58,"context_line":"        raise NotImplementedError()"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"@base.WatcherObjectRegistry.register_if(False)"},{"line_number":62,"context_line":"class StorageNode(storage_resource.StorageResource):"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_2e549d20","line":59,"updated":"2019-07-16 08:11:30.000000000","message":"I think we should add methods to return the amount of free disk, memory, vcpu\u0027s with the formula defined in https://review.opendev.org/#/c/668639/7/specs/train/approved/improve-compute-data-model.rst. Otherwise each of the strategies to use placement would have to implement it itself.","commit_id":"8594cbf629579670cede355e937dcf9016406cc7"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"f72223ac5326b7477fc2b22d701a38bdc8f2dcd1","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def accept(self, visitor):"},{"line_number":58,"context_line":"        raise NotImplementedError()"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"@base.WatcherObjectRegistry.register_if(False)"},{"line_number":62,"context_line":"class StorageNode(storage_resource.StorageResource):"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_1bfc613c","line":59,"in_reply_to":"7faddb67_2e549d20","updated":"2019-07-18 05:46:45.000000000","message":"Done","commit_id":"8594cbf629579670cede355e937dcf9016406cc7"}],"watcher/tests/decision_engine/cluster/test_model_builder.py":[{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"9763de12bbaeccefb8462105d2a74766a38bae79","unresolved":false,"context_lines":[{"line_number":178,"context_line":"    @mock.patch.object(placement_helper, \u0027PlacementHelper\u0027)"},{"line_number":179,"context_line":"    @mock.patch.object(nova_helper, \u0027NovaHelper\u0027)"},{"line_number":180,"context_line":"    def test_add_physical_layer_with_baremetal_node(self, m_nova,"},{"line_number":181,"context_line":"                                                    m_placement):"},{"line_number":182,"context_line":"        \"\"\"\"\"\""},{"line_number":183,"context_line":"        mock_placement \u003d mock.Mock(name\u003d\"placement_helper\")"},{"line_number":184,"context_line":"        m_placement.return_value \u003d mock_placement"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_d25d5c47","line":181,"range":{"start_line":181,"start_character":52,"end_line":181,"end_character":63},"updated":"2019-07-17 07:18:11.000000000","message":"I suggest to use m_placement_helper, because this is not easy to distinguish with mock_placement in Line 183.","commit_id":"8594cbf629579670cede355e937dcf9016406cc7"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"f72223ac5326b7477fc2b22d701a38bdc8f2dcd1","unresolved":false,"context_lines":[{"line_number":178,"context_line":"    @mock.patch.object(placement_helper, \u0027PlacementHelper\u0027)"},{"line_number":179,"context_line":"    @mock.patch.object(nova_helper, \u0027NovaHelper\u0027)"},{"line_number":180,"context_line":"    def test_add_physical_layer_with_baremetal_node(self, m_nova,"},{"line_number":181,"context_line":"                                                    m_placement):"},{"line_number":182,"context_line":"        \"\"\"\"\"\""},{"line_number":183,"context_line":"        mock_placement \u003d mock.Mock(name\u003d\"placement_helper\")"},{"line_number":184,"context_line":"        m_placement.return_value \u003d mock_placement"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_1b91c1f1","line":181,"range":{"start_line":181,"start_character":52,"end_line":181,"end_character":63},"in_reply_to":"7faddb67_d25d5c47","updated":"2019-07-18 05:46:45.000000000","message":"Done","commit_id":"8594cbf629579670cede355e937dcf9016406cc7"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"bc48e89381662d2927bf2ab1542582f81ec59d78","unresolved":false,"context_lines":[{"line_number":181,"context_line":"                                                    m_placement):"},{"line_number":182,"context_line":"        \"\"\"\"\"\""},{"line_number":183,"context_line":"        mock_placement \u003d mock.Mock(name\u003d\"placement_helper\")"},{"line_number":184,"context_line":"        m_placement.return_value \u003d mock_placement"},{"line_number":185,"context_line":"        mock_placement.get_inventories.return_value \u003d dict()"},{"line_number":186,"context_line":"        mock_placement.get_usages_for_resource_provider.return_value \u003d dict()"},{"line_number":187,"context_line":"        m_nova.return_value.get_aggregate_list.return_value \u003d \\"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_12169456","line":184,"range":{"start_line":184,"start_character":8,"end_line":184,"end_character":49},"updated":"2019-07-17 07:27:16.000000000","message":"This line could put below Line186.","commit_id":"8594cbf629579670cede355e937dcf9016406cc7"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"f72223ac5326b7477fc2b22d701a38bdc8f2dcd1","unresolved":false,"context_lines":[{"line_number":181,"context_line":"                                                    m_placement):"},{"line_number":182,"context_line":"        \"\"\"\"\"\""},{"line_number":183,"context_line":"        mock_placement \u003d mock.Mock(name\u003d\"placement_helper\")"},{"line_number":184,"context_line":"        m_placement.return_value \u003d mock_placement"},{"line_number":185,"context_line":"        mock_placement.get_inventories.return_value \u003d dict()"},{"line_number":186,"context_line":"        mock_placement.get_usages_for_resource_provider.return_value \u003d dict()"},{"line_number":187,"context_line":"        m_nova.return_value.get_aggregate_list.return_value \u003d \\"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_7b86b5bb","line":184,"range":{"start_line":184,"start_character":8,"end_line":184,"end_character":49},"in_reply_to":"7faddb67_12169456","updated":"2019-07-18 05:46:45.000000000","message":"Done","commit_id":"8594cbf629579670cede355e937dcf9016406cc7"}],"watcher/tests/decision_engine/cluster/test_nova_cdmc.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b17bba13296b7b883fc89fafd9b5c2586ae82bda","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        m_placement_helper_cls.return_value \u003d m_placement_helper"},{"line_number":41,"context_line":"        m_placement_helper.get_inventories.return_value \u003d {"},{"line_number":42,"context_line":"            \"VCPU\": {"},{"line_number":43,"context_line":"                \"allocation_ratio\": 16.0,"},{"line_number":44,"context_line":"                \"total\": 8,"},{"line_number":45,"context_line":"                \"reserved\": 0,"},{"line_number":46,"context_line":"                \"step_size\": 1,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_31bbfc72","line":43,"updated":"2019-07-10 01:21:24.000000000","message":"Why doesn\u0027t this cause a problem when the data model field is defined as NonNegativeIntegerField? Does the value get cast somehow from float to int?","commit_id":"d9eacf8b666a53ff2c7346d6fa431f6ecb33b63d"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"c3523efce519be1cf1bd923c74e874e9d6aa3666","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        m_placement_helper_cls.return_value \u003d m_placement_helper"},{"line_number":41,"context_line":"        m_placement_helper.get_inventories.return_value \u003d {"},{"line_number":42,"context_line":"            \"VCPU\": {"},{"line_number":43,"context_line":"                \"allocation_ratio\": 16.0,"},{"line_number":44,"context_line":"                \"total\": 8,"},{"line_number":45,"context_line":"                \"reserved\": 0,"},{"line_number":46,"context_line":"                \"step_size\": 1,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7faddb67_17ad8d30","line":43,"in_reply_to":"7faddb67_31bbfc72","updated":"2019-07-10 08:44:27.000000000","message":"It seems that no check on the type of data.","commit_id":"d9eacf8b666a53ff2c7346d6fa431f6ecb33b63d"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"bc48e89381662d2927bf2ab1542582f81ec59d78","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    def test_nova_cdmc_execute(self, m_nova_helper_cls,"},{"line_number":39,"context_line":"                               m_placement_helper_cls):"},{"line_number":40,"context_line":"        m_placement_helper \u003d mock.Mock(name\u003d\"placement_helper\")"},{"line_number":41,"context_line":"        m_placement_helper_cls.return_value \u003d m_placement_helper"},{"line_number":42,"context_line":"        m_placement_helper.get_inventories.return_value \u003d {"},{"line_number":43,"context_line":"            orc.VCPU: {"},{"line_number":44,"context_line":"                \"allocation_ratio\": 16.0,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_6d1b6972","line":41,"range":{"start_line":41,"start_character":8,"end_line":41,"end_character":64},"updated":"2019-07-17 07:27:16.000000000","message":"ditto, This line could be put below Line69.","commit_id":"8594cbf629579670cede355e937dcf9016406cc7"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"f72223ac5326b7477fc2b22d701a38bdc8f2dcd1","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    def test_nova_cdmc_execute(self, m_nova_helper_cls,"},{"line_number":39,"context_line":"                               m_placement_helper_cls):"},{"line_number":40,"context_line":"        m_placement_helper \u003d mock.Mock(name\u003d\"placement_helper\")"},{"line_number":41,"context_line":"        m_placement_helper_cls.return_value \u003d m_placement_helper"},{"line_number":42,"context_line":"        m_placement_helper.get_inventories.return_value \u003d {"},{"line_number":43,"context_line":"            orc.VCPU: {"},{"line_number":44,"context_line":"                \"allocation_ratio\": 16.0,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_e1baf2be","line":41,"range":{"start_line":41,"start_character":8,"end_line":41,"end_character":64},"in_reply_to":"7faddb67_6d1b6972","updated":"2019-07-18 05:46:45.000000000","message":"Done","commit_id":"8594cbf629579670cede355e937dcf9016406cc7"}]}
