)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d92301c6ab59e11964db6d8e084aa504ba326096","unresolved":false,"context_lines":[{"line_number":12,"context_line":"https://review.opendev.org/#/c/626057/10/cyborg/common/placement_client.py,"},{"line_number":13,"context_line":"we should make a class to invoke Placement API. This has also been done in"},{"line_number":14,"context_line":"this patch."},{"line_number":15,"context_line":"4. Convert cyborg/objects/driver_objects/driver_device.py file type from dos to"},{"line_number":16,"context_line":"unix, to avoid ^M at the end of each line."},{"line_number":17,"context_line":"4. More info for driver developers:  each driver should report resource class"},{"line_number":18,"context_line":"and traits in driver_attribute field in order that cyborg-conductor can parse"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7faddb67_d2d4e3eb","line":15,"updated":"2019-07-26 18:37:54.000000000","message":"This - and maybe all of the steps in here - should be split into a series of changes. It\u0027s very hard to review a giant patch like this in its current form, so ease the burden on reviewers by splitting it into a series of changes. This is holding up the work on the nova side for the nova/cyborg integration and feature freeze for Train is in less than two months.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7242f2bad6e5e6227166217d58b8a13d7c9527ae","unresolved":false,"context_lines":[{"line_number":12,"context_line":"https://review.opendev.org/#/c/626057/10/cyborg/common/placement_client.py,"},{"line_number":13,"context_line":"we should make a class to invoke Placement API. This has also been done in"},{"line_number":14,"context_line":"this patch."},{"line_number":15,"context_line":"4. Convert cyborg/objects/driver_objects/driver_device.py file type from dos to"},{"line_number":16,"context_line":"unix, to avoid ^M at the end of each line."},{"line_number":17,"context_line":"4. More info for driver developers:  each driver should report resource class"},{"line_number":18,"context_line":"and traits in driver_attribute field in order that cyborg-conductor can parse"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7faddb67_d2edc3b7","line":15,"in_reply_to":"7faddb67_d2d4e3eb","updated":"2019-07-26 18:40:16.000000000","message":"If you\u0027re not familiar, https://docs.openstack.org/infra/manual/developers.html#adding-a-dependency might help with creating a topic branch series of changes and rebasing them.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"0c41d671c7ea8398c93015a18ff8b133add3dc35","unresolved":false,"context_lines":[{"line_number":12,"context_line":"https://review.opendev.org/#/c/626057/10/cyborg/common/placement_client.py,"},{"line_number":13,"context_line":"we should make a class to invoke Placement API. This has also been done in"},{"line_number":14,"context_line":"this patch."},{"line_number":15,"context_line":"4. Convert cyborg/objects/driver_objects/driver_device.py file type from dos to"},{"line_number":16,"context_line":"unix, to avoid ^M at the end of each line."},{"line_number":17,"context_line":"4. More info for driver developers:  each driver should report resource class"},{"line_number":18,"context_line":"and traits in driver_attribute field in order that cyborg-conductor can parse"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7faddb67_0f2b26eb","line":15,"in_reply_to":"7faddb67_d2d4e3eb","updated":"2019-07-29 02:45:40.000000000","message":"These steps I listed here is not linear tasks, it just shows what has been implemented in this patch. They are tight coupling so IMHO it will be not easy to understand if I separated it.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"}],"cyborg/accelerator/drivers/fpga/intel/sysinfo.py":[{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"61d090c340a3a963775e50d87d7858924dc2a977","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    driver_attach_handle, driver_controlpath_id, driver_attribute"},{"line_number":30,"context_line":"from cyborg.common import constants"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"SYS_FPGA \u003d \"/tmp/sys/class/fpga\""},{"line_number":33,"context_line":"DEVICE \u003d \"device\""},{"line_number":34,"context_line":"PF \u003d \"physfn\""},{"line_number":35,"context_line":"VF \u003d \"virtfn*\""}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_9860b603","line":32,"updated":"2019-05-23 12:21:04.000000000","message":"Don\u0027t forget to recover it. :)","commit_id":"4cfda626b00f43725334e8dac9aa438816f84fed"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":315,"context_line":"                index \u003d index + 1"},{"line_number":316,"context_line":"                driver_attr.value \u003d val"},{"line_number":317,"context_line":"                attr_list.append(driver_attr)"},{"line_number":318,"context_line":"    if fpga.get(\"regions\", None):"},{"line_number":319,"context_line":"        for vf in fpga[\"regions\"]:"},{"line_number":320,"context_line":"            for k, v in vf.items():"},{"line_number":321,"context_line":"                if k \u003d\u003d \"traits\":"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_e3983776","line":318,"range":{"start_line":318,"start_character":27,"end_line":318,"end_character":31},"updated":"2019-07-26 15:22:50.000000000","message":"nit: redundant","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":315,"context_line":"                index \u003d index + 1"},{"line_number":316,"context_line":"                driver_attr.value \u003d val"},{"line_number":317,"context_line":"                attr_list.append(driver_attr)"},{"line_number":318,"context_line":"    if fpga.get(\"regions\", None):"},{"line_number":319,"context_line":"        for vf in fpga[\"regions\"]:"},{"line_number":320,"context_line":"            for k, v in vf.items():"},{"line_number":321,"context_line":"                if k \u003d\u003d \"traits\":"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_208fa875","line":318,"range":{"start_line":318,"start_character":27,"end_line":318,"end_character":31},"in_reply_to":"7faddb67_e3983776","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        for vf in fpga[\"regions\"]:"},{"line_number":320,"context_line":"            for k, v in vf.items():"},{"line_number":321,"context_line":"                if k \u003d\u003d \"traits\":"},{"line_number":322,"context_line":"                    values \u003d vf.get(k, None)"},{"line_number":323,"context_line":"                    for val in values:"},{"line_number":324,"context_line":"                        driver_attr \u003d driver_attribute.DriverAttribute()"},{"line_number":325,"context_line":"                        driver_attr.key \u003d \"trait\" + str(index)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_43834b05","line":322,"range":{"start_line":322,"start_character":20,"end_line":322,"end_character":44},"updated":"2019-07-26 15:22:50.000000000","message":"you already have the value in `v` from L320","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        for vf in fpga[\"regions\"]:"},{"line_number":320,"context_line":"            for k, v in vf.items():"},{"line_number":321,"context_line":"                if k \u003d\u003d \"traits\":"},{"line_number":322,"context_line":"                    values \u003d vf.get(k, None)"},{"line_number":323,"context_line":"                    for val in values:"},{"line_number":324,"context_line":"                        driver_attr \u003d driver_attribute.DriverAttribute()"},{"line_number":325,"context_line":"                        driver_attr.key \u003d \"trait\" + str(index)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_408ae463","line":322,"range":{"start_line":322,"start_character":20,"end_line":322,"end_character":44},"in_reply_to":"7faddb67_43834b05","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":321,"context_line":"                if k \u003d\u003d \"traits\":"},{"line_number":322,"context_line":"                    values \u003d vf.get(k, None)"},{"line_number":323,"context_line":"                    for val in values:"},{"line_number":324,"context_line":"                        driver_attr \u003d driver_attribute.DriverAttribute()"},{"line_number":325,"context_line":"                        driver_attr.key \u003d \"trait\" + str(index)"},{"line_number":326,"context_line":"                        index \u003d index + 1"},{"line_number":327,"context_line":"                        driver_attr.value \u003d val"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_e3bfd7a7","line":324,"updated":"2019-07-26 15:22:50.000000000","message":"nit: why isn\u0027t this just\n\n driver_attr \u003d driver_attribute.DriverAttribute(\n     key\u003d\"trait\" + str(index), value\u003dval)\n\n?","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":321,"context_line":"                if k \u003d\u003d \"traits\":"},{"line_number":322,"context_line":"                    values \u003d vf.get(k, None)"},{"line_number":323,"context_line":"                    for val in values:"},{"line_number":324,"context_line":"                        driver_attr \u003d driver_attribute.DriverAttribute()"},{"line_number":325,"context_line":"                        driver_attr.key \u003d \"trait\" + str(index)"},{"line_number":326,"context_line":"                        index \u003d index + 1"},{"line_number":327,"context_line":"                        driver_attr.value \u003d val"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_e0eaf00c","line":324,"in_reply_to":"7faddb67_e3bfd7a7","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"c49616fc8f7c9f9a71f94cae3fc0d8a8e779073c","unresolved":false,"context_lines":[{"line_number":32,"context_line":"PCI_DEVICES_PATH \u003d \"/sys/bus/pci/devices\""},{"line_number":33,"context_line":"PCI_DEVICES_PATH_PATTERN \u003d \"/sys/bus/pci/devices/*\""},{"line_number":34,"context_line":"# TODO(shaohe) The KNOW_FPGAS can be configurable."},{"line_number":35,"context_line":"KNOW_FPGAS \u003d [(\"0x8086\", \"0x09c4\")]"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"INTEL_FPGA_DEV_PREFIX \u003d \"intel-fpga-dev\""},{"line_number":38,"context_line":"SYS_FPGA \u003d \"/sys/class/fpga\""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_5103e310","line":35,"updated":"2019-08-15 06:59:49.000000000","message":"KNOWN_FPGAS: This typo happens in many places.","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"6148352e9cff2840a42f05bf662275e1d30a9973","unresolved":false,"context_lines":[{"line_number":32,"context_line":"PCI_DEVICES_PATH \u003d \"/sys/bus/pci/devices\""},{"line_number":33,"context_line":"PCI_DEVICES_PATH_PATTERN \u003d \"/sys/bus/pci/devices/*\""},{"line_number":34,"context_line":"# TODO(shaohe) The KNOW_FPGAS can be configurable."},{"line_number":35,"context_line":"KNOW_FPGAS \u003d [(\"0x8086\", \"0x09c4\")]"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"INTEL_FPGA_DEV_PREFIX \u003d \"intel-fpga-dev\""},{"line_number":38,"context_line":"SYS_FPGA \u003d \"/sys/class/fpga\""}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_f5574959","line":35,"in_reply_to":"7faddb67_5103e310","updated":"2019-08-16 03:04:36.000000000","message":"Done","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"c49616fc8f7c9f9a71f94cae3fc0d8a8e779073c","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    )"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"def get_region_ids(name):"},{"line_number":170,"context_line":"    return map("},{"line_number":171,"context_line":"        read_line,"},{"line_number":172,"context_line":"        glob.glob("}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_518e83d1","line":169,"range":{"start_line":169,"start_character":19,"end_line":169,"end_character":23},"updated":"2019-08-15 06:59:49.000000000","message":"Minor: could we call this device_name or something more meaningful? Also, give an example of what it looks like.","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"6148352e9cff2840a42f05bf662275e1d30a9973","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    )"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"def get_region_ids(name):"},{"line_number":170,"context_line":"    return map("},{"line_number":171,"context_line":"        read_line,"},{"line_number":172,"context_line":"        glob.glob("}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_155d4578","line":169,"range":{"start_line":169,"start_character":19,"end_line":169,"end_character":23},"in_reply_to":"7faddb67_518e83d1","updated":"2019-08-16 03:04:36.000000000","message":"Done","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"c49616fc8f7c9f9a71f94cae3fc0d8a8e779073c","unresolved":false,"context_lines":[{"line_number":182,"context_line":"    # \"CUSTOM_PROGRAMMABLE\" not support at present"},{"line_number":183,"context_line":"    traits \u003d []"},{"line_number":184,"context_line":"    if not vf:"},{"line_number":185,"context_line":"        traits.append(\"CUSTOM_FPGA_INTEL\")"},{"line_number":186,"context_line":"    else:"},{"line_number":187,"context_line":"        for i in get_afu_ids(name):"},{"line_number":188,"context_line":"            l \u003d \"CUSTOM_FPGA_INTEL_FUNCTION_\" + i.upper()"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_ac38bcd2","line":185,"updated":"2019-08-15 06:59:49.000000000","message":"Need to think about whether we need this trait.","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"969ad934326f515cf3a0022c3540552dcb2c6dec","unresolved":false,"context_lines":[{"line_number":182,"context_line":"    # \"CUSTOM_PROGRAMMABLE\" not support at present"},{"line_number":183,"context_line":"    traits \u003d []"},{"line_number":184,"context_line":"    if not vf:"},{"line_number":185,"context_line":"        traits.append(\"CUSTOM_FPGA_INTEL\")"},{"line_number":186,"context_line":"    else:"},{"line_number":187,"context_line":"        for i in get_afu_ids(name):"},{"line_number":188,"context_line":"            l \u003d \"CUSTOM_FPGA_INTEL_FUNCTION_\" + i.upper()"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_c37c5eb8","line":185,"in_reply_to":"7faddb67_730d608d","updated":"2019-08-23 05:59:16.000000000","message":"Done","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b1ae839e7c65728ea187b83b2cd0f2ac2bdb6b73","unresolved":false,"context_lines":[{"line_number":182,"context_line":"    # \"CUSTOM_PROGRAMMABLE\" not support at present"},{"line_number":183,"context_line":"    traits \u003d []"},{"line_number":184,"context_line":"    if not vf:"},{"line_number":185,"context_line":"        traits.append(\"CUSTOM_FPGA_INTEL\")"},{"line_number":186,"context_line":"    else:"},{"line_number":187,"context_line":"        for i in get_afu_ids(name):"},{"line_number":188,"context_line":"            l \u003d \"CUSTOM_FPGA_INTEL_FUNCTION_\" + i.upper()"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_730d608d","line":185,"in_reply_to":"7faddb67_954855b3","updated":"2019-08-21 16:37:18.000000000","message":"We need another trait too: CUSTOM_FPGA_INTEL_ARRIA10, based on PCI device ID (09C4/09C5).","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"6148352e9cff2840a42f05bf662275e1d30a9973","unresolved":false,"context_lines":[{"line_number":182,"context_line":"    # \"CUSTOM_PROGRAMMABLE\" not support at present"},{"line_number":183,"context_line":"    traits \u003d []"},{"line_number":184,"context_line":"    if not vf:"},{"line_number":185,"context_line":"        traits.append(\"CUSTOM_FPGA_INTEL\")"},{"line_number":186,"context_line":"    else:"},{"line_number":187,"context_line":"        for i in get_afu_ids(name):"},{"line_number":188,"context_line":"            l \u003d \"CUSTOM_FPGA_INTEL_FUNCTION_\" + i.upper()"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_954855b3","line":185,"in_reply_to":"7faddb67_ac38bcd2","updated":"2019-08-16 03:04:36.000000000","message":"This trait shows the vendor of device, which allow user to choose the vender they want.","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b1ae839e7c65728ea187b83b2cd0f2ac2bdb6b73","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        traits.append(\"CUSTOM_FPGA_INTEL\")"},{"line_number":186,"context_line":"    else:"},{"line_number":187,"context_line":"        for i in get_afu_ids(name):"},{"line_number":188,"context_line":"            l \u003d \"CUSTOM_FPGA_INTEL_FUNCTION_\" + i.upper()"},{"line_number":189,"context_line":"            traits.append(l)"},{"line_number":190,"context_line":"        for i in get_region_ids(name):"},{"line_number":191,"context_line":"            l \u003d \"CUSTOM_FPGA_INTEL_REGION_\" + i.upper()"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_539b8415","line":188,"updated":"2019-08-21 16:37:18.000000000","message":"Needs to be aligned with spec [1]. Should be like CUSTOM_FPGA_FUNCTION_ID_\u003cvendor\u003e_... \n\nThe ID part is important, to distinguish from name. The vendor part must come after that, so that generic Cyborg code can locate these traits easily (e.g. objects/ext_arq.py).\n\n[1] https://review.opendev.org/gitweb?p\u003dopenstack/cyborg-specs.git;f\u003dspecs/train/approved/cyborg-nova-placement.rst;hb\u003drefs/changes/45/603545/7#l179","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"969ad934326f515cf3a0022c3540552dcb2c6dec","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        traits.append(\"CUSTOM_FPGA_INTEL\")"},{"line_number":186,"context_line":"    else:"},{"line_number":187,"context_line":"        for i in get_afu_ids(name):"},{"line_number":188,"context_line":"            l \u003d \"CUSTOM_FPGA_INTEL_FUNCTION_\" + i.upper()"},{"line_number":189,"context_line":"            traits.append(l)"},{"line_number":190,"context_line":"        for i in get_region_ids(name):"},{"line_number":191,"context_line":"            l \u003d \"CUSTOM_FPGA_INTEL_REGION_\" + i.upper()"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_035cb64a","line":188,"in_reply_to":"7faddb67_539b8415","updated":"2019-08-23 05:59:16.000000000","message":"Done","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"1d1de6a4d7873946f7e539bed937c8b92ab27e6d","unresolved":false,"context_lines":[{"line_number":310,"context_line":"    for k, v in fpga.items():"},{"line_number":311,"context_line":"        if k \u003d\u003d \"rc\":"},{"line_number":312,"context_line":"            driver_attr \u003d driver_attribute.DriverAttribute()"},{"line_number":313,"context_line":"            driver_attr.key \u003d k"},{"line_number":314,"context_line":"            driver_attr.value \u003d fpga.get(k, None)"},{"line_number":315,"context_line":"            attr_list.append(driver_attr)"},{"line_number":316,"context_line":"        if k \u003d\u003d \"traits\":"},{"line_number":317,"context_line":"            values \u003d fpga.get(k, None)"}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_4d915b46","line":314,"range":{"start_line":313,"start_character":0,"end_line":314,"end_character":49},"updated":"2019-08-26 14:11:49.000000000","message":"For this file, This two lines code could be optimzed like:\ndriver_attr.key, driver_attr.value \u003d k,v\nWe can modify it in another patch.","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a8da626b144c99b17b2d60b16047064b05401e8c","unresolved":false,"context_lines":[{"line_number":310,"context_line":"    for k, v in fpga.items():"},{"line_number":311,"context_line":"        if k \u003d\u003d \"rc\":"},{"line_number":312,"context_line":"            driver_attr \u003d driver_attribute.DriverAttribute()"},{"line_number":313,"context_line":"            driver_attr.key \u003d k"},{"line_number":314,"context_line":"            driver_attr.value \u003d fpga.get(k, None)"},{"line_number":315,"context_line":"            attr_list.append(driver_attr)"},{"line_number":316,"context_line":"        if k \u003d\u003d \"traits\":"},{"line_number":317,"context_line":"            values \u003d fpga.get(k, None)"}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_d7514edb","line":314,"range":{"start_line":313,"start_character":0,"end_line":314,"end_character":49},"in_reply_to":"7faddb67_4d915b46","updated":"2019-08-27 01:50:01.000000000","message":"Done","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"1d1de6a4d7873946f7e539bed937c8b92ab27e6d","unresolved":false,"context_lines":[{"line_number":327,"context_line":"                if k \u003d\u003d \"traits\":"},{"line_number":328,"context_line":"                    for val in values:"},{"line_number":329,"context_line":"                        driver_attr \u003d driver_attribute.DriverAttribute("},{"line_number":330,"context_line":"                            key\u003d\"trait\" + str(index),"},{"line_number":331,"context_line":"                            value\u003dval"},{"line_number":332,"context_line":"                        )"},{"line_number":333,"context_line":"                        index \u003d index + 1"},{"line_number":334,"context_line":"                        # driver_attr.value \u003d \"CUSTOM_UPDATED_TRAITS2\""}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_0de923b6","line":331,"range":{"start_line":330,"start_character":28,"end_line":331,"end_character":37},"updated":"2019-08-26 14:11:49.000000000","message":"Hi, xinran. E225 missing whitespace around operator. This error should be detected by pep8 check. I will use flake8 to replace pep8 and fix all the errors. I suggest this line like:\n value \u003d val.","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a8da626b144c99b17b2d60b16047064b05401e8c","unresolved":false,"context_lines":[{"line_number":327,"context_line":"                if k \u003d\u003d \"traits\":"},{"line_number":328,"context_line":"                    for val in values:"},{"line_number":329,"context_line":"                        driver_attr \u003d driver_attribute.DriverAttribute("},{"line_number":330,"context_line":"                            key\u003d\"trait\" + str(index),"},{"line_number":331,"context_line":"                            value\u003dval"},{"line_number":332,"context_line":"                        )"},{"line_number":333,"context_line":"                        index \u003d index + 1"},{"line_number":334,"context_line":"                        # driver_attr.value \u003d \"CUSTOM_UPDATED_TRAITS2\""}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_f74c8a40","line":331,"range":{"start_line":330,"start_character":28,"end_line":331,"end_character":37},"in_reply_to":"7faddb67_0de923b6","updated":"2019-08-27 01:50:01.000000000","message":"I think we don\u0027t need whitespace here, the value\u003dval is parameter for instantiating a DriverAttribute.","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"825c27a28ef4ebfdab0356f88c408247176117e5","unresolved":false,"context_lines":[{"line_number":327,"context_line":"                if k \u003d\u003d \"traits\":"},{"line_number":328,"context_line":"                    for val in values:"},{"line_number":329,"context_line":"                        driver_attr \u003d driver_attribute.DriverAttribute("},{"line_number":330,"context_line":"                            key\u003d\"trait\" + str(index),"},{"line_number":331,"context_line":"                            value\u003dval"},{"line_number":332,"context_line":"                        )"},{"line_number":333,"context_line":"                        index \u003d index + 1"},{"line_number":334,"context_line":"                        # driver_attr.value \u003d \"CUSTOM_UPDATED_TRAITS2\""}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_97b996ed","line":331,"range":{"start_line":330,"start_character":28,"end_line":331,"end_character":37},"in_reply_to":"7faddb67_f74c8a40","updated":"2019-08-27 02:10:09.000000000","message":"Ye, you are right. I didn\u0027t see it clearly.","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"5cd94e5d144e7a0325171685fd253125fd96225e","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            l \u003d \"CUSTOM_FPGA_FUNCTION_ID_INTEL_\" + i.upper()"},{"line_number":196,"context_line":"            traits.append(l)"},{"line_number":197,"context_line":"        for i in get_region_ids(device_name):"},{"line_number":198,"context_line":"            l \u003d \"CUSTOM_FPGA_INTEL_REGION_\" + i.upper()"},{"line_number":199,"context_line":"            traits.append(l)"},{"line_number":200,"context_line":"    return {\"traits\": traits}"},{"line_number":201,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"7faddb67_32b5377f","line":198,"range":{"start_line":198,"start_character":17,"end_line":198,"end_character":41},"updated":"2019-08-28 07:01:31.000000000","message":"Should be CUSTOM_FPGA_REGION_INTEL_... per [1], and also for uniformity with function ID trait.\n\n[1] https://review.opendev.org/gitweb?p\u003dopenstack/cyborg-specs.git;f\u003dspecs/train/approved/cyborg-nova-placement.rst;hb\u003drefs/changes/45/603545/7#l173","commit_id":"7db4870df7d8836571095a1f39d305cd9dc59980"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"d802519d5c12ebcb85eadee8f2231f44bc802892","unresolved":false,"context_lines":[{"line_number":47,"context_line":"DEVICE_FILE_HANDLER \u003d {}"},{"line_number":48,"context_line":"DEVICE_EXPOSED \u003d [\"vendor\", \"device\"]"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"PRODUCT_MAP \u003d {\"0x09c4\": \"ARRIA10\"}"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def read_line(filename):"}],"source_content_type":"text/x-python","patch_set":19,"id":"7faddb67_bc59d9fd","line":50,"range":{"start_line":50,"start_character":26,"end_line":50,"end_character":33},"updated":"2019-08-29 21:40:31.000000000","message":"This should be \"PAC_ARRIA10\". The PAC card has A10 chip with this device ID, whereas other products with A10 may have different PF/VF IDs.\n\nCorrespondingly, the trait would be CUSTOM_FPGA_INTEL_PAC_ARRIA10 .","commit_id":"64375bde0ba6ffd63e435f9b58e31e86902a52c2"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"1e7e27a8e2130e480dfa42e11e116475aec98035","unresolved":false,"context_lines":[{"line_number":181,"context_line":"    )"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"def get_traits(device_name, product_id, vf\u003dTrue):"},{"line_number":185,"context_line":"    \"\"\"Generate traits for devices."},{"line_number":186,"context_line":"    : param devices_name: name of PF/VF, for example, \"intel-fpga-dev.0\"."},{"line_number":187,"context_line":"    : param product_id: product id of PF/VF, for example, \"0x09c4\"."}],"source_content_type":"text/x-python","patch_set":21,"id":"7faddb67_412e7cfa","line":184,"range":{"start_line":184,"start_character":40,"end_line":184,"end_character":47},"updated":"2019-09-04 05:59:06.000000000","message":"nit: It is best to add a comment to vf like product_id.","commit_id":"c17f1eef84c07418cf168389801c9b528a0a214a"}],"cyborg/agent/resource_tracker.py":[{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"61d090c340a3a963775e50d87d7858924dc2a977","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            acc_list.extend(acc_driver.discover())"},{"line_number":73,"context_line":"        # Call conductor_api here to diff and report acc data. Now, we actually"},{"line_number":74,"context_line":"        # do not have the method report_data."},{"line_number":75,"context_line":"        self.conductor_api.report_data(context, self.host, acc_list)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_381e6a70","line":75,"updated":"2019-05-23 12:21:04.000000000","message":"++, Yep, we should it, that means we didn\u0027t catch any device in our env.","commit_id":"4cfda626b00f43725334e8dac9aa438816f84fed"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"18b6d7f030490f68ef3c195fcf93b2b864ef0215","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            acc_list.extend(acc_driver.discover())"},{"line_number":73,"context_line":"        # Call conductor_api here to diff and report acc data. Now, we actually"},{"line_number":74,"context_line":"        # do not have the method report_data."},{"line_number":75,"context_line":"        self.conductor_api.report_data(context, self.host, acc_list)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_b326df14","line":75,"in_reply_to":"bfb3d3c7_381e6a70","updated":"2019-05-24 17:29:27.000000000","message":"Sorry, don\u0027t follow what this comment means.","commit_id":"4cfda626b00f43725334e8dac9aa438816f84fed"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"4c0e6993638843e631c7be082a0c924d47374bf2","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            acc_list.extend(acc_driver.discover())"},{"line_number":73,"context_line":"        # Call conductor_api here to diff and report acc data. Now, we actually"},{"line_number":74,"context_line":"        # do not have the method report_data."},{"line_number":75,"context_line":"        self.conductor_api.report_data(context, self.host, acc_list)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_ed6a33eb","line":75,"in_reply_to":"bfb3d3c7_b326df14","updated":"2019-05-25 01:24:13.000000000","message":"I mean we need this change. if the acc_list is none, that means we didn\u0027t discover any device in the agent. It\u0027s a case the report data should cover.","commit_id":"4cfda626b00f43725334e8dac9aa438816f84fed"}],"cyborg/common/constants.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":"from cyborg.common import rc_fields"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"CONDUCTOR_TOPIC \u003d \u0027cyborg-conductor\u0027"},{"line_number":18,"context_line":"AGENT_TOPIC \u003d \u0027cyborg-agent\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_6337674f","line":15,"range":{"start_line":15,"start_character":0,"end_line":15,"end_character":35},"updated":"2019-07-26 15:22:50.000000000","message":"import os_resource_classes","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":"from cyborg.common import rc_fields"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"CONDUCTOR_TOPIC \u003d \u0027cyborg-conductor\u0027"},{"line_number":18,"context_line":"AGENT_TOPIC \u003d \u0027cyborg-agent\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_00ee2c21","line":15,"range":{"start_line":15,"start_character":0,"end_line":15,"end_character":35},"in_reply_to":"7faddb67_6337674f","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":27,"context_line":"# Device type"},{"line_number":28,"context_line":"DEVICE_TYPE \u003d (DEVICE_GPU, DEVICE_FPGA, DEVICE_AICHIP)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"RC_FPGA \u003d rc_fields.ResourceClass.normalize_name("},{"line_number":31,"context_line":"    rc_fields.ResourceClass.FPGA)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"RESOURCES \u003d {"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_4334ab4a","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":7},"updated":"2019-07-26 15:22:50.000000000","message":"Note that this will get you \u0027CUSTOM_ACCELERATOR_FPGA\u0027, which I don\u0027t think is what you want.\n\nAs of os-resource-classes 0.5.0 there is a standard \u0027FPGA\u0027 resource class, which was added in [1]. You should just be using that.\n\n[1] Ic6603aa62ed17c3e916cf7c98016cabb3c01b1f6","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":27,"context_line":"# Device type"},{"line_number":28,"context_line":"DEVICE_TYPE \u003d (DEVICE_GPU, DEVICE_FPGA, DEVICE_AICHIP)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"RC_FPGA \u003d rc_fields.ResourceClass.normalize_name("},{"line_number":31,"context_line":"    rc_fields.ResourceClass.FPGA)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"RESOURCES \u003d {"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_a0f078fe","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":7},"in_reply_to":"7faddb67_4334ab4a","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"1e7e27a8e2130e480dfa42e11e116475aec98035","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":"import os_resource_classes as RC"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"CONDUCTOR_TOPIC \u003d \u0027cyborg-conductor\u0027"},{"line_number":18,"context_line":"AGENT_TOPIC \u003d \u0027cyborg-agent\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"7faddb67_a16c1036","line":15,"range":{"start_line":15,"start_character":0,"end_line":15,"end_character":32},"updated":"2019-09-04 05:59:06.000000000","message":"suggest: import os_resource_classes as orc","commit_id":"c17f1eef84c07418cf168389801c9b528a0a214a"}],"cyborg/common/placement_client.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"74839598eabff59b842bdf11f1b308c65edcbc90","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    def _ensure_traits(self, trait_names):"},{"line_number":122,"context_line":"        # placement \u003d _get_placement()"},{"line_number":123,"context_line":"        for trait in trait_names:"},{"line_number":124,"context_line":"            resp \u003d self.get(\"/traits/%s\" % trait, version\u003d\u00271.6\u0027)"},{"line_number":125,"context_line":"            if resp.status_code \u003d\u003d 201:"},{"line_number":126,"context_line":"                print(\"Created trait %s\" % trait)"},{"line_number":127,"context_line":"            elif resp.status_code \u003d\u003d 204:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_fa3c15c9","line":124,"range":{"start_line":124,"start_character":24,"end_line":124,"end_character":27},"updated":"2019-07-15 08:38:33.000000000","message":"put\n\nOtherwise you\u0027re only checking for the trait\u0027s existence, not creating it.","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"e9f512371c025c0408c361524db0412fc59cb3a5","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    def _ensure_traits(self, trait_names):"},{"line_number":122,"context_line":"        # placement \u003d _get_placement()"},{"line_number":123,"context_line":"        for trait in trait_names:"},{"line_number":124,"context_line":"            resp \u003d self.get(\"/traits/%s\" % trait, version\u003d\u00271.6\u0027)"},{"line_number":125,"context_line":"            if resp.status_code \u003d\u003d 201:"},{"line_number":126,"context_line":"                print(\"Created trait %s\" % trait)"},{"line_number":127,"context_line":"            elif resp.status_code \u003d\u003d 204:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_9267e4b7","line":124,"range":{"start_line":124,"start_character":24,"end_line":124,"end_character":27},"in_reply_to":"7faddb67_fa3c15c9","updated":"2019-07-17 06:06:10.000000000","message":"agree with this, here should use put","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"e9f512371c025c0408c361524db0412fc59cb3a5","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        for trait in trait_names:"},{"line_number":124,"context_line":"            resp \u003d self.get(\"/traits/%s\" % trait, version\u003d\u00271.6\u0027)"},{"line_number":125,"context_line":"            if resp.status_code \u003d\u003d 201:"},{"line_number":126,"context_line":"                print(\"Created trait %s\" % trait)"},{"line_number":127,"context_line":"            elif resp.status_code \u003d\u003d 204:"},{"line_number":128,"context_line":"                print(\"Trait %s already existed\" % trait)"},{"line_number":129,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_1211b404","line":126,"range":{"start_line":126,"start_character":16,"end_line":126,"end_character":21},"updated":"2019-07-17 06:06:10.000000000","message":"Please use LOG instead","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"e9f512371c025c0408c361524db0412fc59cb3a5","unresolved":false,"context_lines":[{"line_number":125,"context_line":"            if resp.status_code \u003d\u003d 201:"},{"line_number":126,"context_line":"                print(\"Created trait %s\" % trait)"},{"line_number":127,"context_line":"            elif resp.status_code \u003d\u003d 204:"},{"line_number":128,"context_line":"                print(\"Trait %s already existed\" % trait)"},{"line_number":129,"context_line":"            else:"},{"line_number":130,"context_line":"                raise Exception("},{"line_number":131,"context_line":"                    \"Failed to create trait %s: HTTP %d: %s\" %"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_b2fb00bf","line":128,"range":{"start_line":128,"start_character":16,"end_line":128,"end_character":21},"updated":"2019-07-17 06:06:10.000000000","message":"Please use LOG instead","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from keystoneauth1 import exceptions as ks_exc"},{"line_number":22,"context_line":"from cyborg.common import exception"},{"line_number":23,"context_line":"from cyborg.common import rc_fields as fields"},{"line_number":24,"context_line":"from cyborg.common import utils"},{"line_number":25,"context_line":"from cyborg.conductor import provider_tree"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_43826bca","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":45},"updated":"2019-07-26 15:22:50.000000000","message":"import os_resource_classes","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from keystoneauth1 import exceptions as ks_exc"},{"line_number":22,"context_line":"from cyborg.common import exception"},{"line_number":23,"context_line":"from cyborg.common import rc_fields as fields"},{"line_number":24,"context_line":"from cyborg.common import utils"},{"line_number":25,"context_line":"from cyborg.conductor import provider_tree"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_26bd8001","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":45},"in_reply_to":"7faddb67_43826bca","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":"NESTED_PROVIDER_API_VERSION \u003d \u00271.14\u0027"},{"line_number":29,"context_line":"POST_RPS_RETURNS_PAYLOAD_API_VERSION \u003d \u00271.20\u0027"},{"line_number":30,"context_line":"PLACEMENT_API_RETURN_PROVIDER_BODY \u003d \u0027placement 1.20\u0027"},{"line_number":31,"context_line":"PLACEMENT_API_LATEST_SUPPORTED \u003d PLACEMENT_API_RETURN_PROVIDER_BODY"},{"line_number":32,"context_line":"API_VERSION_REQUEST_HEADER \u003d \u0027OpenStack-API-Version\u0027"},{"line_number":33,"context_line":"PLACEMENT_CLIENT_SEMAPHORE \u003d \u0027placement_client\u0027"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_a6c00de2","line":32,"range":{"start_line":30,"start_character":0,"end_line":32,"end_character":52},"updated":"2019-07-26 15:22:50.000000000","message":"not needed (see below)","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":"NESTED_PROVIDER_API_VERSION \u003d \u00271.14\u0027"},{"line_number":29,"context_line":"POST_RPS_RETURNS_PAYLOAD_API_VERSION \u003d \u00271.20\u0027"},{"line_number":30,"context_line":"PLACEMENT_API_RETURN_PROVIDER_BODY \u003d \u0027placement 1.20\u0027"},{"line_number":31,"context_line":"PLACEMENT_API_LATEST_SUPPORTED \u003d PLACEMENT_API_RETURN_PROVIDER_BODY"},{"line_number":32,"context_line":"API_VERSION_REQUEST_HEADER \u003d \u0027OpenStack-API-Version\u0027"},{"line_number":33,"context_line":"PLACEMENT_CLIENT_SEMAPHORE \u003d \u0027placement_client\u0027"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_a60c10ec","line":32,"range":{"start_line":30,"start_character":0,"end_line":32,"end_character":52},"in_reply_to":"7faddb67_a6c00de2","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                [placement] section."},{"line_number":46,"context_line":"        \"\"\""},{"line_number":47,"context_line":"        self._adapter \u003d adapter"},{"line_number":48,"context_line":"        # An object that contains a nova-compute-side cache of resource"},{"line_number":49,"context_line":"        # provider and inventory information"},{"line_number":50,"context_line":"        self._provider_tree \u003d provider_tree.ProviderTree()"},{"line_number":51,"context_line":"        # Track the last time we updated providers\u0027 aggregates and traits"},{"line_number":52,"context_line":"        self._association_refresh_time \u003d {}"},{"line_number":53,"context_line":"        self._client \u003d self._create_client()"},{"line_number":54,"context_line":"        self._openstack_api_version \u003d openstack_api_version"},{"line_number":55,"context_line":"        self._api_version_header \u003d {API_VERSION_REQUEST_HEADER:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_663d35dc","line":52,"range":{"start_line":48,"start_character":0,"end_line":52,"end_character":43},"updated":"2019-07-26 15:22:50.000000000","message":"boo (see below)","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                [placement] section."},{"line_number":46,"context_line":"        \"\"\""},{"line_number":47,"context_line":"        self._adapter \u003d adapter"},{"line_number":48,"context_line":"        # An object that contains a nova-compute-side cache of resource"},{"line_number":49,"context_line":"        # provider and inventory information"},{"line_number":50,"context_line":"        self._provider_tree \u003d provider_tree.ProviderTree()"},{"line_number":51,"context_line":"        # Track the last time we updated providers\u0027 aggregates and traits"},{"line_number":52,"context_line":"        self._association_refresh_time \u003d {}"},{"line_number":53,"context_line":"        self._client \u003d self._create_client()"},{"line_number":54,"context_line":"        self._openstack_api_version \u003d openstack_api_version"},{"line_number":55,"context_line":"        self._api_version_header \u003d {API_VERSION_REQUEST_HEADER:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_266b4085","line":52,"range":{"start_line":48,"start_character":0,"end_line":52,"end_character":43},"in_reply_to":"7faddb67_663d35dc","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        # Track the last time we updated providers\u0027 aggregates and traits"},{"line_number":52,"context_line":"        self._association_refresh_time \u003d {}"},{"line_number":53,"context_line":"        self._client \u003d self._create_client()"},{"line_number":54,"context_line":"        self._openstack_api_version \u003d openstack_api_version"},{"line_number":55,"context_line":"        self._api_version_header \u003d {API_VERSION_REQUEST_HEADER:"},{"line_number":56,"context_line":"                                    self._openstack_api_version}"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    @utils.synchronized(PLACEMENT_CLIENT_SEMAPHORE)"},{"line_number":59,"context_line":"    def _create_client(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_03b1d38f","line":56,"range":{"start_line":54,"start_character":0,"end_line":56,"end_character":64},"updated":"2019-07-26 15:22:50.000000000","message":"not needed (see below)","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        # Track the last time we updated providers\u0027 aggregates and traits"},{"line_number":52,"context_line":"        self._association_refresh_time \u003d {}"},{"line_number":53,"context_line":"        self._client \u003d self._create_client()"},{"line_number":54,"context_line":"        self._openstack_api_version \u003d openstack_api_version"},{"line_number":55,"context_line":"        self._api_version_header \u003d {API_VERSION_REQUEST_HEADER:"},{"line_number":56,"context_line":"                                    self._openstack_api_version}"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    @utils.synchronized(PLACEMENT_CLIENT_SEMAPHORE)"},{"line_number":59,"context_line":"    def _create_client(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_46667cbd","line":56,"range":{"start_line":54,"start_character":0,"end_line":56,"end_character":64},"in_reply_to":"7faddb67_03b1d38f","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        client.additional_headers \u003d {\u0027accept\u0027: \u0027application/json\u0027}"},{"line_number":68,"context_line":"        return client"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def _extend_header_with_api_version(self, **kwargs):"},{"line_number":71,"context_line":"        headers \u003d kwargs.get(\u0027headers\u0027, {})"},{"line_number":72,"context_line":"        if API_VERSION_REQUEST_HEADER not in headers:"},{"line_number":73,"context_line":"            if \u0027headers\u0027 not in kwargs:"},{"line_number":74,"context_line":"                kwargs[\u0027headers\u0027] \u003d self._api_version_header"},{"line_number":75,"context_line":"            else:"},{"line_number":76,"context_line":"                kwargs[\u0027headers\u0027].update(self._api_version_header)"},{"line_number":77,"context_line":"        return kwargs"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def get(self, url, version\u003dNone, global_request_id\u003dNone):"},{"line_number":80,"context_line":"        headers \u003d ({request_id.INBOUND_HEADER: global_request_id}"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_e38cb7d8","line":77,"range":{"start_line":70,"start_character":0,"end_line":77,"end_character":21},"updated":"2019-07-26 15:22:50.000000000","message":"This is not used.\n\nWhich is good, because it\u0027s not needed.\n\nBecause the microversion kwarg does all of this for you.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        client.additional_headers \u003d {\u0027accept\u0027: \u0027application/json\u0027}"},{"line_number":68,"context_line":"        return client"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def _extend_header_with_api_version(self, **kwargs):"},{"line_number":71,"context_line":"        headers \u003d kwargs.get(\u0027headers\u0027, {})"},{"line_number":72,"context_line":"        if API_VERSION_REQUEST_HEADER not in headers:"},{"line_number":73,"context_line":"            if \u0027headers\u0027 not in kwargs:"},{"line_number":74,"context_line":"                kwargs[\u0027headers\u0027] \u003d self._api_version_header"},{"line_number":75,"context_line":"            else:"},{"line_number":76,"context_line":"                kwargs[\u0027headers\u0027].update(self._api_version_header)"},{"line_number":77,"context_line":"        return kwargs"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def get(self, url, version\u003dNone, global_request_id\u003dNone):"},{"line_number":80,"context_line":"        headers \u003d ({request_id.INBOUND_HEADER: global_request_id}"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_664cd841","line":77,"range":{"start_line":70,"start_character":0,"end_line":77,"end_character":21},"in_reply_to":"7faddb67_e38cb7d8","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        return kwargs"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def get(self, url, version\u003dNone, global_request_id\u003dNone):"},{"line_number":80,"context_line":"        headers \u003d ({request_id.INBOUND_HEADER: global_request_id}"},{"line_number":81,"context_line":"                   if global_request_id else {})"},{"line_number":82,"context_line":"        return self._client.get(url, microversion\u003dversion, headers\u003dheaders)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def post(self, url, data, version\u003dNone, global_request_id\u003dNone):"},{"line_number":85,"context_line":"        headers \u003d ({request_id.INBOUND_HEADER: global_request_id}"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_635e8777","line":82,"range":{"start_line":80,"start_character":0,"end_line":82,"end_character":75},"updated":"2019-07-26 15:22:50.000000000","message":"By requiring keystoneauth1\u003e\u003d3.15.0 you can collapse this manual header munging and use the global_request_id kwarg to .get (and the other REST methods below). See [1] for how this was done in Nova.\n\n[1] https://review.opendev.org/#/c/670907/","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        return kwargs"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def get(self, url, version\u003dNone, global_request_id\u003dNone):"},{"line_number":80,"context_line":"        headers \u003d ({request_id.INBOUND_HEADER: global_request_id}"},{"line_number":81,"context_line":"                   if global_request_id else {})"},{"line_number":82,"context_line":"        return self._client.get(url, microversion\u003dversion, headers\u003dheaders)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def post(self, url, data, version\u003dNone, global_request_id\u003dNone):"},{"line_number":85,"context_line":"        headers \u003d ({request_id.INBOUND_HEADER: global_request_id}"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_86c23484","line":82,"range":{"start_line":80,"start_character":0,"end_line":82,"end_character":75},"in_reply_to":"7faddb67_635e8777","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        return self._client.delete(url, microversion\u003dversion, headers\u003dheaders)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def _get_rp_traits(self, rp_uuid):"},{"line_number":112,"context_line":"        # placement \u003d _get_placement()"},{"line_number":113,"context_line":"        resp \u003d self.get(\"/resource_providers/%s/traits\" % rp_uuid,"},{"line_number":114,"context_line":"                        version\u003d\u00271.6\u0027)"},{"line_number":115,"context_line":"        if resp.status_code !\u003d 200:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_636f67fc","line":112,"range":{"start_line":112,"start_character":8,"end_line":112,"end_character":38},"updated":"2019-07-26 15:22:50.000000000","message":"nix","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        return self._client.delete(url, microversion\u003dversion, headers\u003dheaders)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def _get_rp_traits(self, rp_uuid):"},{"line_number":112,"context_line":"        # placement \u003d _get_placement()"},{"line_number":113,"context_line":"        resp \u003d self.get(\"/resource_providers/%s/traits\" % rp_uuid,"},{"line_number":114,"context_line":"                        version\u003d\u00271.6\u0027)"},{"line_number":115,"context_line":"        if resp.status_code !\u003d 200:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_8647941d","line":112,"range":{"start_line":112,"start_character":8,"end_line":112,"end_character":38},"in_reply_to":"7faddb67_636f67fc","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        return resp.json()"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def _ensure_traits(self, trait_names):"},{"line_number":122,"context_line":"        # placement \u003d _get_placement()"},{"line_number":123,"context_line":"        for trait in trait_names:"},{"line_number":124,"context_line":"            resp \u003d self.put(\"/traits/%s\" % trait, None, version\u003d\u00271.6\u0027)"},{"line_number":125,"context_line":"            if resp.status_code \u003d\u003d 201:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_0376b3d9","line":122,"range":{"start_line":122,"start_character":8,"end_line":122,"end_character":38},"updated":"2019-07-26 15:22:50.000000000","message":"nix","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        return resp.json()"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def _ensure_traits(self, trait_names):"},{"line_number":122,"context_line":"        # placement \u003d _get_placement()"},{"line_number":123,"context_line":"        for trait in trait_names:"},{"line_number":124,"context_line":"            resp \u003d self.put(\"/traits/%s\" % trait, None, version\u003d\u00271.6\u0027)"},{"line_number":125,"context_line":"            if resp.status_code \u003d\u003d 201:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_464d1c39","line":122,"range":{"start_line":122,"start_character":8,"end_line":122,"end_character":38},"in_reply_to":"7faddb67_0376b3d9","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        traits_json[\u0027traits\u0027] \u003d traits"},{"line_number":168,"context_line":"        self._put_rp_traits(rp_uuid, traits_json)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def delete_traits_with_prefixes(self, rp_uuid, trait_prefixes):"},{"line_number":171,"context_line":"        traits_json \u003d self._get_rp_traits(rp_uuid)"},{"line_number":172,"context_line":"        traits \u003d ["},{"line_number":173,"context_line":"            trait for trait in traits_json[\u0027traits\u0027]"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_e6f7e558","line":170,"range":{"start_line":170,"start_character":8,"end_line":170,"end_character":35},"updated":"2019-07-26 15:22:50.000000000","message":"This appears to be unused.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"ee918dd896ececa293d47254d7e38d141d265a0a","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        traits_json[\u0027traits\u0027] \u003d traits"},{"line_number":168,"context_line":"        self._put_rp_traits(rp_uuid, traits_json)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def delete_traits_with_prefixes(self, rp_uuid, trait_prefixes):"},{"line_number":171,"context_line":"        traits_json \u003d self._get_rp_traits(rp_uuid)"},{"line_number":172,"context_line":"        traits \u003d ["},{"line_number":173,"context_line":"            trait for trait in traits_json[\u0027traits\u0027]"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_2f92a24c","line":170,"range":{"start_line":170,"start_character":8,"end_line":170,"end_character":35},"in_reply_to":"7faddb67_e6f7e558","updated":"2019-07-29 02:30:58.000000000","message":"This is invoked in https://review.opendev.org/#/c/626057/16/cyborg/objects/ext_arq.py L257. These two patchset(placement report/nova-cyborg integration) have dependencies more or less.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        traits_json[\u0027traits\u0027] \u003d traits"},{"line_number":177,"context_line":"        self._put_rp_traits(rp_uuid, traits_json)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    def get_placement_request_id(self, response):"},{"line_number":180,"context_line":"        if response is not None:"},{"line_number":181,"context_line":"            return response.headers.get(request_id.HTTP_RESP_HEADER_REQUEST_ID)"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    def _update_inventory("},{"line_number":184,"context_line":"            self, resource_provider_uuid, inventories,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_e6ea85d6","line":181,"range":{"start_line":179,"start_character":0,"end_line":181,"end_character":79},"updated":"2019-07-26 15:22:50.000000000","message":"This is weird and we shouldn\u0027t need it. Unrelated to this patch, though. I\u0027m investigating here [1].\n\n[1] https://review.opendev.org/#/q/topic:where-are-you-global_request_id","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        traits_json[\u0027traits\u0027] \u003d traits"},{"line_number":177,"context_line":"        self._put_rp_traits(rp_uuid, traits_json)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    def get_placement_request_id(self, response):"},{"line_number":180,"context_line":"        if response is not None:"},{"line_number":181,"context_line":"            return response.headers.get(request_id.HTTP_RESP_HEADER_REQUEST_ID)"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    def _update_inventory("},{"line_number":184,"context_line":"            self, resource_provider_uuid, inventories,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_a65730ca","line":181,"range":{"start_line":179,"start_character":0,"end_line":181,"end_character":79},"in_reply_to":"7faddb67_e6ea85d6","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                LOG.error(msg, args)"},{"line_number":342,"context_line":"                raise exception.InvalidResourceClass(resource_class\u003dname)"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":"    def update_from_provider_tree(self, context, new_tree):"},{"line_number":345,"context_line":"        \"\"\"Flush changes from a specified ProviderTree back to placement."},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"        The specified ProviderTree is compared against the local cache.  Any"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_e6536538","line":344,"range":{"start_line":344,"start_character":8,"end_line":344,"end_character":33},"updated":"2019-07-26 15:22:50.000000000","message":"ugh\n\nI really don\u0027t like the extent to which nova\u0027s SchedulerReportClient methods have been copy/pasted in here. You\u0027re immediately incurring all the technical debt of that class, plus the debt of trying to stay current as we fix bugs etc.\n\nAnd you\u0027re getting nova-tailored behavior, which is not necessarily appropriate for cyborg\u0027s usage of placement.\n\nI get that this was the quickest path to a PoC. But it would be so much nicer if you started from scratch, ditched the cache, and only implemented the methods you need.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"ee918dd896ececa293d47254d7e38d141d265a0a","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                LOG.error(msg, args)"},{"line_number":342,"context_line":"                raise exception.InvalidResourceClass(resource_class\u003dname)"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":"    def update_from_provider_tree(self, context, new_tree):"},{"line_number":345,"context_line":"        \"\"\"Flush changes from a specified ProviderTree back to placement."},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"        The specified ProviderTree is compared against the local cache.  Any"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_0fb806c6","line":344,"range":{"start_line":344,"start_character":8,"end_line":344,"end_character":33},"in_reply_to":"7faddb67_e6536538","updated":"2019-07-29 02:30:58.000000000","message":"Thanks for your reminder. I totally agree with you. I should have added some comment to explain this. As you said, it was a POC way, I am also trying to get rid of this kind of methods.  I think this one should be removed/updated in next further patchset.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"c49616fc8f7c9f9a71f94cae3fc0d8a8e779073c","unresolved":false,"context_lines":[{"line_number":32,"context_line":"_CONN \u003d None"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class ReportClient(object):"},{"line_number":36,"context_line":"    \"\"\"Client class for reporting to placement.\"\"\""},{"line_number":37,"context_line":"    def __init__(self):"},{"line_number":38,"context_line":"        global _CONN"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_51f9a34b","line":35,"updated":"2019-08-15 06:59:49.000000000","message":"Why is this changed? First, this is not a good name for Placement client. Secondly, it is good to have a function like get_aplcement() if we ever want to make the client a singleton in the future. See how Nova calls cyborg in nova/accelerator/cyborg.py.","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"6148352e9cff2840a42f05bf662275e1d30a9973","unresolved":false,"context_lines":[{"line_number":32,"context_line":"_CONN \u003d None"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class ReportClient(object):"},{"line_number":36,"context_line":"    \"\"\"Client class for reporting to placement.\"\"\""},{"line_number":37,"context_line":"    def __init__(self):"},{"line_number":38,"context_line":"        global _CONN"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_f5e509a5","line":35,"in_reply_to":"7faddb67_51f9a34b","updated":"2019-08-16 03:04:36.000000000","message":"please see nova-cinder, nova-neutron and nova-placement interaction. IMO, there is no need to have get_placement(), we can instantiate the placement client by call PlacementClient() directly.","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"2e87fc77ebe669f47697e90ee7c666fb4792a716","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import copy"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo_log import log as logging"},{"line_number":19,"context_line":"from oslo_middleware import request_id"},{"line_number":20,"context_line":"from keystoneauth1 import exceptions as ks_exc"},{"line_number":21,"context_line":"from cyborg.common import utils"},{"line_number":22,"context_line":"from cyborg.common import exception"},{"line_number":23,"context_line":"from cyborg.conf import CONF"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from openstack import connection"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_b684e9d4","line":25,"range":{"start_line":16,"start_character":0,"end_line":25,"end_character":32},"updated":"2019-08-26 02:23:16.000000000","message":"Cyborg use pep8 command in gate, that even can not check import alphabetical order and import but unused, I will let ChenKe to use flake8 to replace pep8 and fix all the errors, hope to can change it before the T release.","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"5cd94e5d144e7a0325171685fd253125fd96225e","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import copy"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo_log import log as logging"},{"line_number":19,"context_line":"from oslo_middleware import request_id"},{"line_number":20,"context_line":"from keystoneauth1 import exceptions as ks_exc"},{"line_number":21,"context_line":"from cyborg.common import utils"},{"line_number":22,"context_line":"from cyborg.common import exception"},{"line_number":23,"context_line":"from cyborg.conf import CONF"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from openstack import connection"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_52ea3374","line":25,"range":{"start_line":16,"start_character":0,"end_line":25,"end_character":32},"in_reply_to":"7faddb67_b684e9d4","updated":"2019-08-28 07:01:31.000000000","message":"+1. Thanks :)","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a8da626b144c99b17b2d60b16047064b05401e8c","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import copy"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo_log import log as logging"},{"line_number":19,"context_line":"from oslo_middleware import request_id"},{"line_number":20,"context_line":"from keystoneauth1 import exceptions as ks_exc"},{"line_number":21,"context_line":"from cyborg.common import utils"},{"line_number":22,"context_line":"from cyborg.common import exception"},{"line_number":23,"context_line":"from cyborg.conf import CONF"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from openstack import connection"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_b76052a6","line":25,"range":{"start_line":16,"start_character":0,"end_line":25,"end_character":32},"in_reply_to":"7faddb67_b684e9d4","updated":"2019-08-27 01:50:01.000000000","message":"Thanks","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"1d1de6a4d7873946f7e539bed937c8b92ab27e6d","unresolved":false,"context_lines":[{"line_number":253,"context_line":"            return resp.json()[\u0027resource_providers\u0027]"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        # Some unexpected error"},{"line_number":256,"context_line":"        placement_req_id \u003d self. get_placement_request_id(resp)"},{"line_number":257,"context_line":"        msg \u003d (\"[%(placement_req_id)s] Failed to retrieve resource provider \""},{"line_number":258,"context_line":"               \"tree from placement API for UUID %(uuid)s. Got \""},{"line_number":259,"context_line":"               \"%(status_code)d: %(err_text)s.\")"}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_0dd363d7","line":256,"range":{"start_line":256,"start_character":32,"end_line":256,"end_character":33},"updated":"2019-08-26 14:11:49.000000000","message":"space.","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a8da626b144c99b17b2d60b16047064b05401e8c","unresolved":false,"context_lines":[{"line_number":253,"context_line":"            return resp.json()[\u0027resource_providers\u0027]"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        # Some unexpected error"},{"line_number":256,"context_line":"        placement_req_id \u003d self. get_placement_request_id(resp)"},{"line_number":257,"context_line":"        msg \u003d (\"[%(placement_req_id)s] Failed to retrieve resource provider \""},{"line_number":258,"context_line":"               \"tree from placement API for UUID %(uuid)s. Got \""},{"line_number":259,"context_line":"               \"%(status_code)d: %(err_text)s.\")"}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_376c629c","line":256,"range":{"start_line":256,"start_character":32,"end_line":256,"end_character":33},"in_reply_to":"7faddb67_0dd363d7","updated":"2019-08-27 01:50:01.000000000","message":"Done","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"1d1de6a4d7873946f7e539bed937c8b92ab27e6d","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        # Check for 404 since we don\u0027t need to warn/raise if we tried to delete"},{"line_number":273,"context_line":"        # something which doesn\"t actually exist."},{"line_number":274,"context_line":"        if resp or resp.status_code \u003d\u003d 404:"},{"line_number":275,"context_line":"            if resp:"},{"line_number":276,"context_line":"                LOG.info(\"Deleted resource provider %s\", rp_uuid)"},{"line_number":277,"context_line":"            return"},{"line_number":278,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_0da12347","line":275,"range":{"start_line":275,"start_character":12,"end_line":275,"end_character":20},"updated":"2019-08-26 14:11:49.000000000","message":"Hi, I think this line is repeated. When enter this if condition. resp is True.","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a8da626b144c99b17b2d60b16047064b05401e8c","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        # Check for 404 since we don\u0027t need to warn/raise if we tried to delete"},{"line_number":273,"context_line":"        # something which doesn\"t actually exist."},{"line_number":274,"context_line":"        if resp or resp.status_code \u003d\u003d 404:"},{"line_number":275,"context_line":"            if resp:"},{"line_number":276,"context_line":"                LOG.info(\"Deleted resource provider %s\", rp_uuid)"},{"line_number":277,"context_line":"            return"},{"line_number":278,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_57579ecb","line":275,"range":{"start_line":275,"start_character":12,"end_line":275,"end_character":20},"in_reply_to":"7faddb67_0da12347","updated":"2019-08-27 01:50:01.000000000","message":"Done","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"700dbed76c525f859018dd2f5fd980e095a9799b","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                \"Failed to set traits to %s for rp %s: HTTP %d: %s\" %"},{"line_number":101,"context_line":"                (traits_json, rp_uuid, resp.status_code, resp.text))"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def add_traits_to_rp(self, rp_uuid, trait_names):"},{"line_number":104,"context_line":"        self._ensure_traits(trait_names)"},{"line_number":105,"context_line":"        traits_json \u003d self._get_rp_traits(rp_uuid)"},{"line_number":106,"context_line":"        traits \u003d list(set(traits_json[\u0027traits\u0027] + trait_names))"}],"source_content_type":"text/x-python","patch_set":19,"id":"7faddb67_16b6cf3f","line":103,"updated":"2019-08-29 16:49:53.000000000","message":"The region trait does not get added, because the FPGA driver does not include it in the driver report. The cause is in the driver, not here, but am stating it here.","commit_id":"64375bde0ba6ffd63e435f9b58e31e86902a52c2"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a8b39851e497f591d1d7a35a227830e8a51a5bea","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                \"Failed to set traits to %s for rp %s: HTTP %d: %s\" %"},{"line_number":101,"context_line":"                (traits_json, rp_uuid, resp.status_code, resp.text))"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def add_traits_to_rp(self, rp_uuid, trait_names):"},{"line_number":104,"context_line":"        self._ensure_traits(trait_names)"},{"line_number":105,"context_line":"        traits_json \u003d self._get_rp_traits(rp_uuid)"},{"line_number":106,"context_line":"        traits \u003d list(set(traits_json[\u0027traits\u0027] + trait_names))"}],"source_content_type":"text/x-python","patch_set":19,"id":"7faddb67_d08274c7","line":103,"in_reply_to":"7faddb67_16b6cf3f","updated":"2019-08-30 06:47:09.000000000","message":"driver report the region id here, L198\nhttps://review.opendev.org/#/c/659233/19/cyborg/accelerator/drivers/fpga/intel/sysinfo.py","commit_id":"64375bde0ba6ffd63e435f9b58e31e86902a52c2"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"700dbed76c525f859018dd2f5fd980e095a9799b","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        traits_json[\u0027traits\u0027] \u003d traits"},{"line_number":108,"context_line":"        self._put_rp_traits(rp_uuid, traits_json)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def delete_trait_by_name(self, rp_uuid, trait_name):"},{"line_number":111,"context_line":"        traits_json \u003d self._get_rp_traits(rp_uuid)"},{"line_number":112,"context_line":"        traits \u003d ["},{"line_number":113,"context_line":"            trait for trait in traits_json[\u0027traits\u0027]"}],"source_content_type":"text/x-python","patch_set":19,"id":"7faddb67_76906397","line":110,"updated":"2019-08-29 16:49:53.000000000","message":"When an RP is removed, the traits created for it (e.g. CUSTOM_FPGA_INTEL) do not get removed. This may actually be ok IMO for this release. Otherwise, we have to maintain a reference count of how many RPs use that trait and do the deletion only when the last RP is deleted. That is probably unnecessary complexity for this release. So I am fine with that.","commit_id":"64375bde0ba6ffd63e435f9b58e31e86902a52c2"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a8b39851e497f591d1d7a35a227830e8a51a5bea","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        traits_json[\u0027traits\u0027] \u003d traits"},{"line_number":108,"context_line":"        self._put_rp_traits(rp_uuid, traits_json)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def delete_trait_by_name(self, rp_uuid, trait_name):"},{"line_number":111,"context_line":"        traits_json \u003d self._get_rp_traits(rp_uuid)"},{"line_number":112,"context_line":"        traits \u003d ["},{"line_number":113,"context_line":"            trait for trait in traits_json[\u0027traits\u0027]"}],"source_content_type":"text/x-python","patch_set":19,"id":"7faddb67_3071880e","line":110,"in_reply_to":"7faddb67_76906397","updated":"2019-08-30 06:47:09.000000000","message":"thanks, will add a TODO.","commit_id":"64375bde0ba6ffd63e435f9b58e31e86902a52c2"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"700dbed76c525f859018dd2f5fd980e095a9799b","unresolved":false,"context_lines":[{"line_number":271,"context_line":"                           global_request_id\u003dglobal_request_id)"},{"line_number":272,"context_line":"        # Check for 404 since we don\u0027t need to warn/raise if we tried to delete"},{"line_number":273,"context_line":"        # something which doesn\"t actually exist."},{"line_number":274,"context_line":"        if resp and resp.status_code \u003d\u003d 404:"},{"line_number":275,"context_line":"            LOG.info(\"Deleted resource provider %s\", rp_uuid)"},{"line_number":276,"context_line":"            return"},{"line_number":277,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7faddb67_1661efd3","line":274,"updated":"2019-08-29 16:49:53.000000000","message":"The common return code is 204. For that, this logic will raise ResourceProviderDeletionFailed exception, even though 204 indicates the RP got deleted.","commit_id":"64375bde0ba6ffd63e435f9b58e31e86902a52c2"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"1e7e27a8e2130e480dfa42e11e116475aec98035","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                resource_provider\u003dresource_provider_uuid)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def get_resource_provider(self, resource_provider_uuid):"},{"line_number":152,"context_line":"        \"\"\"Get resource provider by UUID."},{"line_number":153,"context_line":"        :param resource_provider_uuid: UUID of the resource provider."},{"line_number":154,"context_line":"        :raises PlacementResourceProviderNotFound: For failure to find resource"},{"line_number":155,"context_line":"        :returns: The Resource Provider matching the UUID."}],"source_content_type":"text/x-python","patch_set":21,"id":"7faddb67_618e18d2","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":41},"updated":"2019-09-04 05:59:06.000000000","message":"need one blank line here. After this patch https://review.opendev.org/#/c/679062/ merged, Some pep8 error in the part will be checked.","commit_id":"c17f1eef84c07418cf168389801c9b528a0a214a"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"1e7e27a8e2130e480dfa42e11e116475aec98035","unresolved":false,"context_lines":[{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def _get_providers_in_tree(self, context, uuid):"},{"line_number":242,"context_line":"        \"\"\"Queries the placement API for a list of the resource providers in"},{"line_number":243,"context_line":"        the tree associated with the specified UUID."},{"line_number":244,"context_line":"        :param context: The security context"},{"line_number":245,"context_line":"        :param uuid: UUID identifier for the resource provider to look up"},{"line_number":246,"context_line":"        :return: A list of dicts of resource provider information, which may be"}],"source_content_type":"text/x-python","patch_set":21,"id":"7faddb67_21bee064","line":243,"range":{"start_line":243,"start_character":46,"end_line":243,"end_character":52},"updated":"2019-09-04 05:59:06.000000000","message":"The same. lack blank line.","commit_id":"c17f1eef84c07418cf168389801c9b528a0a214a"}],"cyborg/common/rc_fields.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"7faddb67_c3abbb72","updated":"2019-07-26 15:22:50.000000000","message":"Whoah. This whole file needs to go away. You should be using os-resource-classes instead.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"}],"cyborg/conductor/manager.py":[{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"61d090c340a3a963775e50d87d7858924dc2a977","unresolved":false,"context_lines":[{"line_number":34,"context_line":"from oslo_log import log as logging"},{"line_number":35,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"RC_FPGA \u003d rc_fields.ResourceClass.normalize_name("},{"line_number":38,"context_line":"    rc_fields.ResourceClass.FPGA)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"RESOURCES \u003d {"},{"line_number":41,"context_line":"    \"FPGA\": RC_FPGA"},{"line_number":42,"context_line":"}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"class ConductorManager(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_78038210","line":42,"range":{"start_line":37,"start_character":0,"end_line":42,"end_character":1},"updated":"2019-05-23 12:21:04.000000000","message":"Should we put it in to common.constants?","commit_id":"4cfda626b00f43725334e8dac9aa438816f84fed"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"61d090c340a3a963775e50d87d7858924dc2a977","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        super(ConductorManager, self).__init__()"},{"line_number":53,"context_line":"        self.topic \u003d topic"},{"line_number":54,"context_line":"        self.host \u003d host or CONF.host"},{"line_number":55,"context_line":"        self.p_client \u003d placement_report_client.SchedulerReportClient()"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def periodic_tasks(self, context, raise_on_error\u003dFalse):"},{"line_number":58,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_1e034f0f","line":55,"range":{"start_line":55,"start_character":13,"end_line":55,"end_character":21},"updated":"2019-05-23 12:21:04.000000000","message":"The \"self.placement_client\" is better for me.","commit_id":"4cfda626b00f43725334e8dac9aa438816f84fed"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"61d090c340a3a963775e50d87d7858924dc2a977","unresolved":false,"context_lines":[{"line_number":338,"context_line":""},{"line_number":339,"context_line":"    def _get_sub_provider(self, context, parent, name):"},{"line_number":340,"context_line":"        name \u003d name.encode(\"utf-8\")"},{"line_number":341,"context_line":"        sub_pr_uuid \u003d str(uuid.uuid3(uuid.NAMESPACE_DNS, name))"},{"line_number":342,"context_line":"        sub_pr \u003d self.p_client.get_provider_tree_and_ensure_root("},{"line_number":343,"context_line":"            context, sub_pr_uuid,"},{"line_number":344,"context_line":"            name\u003dname, parent_provider_uuid\u003dparent)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_788e22d1","line":341,"range":{"start_line":341,"start_character":22,"end_line":341,"end_character":63},"updated":"2019-05-23 12:21:04.000000000","message":"nit: I think it\u0027s something to map the name to uuid, right? We already have had a thread safe UUID sentinel in osloutils we could use it directly.\n\n[1] https://review.opendev.org/#/c/594179/\n[2] https://github.com/openstack/oslo.utils/blob/9fdcf64/oslo_utils/fixture.py#L92","commit_id":"4cfda626b00f43725334e8dac9aa438816f84fed"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"61d090c340a3a963775e50d87d7858924dc2a977","unresolved":false,"context_lines":[{"line_number":384,"context_line":"        # hostname provider"},{"line_number":385,"context_line":"        root_provider \u003d self._get_root_provider()"},{"line_number":386,"context_line":"        if obj.obj_name() \u003d\u003d \"DriverDevice\":"},{"line_number":387,"context_line":"            pr_name \u003d obj.type + \"_\" + re.sub(r\u0027\\W\u0027, \"_\","},{"line_number":388,"context_line":"                                              obj.controlpath_id.cpid_info)"},{"line_number":389,"context_line":"            resource_class \u003d RESOURCES.get(obj.type, None)"},{"line_number":390,"context_line":"            if not resource_class:"},{"line_number":391,"context_line":"                raise exception.ResourceClassNotFound()"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_78ef02b0","line":388,"range":{"start_line":387,"start_character":0,"end_line":388,"end_character":75},"updated":"2019-05-23 12:21:04.000000000","message":"If the cpid_info is \"0000:0c:00.0\", the rp_name is something like:\n\"FPGA_0000_0c_00_0\",\n\nbut if the device in different host, perhaps has the same address value, right?That means we perhaps have 2 same name provider, it maybe would bring some confusing to operators.","commit_id":"4cfda626b00f43725334e8dac9aa438816f84fed"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"61d090c340a3a963775e50d87d7858924dc2a977","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        pr_name \u003d obj.type + \"_\" + re.sub(r\u0027\\W\u0027, \"_\","},{"line_number":423,"context_line":"                                          obj.controlpath_id.cpid_info)"},{"line_number":424,"context_line":"        pr_name \u003d pr_name.encode(\"utf-8\")"},{"line_number":425,"context_line":"        return str(uuid.uuid3(uuid.NAMESPACE_DNS, pr_name))"},{"line_number":426,"context_line":""},{"line_number":427,"context_line":"    def _delete_provider_and_sub_providers(self, context, rp_uuid):"},{"line_number":428,"context_line":"        rp_in_tree \u003d self.p_client._get_providers_in_tree(context, rp_uuid)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_98b2f693","line":425,"range":{"start_line":425,"start_character":15,"end_line":425,"end_character":59},"updated":"2019-05-23 12:21:04.000000000","message":"ditto","commit_id":"4cfda626b00f43725334e8dac9aa438816f84fed"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"86d83d495966164950186724f14bff54aad6d47b","unresolved":false,"context_lines":[{"line_number":283,"context_line":"                if new_driver_attr_obj.key.startswith(\"trait\"):"},{"line_number":284,"context_line":"                    self.placement_client._put_rp_traits("},{"line_number":285,"context_line":"                        rp_uuid, new_driver_attr_obj.value)"},{"line_number":286,"context_line":"        # key is deleted."},{"line_number":287,"context_line":"        deleted \u003d set(old_key_list) - same"},{"line_number":288,"context_line":"        for d in deleted:"},{"line_number":289,"context_line":"            old_driver_attr_obj \u003d old_driver_attr_list[old_key_list.index(d)]"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_5bddf9dd","line":286,"range":{"start_line":286,"start_character":8,"end_line":286,"end_character":25},"updated":"2019-07-18 06:17:22.000000000","message":"Is there a situation like: old_key_list\u003d[\u0027trait\u0027,\u0027rc\u0027],new_key_list\u003d[] ? do we need to update placement for such case?","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"2733d01ebcc32821f27ebd425ac1b8379370f071","unresolved":false,"context_lines":[{"line_number":283,"context_line":"                if new_driver_attr_obj.key.startswith(\"trait\"):"},{"line_number":284,"context_line":"                    self.placement_client._put_rp_traits("},{"line_number":285,"context_line":"                        rp_uuid, new_driver_attr_obj.value)"},{"line_number":286,"context_line":"        # key is deleted."},{"line_number":287,"context_line":"        deleted \u003d set(old_key_list) - same"},{"line_number":288,"context_line":"        for d in deleted:"},{"line_number":289,"context_line":"            old_driver_attr_obj \u003d old_driver_attr_list[old_key_list.index(d)]"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_93b1154a","line":286,"range":{"start_line":286,"start_character":8,"end_line":286,"end_character":25},"in_reply_to":"7faddb67_5bddf9dd","updated":"2019-07-18 06:46:31.000000000","message":"Yes, exactly! That\u0027s what I am doing now. You will see it in next patch :)","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"86d83d495966164950186724f14bff54aad6d47b","unresolved":false,"context_lines":[{"line_number":288,"context_line":"        for d in deleted:"},{"line_number":289,"context_line":"            old_driver_attr_obj \u003d old_driver_attr_list[old_key_list.index(d)]"},{"line_number":290,"context_line":"            old_driver_attr_obj.delete_by_key(context, dep_id, d)"},{"line_number":291,"context_line":"        # key is added."},{"line_number":292,"context_line":"        added \u003d set(new_key_list) - same"},{"line_number":293,"context_line":"        for a in added:"},{"line_number":294,"context_line":"            new_driver_attr_obj \u003d new_driver_attr_list[new_key_list.index(a)]"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_41b2e64a","line":291,"range":{"start_line":291,"start_character":7,"end_line":291,"end_character":23},"updated":"2019-07-18 06:17:22.000000000","message":"Is there a situation like: old_key_list\u003d[]，new_key-list\u003d[\u0027trait\u0027],added\u003d[\u0027trait\u0027]? what about placement update for such case?","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"34e42a07e75091df847bfbeb4e09f94f25b176de","unresolved":false,"context_lines":[{"line_number":341,"context_line":"            self.placement_client._ensure_resource_provider(context, pr_uuid)"},{"line_number":342,"context_line":"            return pr_uuid"},{"line_number":343,"context_line":"        except IndexError:"},{"line_number":344,"context_line":"            print(\"Error, provider \u0027%s\u0027 can not be found\""},{"line_number":345,"context_line":"                  % hostname)"},{"line_number":346,"context_line":"        except Exception as e:"},{"line_number":347,"context_line":"            print(\"Error, could not access placement. Details: %s\" % e)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_1363e5b3","line":344,"range":{"start_line":344,"start_character":12,"end_line":344,"end_character":17},"updated":"2019-07-18 06:57:21.000000000","message":"also don\u0027t forget to replace print with LOG","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"34e42a07e75091df847bfbeb4e09f94f25b176de","unresolved":false,"context_lines":[{"line_number":344,"context_line":"            print(\"Error, provider \u0027%s\u0027 can not be found\""},{"line_number":345,"context_line":"                  % hostname)"},{"line_number":346,"context_line":"        except Exception as e:"},{"line_number":347,"context_line":"            print(\"Error, could not access placement. Details: %s\" % e)"},{"line_number":348,"context_line":"        return"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    def _get_sub_provider(self, context, parent, name):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_336621c3","line":347,"range":{"start_line":347,"start_character":12,"end_line":347,"end_character":17},"updated":"2019-07-18 06:57:21.000000000","message":"ditto","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"e9f512371c025c0408c361524db0412fc59cb3a5","unresolved":false,"context_lines":[{"line_number":348,"context_line":"        return"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    def _get_sub_provider(self, context, parent, name):"},{"line_number":351,"context_line":"        name \u003d name.encode(\"utf-8\")"},{"line_number":352,"context_line":"        sub_pr_uuid \u003d uuids.__getattr__(name)"},{"line_number":353,"context_line":"        sub_pr \u003d self.placement_client.get_provider_tree_and_ensure_root("},{"line_number":354,"context_line":"            context, sub_pr_uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_32d5d044","line":351,"range":{"start_line":351,"start_character":20,"end_line":351,"end_character":26},"updated":"2019-07-17 06:06:10.000000000","message":"here is also not correctly use encode.\nI\u0027d suggest using oslo_utils encodeutils module to safe_decode to string.\n\u003e\u003e\u003e from oslo_utils import encodeutils\n\u003e\u003e\u003e test_bytes \u003d b\u0027test\u0027\n\u003e\u003e\u003e test_string \u003d \u0027test\u0027\n\u003e\u003e\u003e encodeutils.safe_decode(test_bytes)\n\u0027test\u0027\n\u003e\u003e\u003e encodeutils.safe_decode(test_string)\n\u0027test\u0027","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"34e42a07e75091df847bfbeb4e09f94f25b176de","unresolved":false,"context_lines":[{"line_number":357,"context_line":""},{"line_number":358,"context_line":"    def provider_report(self, context, name, resource_class, traits, total,"},{"line_number":359,"context_line":"                        parent):"},{"line_number":360,"context_line":"        # need try:"},{"line_number":361,"context_line":"        # if nova agent does start up, will not update placement."},{"line_number":362,"context_line":"        try:"},{"line_number":363,"context_line":"            rs \u003d self.placement_client.get(\"/resource_classes/%s\" %"},{"line_number":364,"context_line":"                                           resource_class,"},{"line_number":365,"context_line":"                                           version\u003d\u00271.26\u0027)"},{"line_number":366,"context_line":"        except Exception as e:"},{"line_number":367,"context_line":"            self.placement_client.ensure_resource_classes(context,"},{"line_number":368,"context_line":"                                                          [resource_class])"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_53539de2","line":365,"range":{"start_line":360,"start_character":8,"end_line":365,"end_character":58},"updated":"2019-07-18 06:57:21.000000000","message":"maybe we can add a decorator to do the check,just like check_placement_api_available in  https://github.com/openstack/neutron-lib/blob/master/neutron_lib/placement/client.py#L194","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"e9f512371c025c0408c361524db0412fc59cb3a5","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        #           \"CUSTOM_FPGA_INTEL_FUNCTION_UUID\","},{"line_number":390,"context_line":"        #           \"CUSTOM_PROGRAMMABLE\","},{"line_number":391,"context_line":"        #           \"CUSTOM_FPGA_NETWORK\"]"},{"line_number":392,"context_line":"        self.placement_client._put_rp_traits(sub_pr_uuid, traits)"},{"line_number":393,"context_line":"        return sub_pr_uuid"},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"    def get_placement_needed_info_and_report(self, context, hostname, obj,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_725348e3","line":392,"range":{"start_line":392,"start_character":30,"end_line":392,"end_character":44},"updated":"2019-07-17 06:06:10.000000000","message":"Maybe we should use add_traits_to_rp function here? First create traits when traits doesn\u0027t existed?","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"e9f512371c025c0408c361524db0412fc59cb3a5","unresolved":false,"context_lines":[{"line_number":399,"context_line":"        attrs \u003d obj.attribute_list"},{"line_number":400,"context_line":"        resource_class \u003d [i.value for i in attrs if i.key \u003d\u003d \u0027rc\u0027][0]"},{"line_number":401,"context_line":"        traits \u003d [i.value for i in attrs"},{"line_number":402,"context_line":"                  if i.key.encode(\u0027utf-8\u0027).startswith(\"trait\")]"},{"line_number":403,"context_line":"        total \u003d obj.num_accelerators"},{"line_number":404,"context_line":"        self.provider_report(context, pr_name, resource_class, traits,"},{"line_number":405,"context_line":"                             total, parent_uuid)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_b29a20b6","line":402,"range":{"start_line":402,"start_character":27,"end_line":402,"end_character":33},"updated":"2019-07-17 06:06:10.000000000","message":"In python3, string encode will be a bytes, here will cause a error:\nTypeError: startswith first arg must be bytes or a tuple of bytes, not str","commit_id":"1b4a9de270a168431a9b8db836c5f6ffeaad5ebd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":344,"context_line":""},{"line_number":345,"context_line":"    def _get_root_provider(self, context, hostname):"},{"line_number":346,"context_line":"        try:"},{"line_number":347,"context_line":"            prvioder \u003d self.placement_client.get("},{"line_number":348,"context_line":"                \"resource_providers?name\u003d\" + hostname).json()"},{"line_number":349,"context_line":"            pr_uuid \u003d prvioder[\"resource_providers\"][0][\"uuid\"]"},{"line_number":350,"context_line":"            self.placement_client._ensure_resource_provider(context, pr_uuid)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_f911ca54","line":347,"range":{"start_line":347,"start_character":12,"end_line":347,"end_character":20},"updated":"2019-07-26 15:22:50.000000000","message":"provider","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":344,"context_line":""},{"line_number":345,"context_line":"    def _get_root_provider(self, context, hostname):"},{"line_number":346,"context_line":"        try:"},{"line_number":347,"context_line":"            prvioder \u003d self.placement_client.get("},{"line_number":348,"context_line":"                \"resource_providers?name\u003d\" + hostname).json()"},{"line_number":349,"context_line":"            pr_uuid \u003d prvioder[\"resource_providers\"][0][\"uuid\"]"},{"line_number":350,"context_line":"            self.placement_client._ensure_resource_provider(context, pr_uuid)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_86523466","line":347,"range":{"start_line":347,"start_character":12,"end_line":347,"end_character":20},"in_reply_to":"7faddb67_f911ca54","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            prvioder \u003d self.placement_client.get("},{"line_number":348,"context_line":"                \"resource_providers?name\u003d\" + hostname).json()"},{"line_number":349,"context_line":"            pr_uuid \u003d prvioder[\"resource_providers\"][0][\"uuid\"]"},{"line_number":350,"context_line":"            self.placement_client._ensure_resource_provider(context, pr_uuid)"},{"line_number":351,"context_line":"            return pr_uuid"},{"line_number":352,"context_line":"        except IndexError:"},{"line_number":353,"context_line":"            LOG.Error(\"Error, provider \u0027%s\u0027 can not be found\" % hostname)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_992a167c","line":350,"range":{"start_line":350,"start_character":12,"end_line":350,"end_character":77},"updated":"2019-07-26 15:22:50.000000000","message":"The provider already exists in placement, per the get() above. Are you doing this just to populate the cache? That\u0027s... not okay.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            prvioder \u003d self.placement_client.get("},{"line_number":348,"context_line":"                \"resource_providers?name\u003d\" + hostname).json()"},{"line_number":349,"context_line":"            pr_uuid \u003d prvioder[\"resource_providers\"][0][\"uuid\"]"},{"line_number":350,"context_line":"            self.placement_client._ensure_resource_provider(context, pr_uuid)"},{"line_number":351,"context_line":"            return pr_uuid"},{"line_number":352,"context_line":"        except IndexError:"},{"line_number":353,"context_line":"            LOG.Error(\"Error, provider \u0027%s\u0027 can not be found\" % hostname)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_6657f859","line":350,"range":{"start_line":350,"start_character":12,"end_line":350,"end_character":77},"in_reply_to":"7faddb67_992a167c","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":358,"context_line":"    def _get_sub_provider(self, context, parent, name):"},{"line_number":359,"context_line":"        name \u003d encodeutils.safe_encode(name)"},{"line_number":360,"context_line":"        sub_pr_uuid \u003d str(uuid.uuid3(uuid.NAMESPACE_DNS, name))"},{"line_number":361,"context_line":"        sub_pr \u003d self.placement_client.get_provider_tree_and_ensure_root("},{"line_number":362,"context_line":"            context, sub_pr_uuid,"},{"line_number":363,"context_line":"            name\u003dname, parent_provider_uuid\u003dparent)"},{"line_number":364,"context_line":"        return sub_pr, sub_pr_uuid"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_39568208","line":361,"range":{"start_line":361,"start_character":39,"end_line":361,"end_character":72},"updated":"2019-07-26 15:22:50.000000000","message":"Yeah, totally the wrong name for this method in this context. Don\u0027t pollute cyborg with nova\u0027s historical craziness.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":358,"context_line":"    def _get_sub_provider(self, context, parent, name):"},{"line_number":359,"context_line":"        name \u003d encodeutils.safe_encode(name)"},{"line_number":360,"context_line":"        sub_pr_uuid \u003d str(uuid.uuid3(uuid.NAMESPACE_DNS, name))"},{"line_number":361,"context_line":"        sub_pr \u003d self.placement_client.get_provider_tree_and_ensure_root("},{"line_number":362,"context_line":"            context, sub_pr_uuid,"},{"line_number":363,"context_line":"            name\u003dname, parent_provider_uuid\u003dparent)"},{"line_number":364,"context_line":"        return sub_pr, sub_pr_uuid"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_e6c8c822","line":361,"range":{"start_line":361,"start_character":39,"end_line":361,"end_character":72},"in_reply_to":"7faddb67_39568208","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        # _normalize_inventory_from_cn_obj(inv_data, compute_node)"},{"line_number":390,"context_line":"        # sub_pr.update_inventory(PR_NAME, inv_data)"},{"line_number":391,"context_line":"        # Flush any changes."},{"line_number":392,"context_line":"        self.placement_client.update_from_provider_tree(context, sub_pr)"},{"line_number":393,"context_line":"        # traits \u003d [\"CUSTOM_FPGA_INTEL\", \"CUSTOM_FPGA_INTEL_ARRIA10\","},{"line_number":394,"context_line":"        #           \"CUSTOM_FPGA_INTEL_REGION_UUID\","},{"line_number":395,"context_line":"        #           \"CUSTOM_FPGA_INTEL_FUNCTION_UUID\","}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_799abac5","line":392,"range":{"start_line":392,"start_character":30,"end_line":392,"end_character":55},"updated":"2019-07-26 15:22:50.000000000","message":"Waaay overkill. All you\u0027re doing is updating the inventory and traits of one provider (though at this point you\u0027re only updating the inventory, and then doing a separate call to update traits later).\n\nInstead, just... do the two placement calls.\n\nAnd then you can get rid of update_from_provider_tree, which is specialized for a convoluted interplay between nova\u0027s resource tracker and its virt drivers. Again, don\u0027t bring nova\u0027s baggage into cyborg.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        # _normalize_inventory_from_cn_obj(inv_data, compute_node)"},{"line_number":390,"context_line":"        # sub_pr.update_inventory(PR_NAME, inv_data)"},{"line_number":391,"context_line":"        # Flush any changes."},{"line_number":392,"context_line":"        self.placement_client.update_from_provider_tree(context, sub_pr)"},{"line_number":393,"context_line":"        # traits \u003d [\"CUSTOM_FPGA_INTEL\", \"CUSTOM_FPGA_INTEL_ARRIA10\","},{"line_number":394,"context_line":"        #           \"CUSTOM_FPGA_INTEL_REGION_UUID\","},{"line_number":395,"context_line":"        #           \"CUSTOM_FPGA_INTEL_FUNCTION_UUID\","}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_c6d10cce","line":392,"range":{"start_line":392,"start_character":30,"end_line":392,"end_character":55},"in_reply_to":"7faddb67_799abac5","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[{"line_number":398,"context_line":"        self.placement_client.add_traits_to_rp(sub_pr_uuid, traits)"},{"line_number":399,"context_line":"        return sub_pr_uuid"},{"line_number":400,"context_line":""},{"line_number":401,"context_line":"    def get_placement_needed_info_and_report(self, context, hostname, obj,"},{"line_number":402,"context_line":"                                             parent_uuid\u003dNone):"},{"line_number":403,"context_line":"        pr_name \u003d obj.name"},{"line_number":404,"context_line":"        attrs \u003d obj.attribute_list"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_39b522ef","line":401,"range":{"start_line":401,"start_character":60,"end_line":401,"end_character":68},"updated":"2019-07-26 15:22:50.000000000","message":"This param isn\u0027t used. The invocation from L260-2 doesn\u0027t include it in the param list (so that\u0027ll blow up) but the invocation from L203-6 does.","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a6725a49991ebfb6f15094dd405367ba89984d38","unresolved":false,"context_lines":[{"line_number":398,"context_line":"        self.placement_client.add_traits_to_rp(sub_pr_uuid, traits)"},{"line_number":399,"context_line":"        return sub_pr_uuid"},{"line_number":400,"context_line":""},{"line_number":401,"context_line":"    def get_placement_needed_info_and_report(self, context, hostname, obj,"},{"line_number":402,"context_line":"                                             parent_uuid\u003dNone):"},{"line_number":403,"context_line":"        pr_name \u003d obj.name"},{"line_number":404,"context_line":"        attrs \u003d obj.attribute_list"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_26fb4047","line":401,"range":{"start_line":401,"start_character":60,"end_line":401,"end_character":68},"in_reply_to":"7faddb67_39b522ef","updated":"2019-08-05 09:51:33.000000000","message":"Done","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"1d1de6a4d7873946f7e539bed937c8b92ab27e6d","unresolved":false,"context_lines":[{"line_number":370,"context_line":"        except Exception as e:"},{"line_number":371,"context_line":"            self.placement_client.ensure_resource_classes(context,"},{"line_number":372,"context_line":"                                                          [resource_class])"},{"line_number":373,"context_line":"            print(\"Error, could not access resource_classes. Details: %s\" % e)"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"        sub_pr_uuid \u003d self._get_sub_provider("},{"line_number":376,"context_line":"            context, parent, name)"}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_3f91a647","line":373,"range":{"start_line":373,"start_character":12,"end_line":373,"end_character":17},"updated":"2019-08-26 14:11:49.000000000","message":"Maybe Log?","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a8da626b144c99b17b2d60b16047064b05401e8c","unresolved":false,"context_lines":[{"line_number":370,"context_line":"        except Exception as e:"},{"line_number":371,"context_line":"            self.placement_client.ensure_resource_classes(context,"},{"line_number":372,"context_line":"                                                          [resource_class])"},{"line_number":373,"context_line":"            print(\"Error, could not access resource_classes. Details: %s\" % e)"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"        sub_pr_uuid \u003d self._get_sub_provider("},{"line_number":376,"context_line":"            context, parent, name)"}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_775adaf2","line":373,"range":{"start_line":373,"start_character":12,"end_line":373,"end_character":17},"in_reply_to":"7faddb67_3f91a647","updated":"2019-08-27 01:50:01.000000000","message":"Done","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"}],"cyborg/conductor/provider_tree.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ab553b3a1143d495df60543a32bd909476d7a4ff","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"7faddb67_d9988e76","updated":"2019-07-26 15:22:50.000000000","message":"It would be great to get rid of this module entirely. Do you really think you need a cache?","commit_id":"0bf2c589851c0f28bcbd687b3357004fcda66eec"}],"cyborg/objects/deployable.py":[{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"047b1b0abdee7c84a3c05e8ed250b898a319c163","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        \"\"\"Update a Deployable record in the DB.\"\"\""},{"line_number":115,"context_line":"        updates \u003d self.obj_get_changes()"},{"line_number":116,"context_line":"        # TODO(Xinran): Will remove this if find some better way."},{"line_number":117,"context_line":"        if \"uuid\" in updates.keys():"},{"line_number":118,"context_line":"            updates.pop(\"uuid\")"},{"line_number":119,"context_line":"        if \"created_at\" in updates.keys():"},{"line_number":120,"context_line":"            updates.pop(\"created_at\")"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_a9527934","line":117,"updated":"2019-08-22 10:54:12.000000000","message":"A change like this in the db layer may also work and be better:\nhttps://review.opendev.org/#/c/677115/2/cyborg/db/sqlalchemy/api.py@870\n\nIf it has to be here, we could do: updates.pop(\u0027uuid\u0027, None) and skip the \u0027if\u0027 check, like [1].\n\n[1] https://github.com/openstack/nova/blob/master/nova/objects/aggregate.py#L340","commit_id":"0b593508f65acd69ad099d5baf915b75d87fc789"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"969ad934326f515cf3a0022c3540552dcb2c6dec","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        \"\"\"Update a Deployable record in the DB.\"\"\""},{"line_number":115,"context_line":"        updates \u003d self.obj_get_changes()"},{"line_number":116,"context_line":"        # TODO(Xinran): Will remove this if find some better way."},{"line_number":117,"context_line":"        if \"uuid\" in updates.keys():"},{"line_number":118,"context_line":"            updates.pop(\"uuid\")"},{"line_number":119,"context_line":"        if \"created_at\" in updates.keys():"},{"line_number":120,"context_line":"            updates.pop(\"created_at\")"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_43370e00","line":117,"in_reply_to":"7faddb67_a9527934","updated":"2019-08-23 05:59:16.000000000","message":"It can not work, we need pop \"uuid\",  \"created_at\" here. I will change to use updates.pop().","commit_id":"0b593508f65acd69ad099d5baf915b75d87fc789"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"047b1b0abdee7c84a3c05e8ed250b898a319c163","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        # TODO(Xinran): Will remove this if find some better way."},{"line_number":117,"context_line":"        if \"uuid\" in updates.keys():"},{"line_number":118,"context_line":"            updates.pop(\"uuid\")"},{"line_number":119,"context_line":"        if \"created_at\" in updates.keys():"},{"line_number":120,"context_line":"            updates.pop(\"created_at\")"},{"line_number":121,"context_line":"        if \"updated_at\" in updates.keys() and \\"},{"line_number":122,"context_line":"                updates[\"updated_at\"] is not None:"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_2915294a","line":119,"updated":"2019-08-22 10:54:12.000000000","message":"I don\u0027t see a precedent for created_at/updated_at in other projects. Is this necessary or the right way?\n\nIf needed, why not do: updates.pop(\u0027created_at\u0027, None)","commit_id":"0b593508f65acd69ad099d5baf915b75d87fc789"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"969ad934326f515cf3a0022c3540552dcb2c6dec","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        # TODO(Xinran): Will remove this if find some better way."},{"line_number":117,"context_line":"        if \"uuid\" in updates.keys():"},{"line_number":118,"context_line":"            updates.pop(\"uuid\")"},{"line_number":119,"context_line":"        if \"created_at\" in updates.keys():"},{"line_number":120,"context_line":"            updates.pop(\"created_at\")"},{"line_number":121,"context_line":"        if \"updated_at\" in updates.keys() and \\"},{"line_number":122,"context_line":"                updates[\"updated_at\"] is not None:"}],"source_content_type":"text/x-python","patch_set":14,"id":"7faddb67_a31b627e","line":119,"in_reply_to":"7faddb67_2915294a","updated":"2019-08-23 05:59:16.000000000","message":"Yes, strangely, create_at, update_at in updates dict is different from the ones stored in DB. We met this issue in our Demo too. We should convert them to the format which DB accept.","commit_id":"0b593508f65acd69ad099d5baf915b75d87fc789"}],"cyborg/objects/device.py":[{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"c49616fc8f7c9f9a71f94cae3fc0d8a8e779073c","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    @classmethod"},{"line_number":99,"context_line":"    def get_by_device_id(cls, context, device_id):"},{"line_number":100,"context_line":"        \"\"\"get device object list from the hostname. return [] if not"},{"line_number":101,"context_line":"        exist.\"\"\""},{"line_number":102,"context_line":"        dev_filter \u003d {\u0027device_id\u0027: device_id}"},{"line_number":103,"context_line":"        device_obj_list \u003d Device.list(context, dev_filter)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_dbbbd072","line":100,"range":{"start_line":100,"start_character":43,"end_line":100,"end_character":51},"updated":"2019-08-15 06:59:49.000000000","message":"Copy-n-paste error.","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"6148352e9cff2840a42f05bf662275e1d30a9973","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    @classmethod"},{"line_number":99,"context_line":"    def get_by_device_id(cls, context, device_id):"},{"line_number":100,"context_line":"        \"\"\"get device object list from the hostname. return [] if not"},{"line_number":101,"context_line":"        exist.\"\"\""},{"line_number":102,"context_line":"        dev_filter \u003d {\u0027device_id\u0027: device_id}"},{"line_number":103,"context_line":"        device_obj_list \u003d Device.list(context, dev_filter)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7faddb67_d5000d37","line":100,"range":{"start_line":100,"start_character":43,"end_line":100,"end_character":51},"in_reply_to":"7faddb67_dbbbd072","updated":"2019-08-16 03:04:36.000000000","message":"Done","commit_id":"5a6492d609f27768422c83ea2d0bbc4aef360c55"}],"cyborg/objects/driver_objects/driver_device.py":[{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"1d1de6a4d7873946f7e539bed937c8b92ab27e6d","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        cpid_obj \u003d ControlpathID.get_by_device_id_cpidinfo("},{"line_number":150,"context_line":"            context, device_obj.id, self.controlpath_id.cpid_info)"},{"line_number":151,"context_line":"        # find the one cpid_obj with cpid_info"},{"line_number":152,"context_line":"        if cpid_obj is not None:"},{"line_number":153,"context_line":"            return device_obj"}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_ffd22ed1","line":153,"range":{"start_line":152,"start_character":0,"end_line":153,"end_character":29},"updated":"2019-08-26 14:11:49.000000000","message":"else:\n    return None?","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a8da626b144c99b17b2d60b16047064b05401e8c","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        cpid_obj \u003d ControlpathID.get_by_device_id_cpidinfo("},{"line_number":150,"context_line":"            context, device_obj.id, self.controlpath_id.cpid_info)"},{"line_number":151,"context_line":"        # find the one cpid_obj with cpid_info"},{"line_number":152,"context_line":"        if cpid_obj is not None:"},{"line_number":153,"context_line":"            return device_obj"}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_f7656ab0","line":153,"range":{"start_line":152,"start_character":0,"end_line":153,"end_character":29},"in_reply_to":"7faddb67_ffd22ed1","updated":"2019-08-27 01:50:01.000000000","message":"Done","commit_id":"fddd61bccd94233c5fb6c11241c66706bc218295"}]}
