)]}'
{"cyborg/common/nova_client.py":[{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"52382b933988f2008d07a1c7f39b21da484da886","unresolved":false,"context_lines":[{"line_number":20,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class API():"},{"line_number":24,"context_line":"    def __init___(self):"},{"line_number":25,"context_line":"        default_user \u003d \"devstack-admin\""},{"line_number":26,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_7b673c53","line":23,"range":{"start_line":23,"start_character":6,"end_line":23,"end_character":9},"updated":"2019-08-09 07:11:45.000000000","message":"Better name: NovaAPI","commit_id":"07237a76809c06920f938824e44a01453b318169"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a763ef7ace198185db6d4b465a2ca2eaae94dd25","unresolved":false,"context_lines":[{"line_number":20,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class API():"},{"line_number":24,"context_line":"    def __init___(self):"},{"line_number":25,"context_line":"        default_user \u003d \"devstack-admin\""},{"line_number":26,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_949c025c","line":23,"range":{"start_line":23,"start_character":6,"end_line":23,"end_character":9},"in_reply_to":"7faddb67_7b673c53","updated":"2019-08-14 03:00:25.000000000","message":"Done","commit_id":"07237a76809c06920f938824e44a01453b318169"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"52382b933988f2008d07a1c7f39b21da484da886","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        self.nova_client \u003d self.conn.compute"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def _get_acc_changed_event(self, server_id, arq_id, status):"},{"line_number":34,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-attached\u0027,"},{"line_number":35,"context_line":"                 \u0027server_uuid\u0027: server_id,"},{"line_number":36,"context_line":"                 \u0027tag\u0027: arq_id,"},{"line_number":37,"context_line":"                 \u0027status\u0027: status}"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_1b4de8c3","line":34,"updated":"2019-08-09 07:11:45.000000000","message":"Should be \u0027accelerator-bound\u0027. Attach is yet to happen at this point.","commit_id":"07237a76809c06920f938824e44a01453b318169"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a763ef7ace198185db6d4b465a2ca2eaae94dd25","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        self.nova_client \u003d self.conn.compute"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def _get_acc_changed_event(self, server_id, arq_id, status):"},{"line_number":34,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-attached\u0027,"},{"line_number":35,"context_line":"                 \u0027server_uuid\u0027: server_id,"},{"line_number":36,"context_line":"                 \u0027tag\u0027: arq_id,"},{"line_number":37,"context_line":"                 \u0027status\u0027: status}"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_54a68aad","line":34,"in_reply_to":"7faddb67_0ebfc8aa","updated":"2019-08-14 03:00:25.000000000","message":"Done","commit_id":"07237a76809c06920f938824e44a01453b318169"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a763ef7ace198185db6d4b465a2ca2eaae94dd25","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        self.nova_client \u003d self.conn.compute"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def _get_acc_changed_event(self, server_id, arq_id, status):"},{"line_number":34,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-attached\u0027,"},{"line_number":35,"context_line":"                 \u0027server_uuid\u0027: server_id,"},{"line_number":36,"context_line":"                 \u0027tag\u0027: arq_id,"},{"line_number":37,"context_line":"                 \u0027status\u0027: status}"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_34abce75","line":34,"in_reply_to":"7faddb67_1b4de8c3","updated":"2019-08-14 03:00:25.000000000","message":"Done","commit_id":"07237a76809c06920f938824e44a01453b318169"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"27ce6086f34c614403c05ea0d544801e21d80552","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        self.nova_client \u003d self.conn.compute"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def _get_acc_changed_event(self, server_id, arq_id, status):"},{"line_number":34,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-attached\u0027,"},{"line_number":35,"context_line":"                 \u0027server_uuid\u0027: server_id,"},{"line_number":36,"context_line":"                 \u0027tag\u0027: arq_id,"},{"line_number":37,"context_line":"                 \u0027status\u0027: status}"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_0ebfc8aa","line":34,"in_reply_to":"7faddb67_1b4de8c3","updated":"2019-08-12 08:29:06.000000000","message":"Update: The name I\u0027ll use in Nova is: \u0027accelerator-request-bound\u0027.","commit_id":"07237a76809c06920f938824e44a01453b318169"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"52382b933988f2008d07a1c7f39b21da484da886","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                return False"},{"line_number":70,"context_line":"        return True"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def notify_binding(self, context, server_id, arq_id, status):"},{"line_number":73,"context_line":"        api_version \u003d \u00272.51\u0027"},{"line_number":74,"context_line":"        events \u003d self._get_acc_changed_event(server_id, arq_id, status)"},{"line_number":75,"context_line":"        result \u003d self._send_events(context, events, api_version\u003dapi_version)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_1bfba847","line":72,"range":{"start_line":72,"start_character":49,"end_line":72,"end_character":55},"updated":"2019-08-09 07:11:45.000000000","message":"Better name: arq_uuid. The id field of arq is something else.","commit_id":"07237a76809c06920f938824e44a01453b318169"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a763ef7ace198185db6d4b465a2ca2eaae94dd25","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                return False"},{"line_number":70,"context_line":"        return True"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def notify_binding(self, context, server_id, arq_id, status):"},{"line_number":73,"context_line":"        api_version \u003d \u00272.51\u0027"},{"line_number":74,"context_line":"        events \u003d self._get_acc_changed_event(server_id, arq_id, status)"},{"line_number":75,"context_line":"        result \u003d self._send_events(context, events, api_version\u003dapi_version)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_f4b696dc","line":72,"range":{"start_line":72,"start_character":49,"end_line":72,"end_character":55},"in_reply_to":"7faddb67_1bfba847","updated":"2019-08-14 03:00:25.000000000","message":"Done","commit_id":"07237a76809c06920f938824e44a01453b318169"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"df6880be1c1bef652a11b8aa172d3c6ae8b73fac","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    def _get_acc_changed_event(self, server_id, arq_uuid, status):"},{"line_number":34,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":35,"context_line":"                 \u0027server_uuid\u0027: server_id,"},{"line_number":36,"context_line":"                 \u0027tag\u0027: arq_uuid,"},{"line_number":37,"context_line":"                 \u0027status\u0027: status}"},{"line_number":38,"context_line":"                ]"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_74cf0657","line":36,"updated":"2019-08-14 03:01:01.000000000","message":"The tag should be the device profile name.","commit_id":"7fa2dbbdab3c8c16e1e9a4904712d510f73934b5"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"84f037f37363d8b89e64cc9ac8da849780e2720d","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    def _get_acc_changed_event(self, server_id, arq_uuid, status):"},{"line_number":34,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":35,"context_line":"                 \u0027server_uuid\u0027: server_id,"},{"line_number":36,"context_line":"                 \u0027tag\u0027: arq_uuid,"},{"line_number":37,"context_line":"                 \u0027status\u0027: status}"},{"line_number":38,"context_line":"                ]"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_d4011a6c","line":36,"in_reply_to":"7faddb67_74cf0657","updated":"2019-08-14 03:04:28.000000000","message":"why not arq_uuid?","commit_id":"7fa2dbbdab3c8c16e1e9a4904712d510f73934b5"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"f8b5302d9d7e850f1a5a8c49bbb06a3cb6252025","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    def _get_acc_changed_event(self, server_id, arq_uuid, status):"},{"line_number":34,"context_line":"        return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":35,"context_line":"                 \u0027server_uuid\u0027: server_id,"},{"line_number":36,"context_line":"                 \u0027tag\u0027: arq_uuid,"},{"line_number":37,"context_line":"                 \u0027status\u0027: status}"},{"line_number":38,"context_line":"                ]"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_cfb743f5","line":36,"in_reply_to":"7faddb67_d4011a6c","updated":"2019-08-14 05:05:33.000000000","message":"Please see:\nhttps://review.opendev.org/#/c/631245/27/nova/objects/external_event.py@32 \n\nThe Nova code [1] needs to specify the tag. Since Nova does not store ARQ UUIDs for an instance, the device profile name is the only feasible tag.\n\n[1] https://review.opendev.org/gitweb?p\u003dopenstack/nova.git;f\u003dnova/virt/libvirt/driver.py;hb\u003drefs/changes/45/631245/27#l3229","commit_id":"7fa2dbbdab3c8c16e1e9a4904712d510f73934b5"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"577faa5c3de39b25c0e0060ba663296410ee43b7","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    def _get_acc_changed_event(self, server_id, dev_profile_name, status,"},{"line_number":34,"context_line":"                               bind_or_unbind):"},{"line_number":35,"context_line":"        if bind_or_unbind:"},{"line_number":36,"context_line":"            return [{\u0027name\u0027: \u0027accelerator-request-bound\u0027,"},{"line_number":37,"context_line":"                     \u0027server_uuid\u0027: server_id,"},{"line_number":38,"context_line":"                     \u0027tag\u0027: dev_profile_name,"},{"line_number":39,"context_line":"                     \u0027status\u0027: status}"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_285c7c7b","line":36,"range":{"start_line":36,"start_character":42,"end_line":36,"end_character":49},"updated":"2019-08-20 00:23:59.000000000","message":"\u0027requests\u0027: please match the name in\nhttps://review.opendev.org/#/c/631245/29/nova/objects/external_event.py@32","commit_id":"d47684cd1711996d3a7965b64488d1f84acafd5f"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"577faa5c3de39b25c0e0060ba663296410ee43b7","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                     \u0027status\u0027: status}"},{"line_number":40,"context_line":"                    ]"},{"line_number":41,"context_line":"        else:"},{"line_number":42,"context_line":"            return [{\u0027name\u0027: \u0027accelerator-request-unbound\u0027,"},{"line_number":43,"context_line":"                     \u0027server_uuid\u0027: server_id,"},{"line_number":44,"context_line":"                     \u0027tag\u0027: dev_profile_name,"},{"line_number":45,"context_line":"                     \u0027status\u0027: status}"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_a17e5016","line":42,"updated":"2019-08-20 00:23:59.000000000","message":"Nova does not wait for any unbind notification before tearing down the VM. We have defined only the bind event for Nova:\nhttps://review.opendev.org/#/c/631245/29/nova/api/openstack/compute/schemas/server_external_events.py@36","commit_id":"d47684cd1711996d3a7965b64488d1f84acafd5f"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"08f5e1d8c4b9f4be3500458aa0be08b9c899eb3c","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    def __init___(self):"},{"line_number":25,"context_line":"        default_user \u003d \"devstack-admin\""},{"line_number":26,"context_line":"        try:"},{"line_number":27,"context_line":"            auth_user \u003d CONF.compute.username"},{"line_number":28,"context_line":"        except:"},{"line_number":29,"context_line":"            auth_user \u003d default_user"},{"line_number":30,"context_line":"        self.conn \u003d connection.Connection(cloud\u003dauth_user)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_e1972b8f","line":27,"range":{"start_line":27,"start_character":24,"end_line":27,"end_character":45},"updated":"2019-08-22 08:04:24.000000000","message":"Hi, Xinran. Soft -1 because I didn\u0027t find conf in cyborg/common/. Should we add a registration file to compute?","commit_id":"efad87ada886d5d49c2e6caffa9a92696fdc1279"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"02cfd0b2d44cfc5d80ac755b10b20110b84167db","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    def __init___(self):"},{"line_number":25,"context_line":"        default_user \u003d \"devstack-admin\""},{"line_number":26,"context_line":"        try:"},{"line_number":27,"context_line":"            auth_user \u003d CONF.compute.username"},{"line_number":28,"context_line":"        except:"},{"line_number":29,"context_line":"            auth_user \u003d default_user"},{"line_number":30,"context_line":"        self.conn \u003d connection.Connection(cloud\u003dauth_user)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_66382e9f","line":27,"range":{"start_line":27,"start_character":24,"end_line":27,"end_character":45},"in_reply_to":"7faddb67_7c2be480","updated":"2019-08-22 09:17:29.000000000","message":"I got it. Thanks for your explain.","commit_id":"efad87ada886d5d49c2e6caffa9a92696fdc1279"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"b0a19bfe0eeb841c536803a78e878325efb4f732","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    def __init___(self):"},{"line_number":25,"context_line":"        default_user \u003d \"devstack-admin\""},{"line_number":26,"context_line":"        try:"},{"line_number":27,"context_line":"            auth_user \u003d CONF.compute.username"},{"line_number":28,"context_line":"        except:"},{"line_number":29,"context_line":"            auth_user \u003d default_user"},{"line_number":30,"context_line":"        self.conn \u003d connection.Connection(cloud\u003dauth_user)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_7c2be480","line":27,"range":{"start_line":27,"start_character":24,"end_line":27,"end_character":45},"in_reply_to":"7faddb67_e1972b8f","updated":"2019-08-22 08:55:46.000000000","message":"Thanks chenke, this is a workaround here. I have tested with config file containing compute group, it can still not read the username. So I hardcode here. Can we keep this before we find a solution? Same status in PlacementClient. https://review.opendev.org/#/c/659233/13/cyborg/common/placement_client.py","commit_id":"efad87ada886d5d49c2e6caffa9a92696fdc1279"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"08f5e1d8c4b9f4be3500458aa0be08b9c899eb3c","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                if code is None:"},{"line_number":60,"context_line":"                    response_error \u003d True"},{"line_number":61,"context_line":"                    continue"},{"line_number":62,"context_line":"                if code !\u003d 200:"},{"line_number":63,"context_line":"                    LOG.warning("},{"line_number":64,"context_line":"                        \u0027Nova event: %s returned with failed status.\u0027, event)"},{"line_number":65,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_016fe791","line":62,"range":{"start_line":62,"start_character":16,"end_line":62,"end_character":18},"updated":"2019-08-22 08:04:24.000000000","message":"elif maybe better.","commit_id":"efad87ada886d5d49c2e6caffa9a92696fdc1279"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"b0a19bfe0eeb841c536803a78e878325efb4f732","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                if code is None:"},{"line_number":60,"context_line":"                    response_error \u003d True"},{"line_number":61,"context_line":"                    continue"},{"line_number":62,"context_line":"                if code !\u003d 200:"},{"line_number":63,"context_line":"                    LOG.warning("},{"line_number":64,"context_line":"                        \u0027Nova event: %s returned with failed status.\u0027, event)"},{"line_number":65,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_3c348c48","line":62,"range":{"start_line":62,"start_character":16,"end_line":62,"end_character":18},"in_reply_to":"7faddb67_016fe791","updated":"2019-08-22 08:55:46.000000000","message":"Done","commit_id":"efad87ada886d5d49c2e6caffa9a92696fdc1279"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"08f5e1d8c4b9f4be3500458aa0be08b9c899eb3c","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        return True"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def notify_binding(self, context, server_id, dev_profile_name, status):"},{"line_number":73,"context_line":"        api_version \u003d \u00272.51\u0027"},{"line_number":74,"context_line":"        events \u003d self._get_acc_changed_event(server_id, dev_profile_name,"},{"line_number":75,"context_line":"                                             status)"},{"line_number":76,"context_line":"        result \u003d self._send_events(context, events, api_version\u003dapi_version)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_81ec3729","line":73,"range":{"start_line":73,"start_character":8,"end_line":73,"end_character":28},"updated":"2019-08-22 08:04:24.000000000","message":"Now this may be more appropriate. But I think the definition at the beginning of the file may be convenient for future modifications.","commit_id":"efad87ada886d5d49c2e6caffa9a92696fdc1279"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"b0a19bfe0eeb841c536803a78e878325efb4f732","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        return True"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def notify_binding(self, context, server_id, dev_profile_name, status):"},{"line_number":73,"context_line":"        api_version \u003d \u00272.51\u0027"},{"line_number":74,"context_line":"        events \u003d self._get_acc_changed_event(server_id, dev_profile_name,"},{"line_number":75,"context_line":"                                             status)"},{"line_number":76,"context_line":"        result \u003d self._send_events(context, events, api_version\u003dapi_version)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_1c319059","line":73,"range":{"start_line":73,"start_character":8,"end_line":73,"end_character":28},"in_reply_to":"7faddb67_81ec3729","updated":"2019-08-22 08:55:46.000000000","message":"just check it, this value is useless. I will remove it.","commit_id":"efad87ada886d5d49c2e6caffa9a92696fdc1279"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"daeacb15e9fbaffdd40055a5f7947d279717fb34","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _send_events(self, events):"},{"line_number":41,"context_line":"        url \u003d \"/os-server-external-events\""},{"line_number":42,"context_line":"        body \u003d {}"},{"line_number":43,"context_line":"        body[\"events\"] \u003d events"},{"line_number":44,"context_line":"        try:"},{"line_number":45,"context_line":"            response \u003d self.nova_client.post(url, json\u003dbody)"},{"line_number":46,"context_line":"        except nova_exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_fd654bb0","line":43,"range":{"start_line":42,"start_character":0,"end_line":43,"end_character":31},"updated":"2019-08-27 06:16:06.000000000","message":"Suggest in one line, like： body \u003d {\"events\": events}","commit_id":"f7a2b642870f73a16400f6c0ae9b43c6d33b2161"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"5d80ffe6150301ba6056c9a165aefbfcfcc4cc9f","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _send_events(self, events):"},{"line_number":41,"context_line":"        url \u003d \"/os-server-external-events\""},{"line_number":42,"context_line":"        body \u003d {}"},{"line_number":43,"context_line":"        body[\"events\"] \u003d events"},{"line_number":44,"context_line":"        try:"},{"line_number":45,"context_line":"            response \u003d self.nova_client.post(url, json\u003dbody)"},{"line_number":46,"context_line":"        except nova_exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_ddc2cf34","line":43,"range":{"start_line":42,"start_character":0,"end_line":43,"end_character":31},"in_reply_to":"7faddb67_fd654bb0","updated":"2019-08-27 06:37:47.000000000","message":"Done","commit_id":"f7a2b642870f73a16400f6c0ae9b43c6d33b2161"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"6c043bc51d1227ca4c427c13a7ec3d0dbbd23fe1","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            LOG.exception(\u0027Failed to notify nova on events: %s.\u0027, events)"},{"line_number":50,"context_line":"            return False"},{"line_number":51,"context_line":"        else:"},{"line_number":52,"context_line":"            if not isinstance(response, list):"},{"line_number":53,"context_line":"                LOG.error(\u0027Error response returned from nova: %s.\u0027, response)"},{"line_number":54,"context_line":"                return False"},{"line_number":55,"context_line":"            response_error \u003d False"}],"source_content_type":"text/x-python","patch_set":12,"id":"7faddb67_3aa4e206","line":52,"updated":"2019-09-04 04:50:40.000000000","message":"The response from Nova is actually a \u003cclass \u0027requests.models.Response\u0027\u003e object in the success case, not a list, resulting in a spurious error.","commit_id":"eacb2f9129cd6e86d42f6b896d9105239a6b4b20"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"6c043bc51d1227ca4c427c13a7ec3d0dbbd23fe1","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            LOG.exception(\u0027Failed to notify nova on events: %s.\u0027, events)"},{"line_number":50,"context_line":"            return False"},{"line_number":51,"context_line":"        else:"},{"line_number":52,"context_line":"            if not isinstance(response, list):"},{"line_number":53,"context_line":"                LOG.error(\u0027Error response returned from nova: %s.\u0027, response)"},{"line_number":54,"context_line":"                return False"},{"line_number":55,"context_line":"            response_error \u003d False"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_3e1da172","line":52,"updated":"2019-09-04 04:50:40.000000000","message":"response is not a list. Please see my comment from previous changeset.","commit_id":"824fe5bba5024a8e0b57f4d340dff7fa2ac2e783"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"5613acd54ec8736ef80611130a1f046a31c2ef89","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                (events, response.status_code, response.text))"},{"line_number":51,"context_line":"            return False"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def notify_binding(self, instance_uuid, dev_profile_name, status):"},{"line_number":54,"context_line":"        events \u003d self._get_acc_changed_event(instance_uuid, dev_profile_name,"},{"line_number":55,"context_line":"                                             status)"},{"line_number":56,"context_line":"        result \u003d self._send_events(events)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_f93a7f32","line":53,"range":{"start_line":53,"start_character":8,"end_line":53,"end_character":22},"updated":"2019-09-06 03:15:58.000000000","message":"This method could be renamed like notify_bind_result.","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"a66e70c172b8b966d1b61d9779ffc3c6ccbad70d","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                (events, response.status_code, response.text))"},{"line_number":51,"context_line":"            return False"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def notify_binding(self, instance_uuid, dev_profile_name, status):"},{"line_number":54,"context_line":"        events \u003d self._get_acc_changed_event(instance_uuid, dev_profile_name,"},{"line_number":55,"context_line":"                                             status)"},{"line_number":56,"context_line":"        result \u003d self._send_events(events)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_bf1dc7be","line":53,"range":{"start_line":53,"start_character":8,"end_line":53,"end_character":22},"in_reply_to":"5faad753_7fe18fd0","updated":"2019-09-06 06:29:06.000000000","message":"This also ok for me now. But for those who don\u0027t know about cyborg, they may mistakenly think that they are sending a notification that is being bound instead of the result that is already bound. In fact, the binding action is done by cyborg, and the thing to do here is to inform the result of the binding. It is recommended to make the function self-explanatory as much as possible.","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"880290b48ff89793a3f8e96eab67a52b1ecb771b","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                (events, response.status_code, response.text))"},{"line_number":51,"context_line":"            return False"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def notify_binding(self, instance_uuid, dev_profile_name, status):"},{"line_number":54,"context_line":"        events \u003d self._get_acc_changed_event(instance_uuid, dev_profile_name,"},{"line_number":55,"context_line":"                                             status)"},{"line_number":56,"context_line":"        result \u003d self._send_events(events)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_ba8dd57c","line":53,"range":{"start_line":53,"start_character":8,"end_line":53,"end_character":22},"in_reply_to":"5faad753_bf1dc7be","updated":"2019-09-06 06:34:36.000000000","message":"Hmmm, sounds reasonable, I will change to it.","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"ecc2c525a32f5db9303c760f9cd19b6b0da3b328","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                (events, response.status_code, response.text))"},{"line_number":51,"context_line":"            return False"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def notify_binding(self, instance_uuid, dev_profile_name, status):"},{"line_number":54,"context_line":"        events \u003d self._get_acc_changed_event(instance_uuid, dev_profile_name,"},{"line_number":55,"context_line":"                                             status)"},{"line_number":56,"context_line":"        result \u003d self._send_events(events)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_7fe18fd0","line":53,"range":{"start_line":53,"start_character":8,"end_line":53,"end_character":22},"in_reply_to":"5faad753_f93a7f32","updated":"2019-09-06 05:55:32.000000000","message":"it sounds good, we can some comment about the name before, please see https://review.opendev.org/#/c/674520/1/cyborg/compute/nova.py@132 \nif you think notify_bind_result is better, please let me know :)","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"98ebbdacaf8a3fecb5dc9ccc26f7df804e27535c","unresolved":false,"context_lines":[{"line_number":23,"context_line":"    def __init__(self):"},{"line_number":24,"context_line":"        default_user \u003d \"devstack-admin\""},{"line_number":25,"context_line":"        try:"},{"line_number":26,"context_line":"            auth_user \u003d CONF.compute.username"},{"line_number":27,"context_line":"        except Exception:"},{"line_number":28,"context_line":"            auth_user \u003d default_user"},{"line_number":29,"context_line":"        self.conn \u003d connection.Connection(cloud\u003dauth_user)"}],"source_content_type":"text/x-python","patch_set":18,"id":"5faad753_d3e1492c","line":26,"range":{"start_line":26,"start_character":24,"end_line":26,"end_character":45},"updated":"2019-09-11 03:35:52.000000000","message":"another thing, I don\u0027t this is the right way to get auth with openstacksdk, \"devstack-admin\" is not a user, it is a openstacksdk config file section as below. devstack autogenerate this file in /etc/openstack dir, but if you deployed not with devstack. there will not have the config file. so we should use cyborg.conf auth config to get the auth session. placement client auth has the same problem.\n  devstack-admin:\n    auth:\n      auth_url: http://172.16.1.68/identity\n      password: P@ssw0rd\n      project_domain_id: default\n      project_name: admin\n      user_domain_id: default\n      username: admin\n    identity_api_version: \u00273\u0027\n    region_name: RegionOne\n    volume_api_version: \u00273\u0027","commit_id":"dfb32d4866db697ed162b608865154c0e6682f3b"}],"cyborg/compute/__init__.py":[{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"266205fa4b0f442b7247d59967dd3561edf2d132","unresolved":false,"context_lines":[{"line_number":28,"context_line":"CONF.register_opts(compute_opts)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def NovaAPI():"},{"line_number":32,"context_line":"    compute_api_class \u003d CONF.compute_api_class"},{"line_number":33,"context_line":"    cls \u003d importutils.import_class(compute_api_class)"},{"line_number":34,"context_line":"    return cls()"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_6b47b51e","line":31,"updated":"2019-08-05 20:53:09.000000000","message":"Please follow the same connection mechanism as Placement.","commit_id":"ed422eabde4ed5a768f1e83a0b576fd39d43ad54"}],"cyborg/compute/nova.py":[{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"266205fa4b0f442b7247d59967dd3561edf2d132","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    if privileged_user and CONF[NOVA_GROUP].auth_type:"},{"line_number":58,"context_line":"        LOG.debug(\u0027Creating Keystone auth plugin from conf\u0027)"},{"line_number":59,"context_line":"        n_auth \u003d ks_loading.load_auth_from_conf_options(CONF, NOVA_GROUP)"},{"line_number":60,"context_line":"    else:"},{"line_number":61,"context_line":"        if CONF[NOVA_GROUP].token_auth_url:"},{"line_number":62,"context_line":"            url \u003d CONF[NOVA_GROUP].token_auth_url"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_0bbde100","line":59,"updated":"2019-08-05 20:53:09.000000000","message":"This is the obsolete way. Please follow:\nhttps://opendev.org/openstack/cyborg/src/branch/master/cyborg/common/placement_client.py#L34","commit_id":"ed422eabde4ed5a768f1e83a0b576fd39d43ad54"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"b70f0d0c501c2260edb2553859089ec65e9e306f","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                return False"},{"line_number":130,"context_line":"        return True"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def bind(self, context, server_id, arq_id, status):"},{"line_number":133,"context_line":"        api_version \u003d \u00272.51\u0027"},{"line_number":134,"context_line":"        events \u003d self._get_acc_changed_event(server_id, arq_id, status)"},{"line_number":135,"context_line":"        result \u003d self._send_events(context, events, api_version\u003dapi_version)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_ab0feddd","line":132,"range":{"start_line":132,"start_character":8,"end_line":132,"end_character":12},"updated":"2019-08-05 20:55:08.000000000","message":"This is better called \u0027notify_binding\u0027 or something like that.","commit_id":"ed422eabde4ed5a768f1e83a0b576fd39d43ad54"}],"cyborg/objects/ext_arq.py":[{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"266205fa4b0f442b7247d59967dd3561edf2d132","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                LOG.error(\"Failed to allocate attach handle\")"},{"line_number":281,"context_line":"                arq.state \u003d constants.ARQ_BIND_FAILED"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        if arq.state \u003d\u003d constants.ARQ_BIND_FAILE:"},{"line_number":284,"context_line":"            status \u003d \"failed\""},{"line_number":285,"context_line":"        elif arq.state \u003d\u003d constants.ARQ_BOUND:"},{"line_number":286,"context_line":"            status \u003d \"completed\""}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_4bde796d","line":283,"range":{"start_line":283,"start_character":34,"end_line":283,"end_character":48},"updated":"2019-08-05 20:53:09.000000000","message":"Typo","commit_id":"ed422eabde4ed5a768f1e83a0b576fd39d43ad54"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"52382b933988f2008d07a1c7f39b21da484da886","unresolved":false,"context_lines":[{"line_number":285,"context_line":"        elif arq.state \u003d\u003d constants.ARQ_BOUND:"},{"line_number":286,"context_line":"            status \u003d \"completed\""},{"line_number":287,"context_line":"        nova_api \u003d nova_client.API()"},{"line_number":288,"context_line":"        nova_api.notify_binding(context, instance_uuid, arq.id, status)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        # FIXME db_deployable.num_accelerators_in_use +\u003d 1"},{"line_number":291,"context_line":"        # FIXME write deployable to db"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_5b012039","line":288,"range":{"start_line":288,"start_character":56,"end_line":288,"end_character":62},"updated":"2019-08-09 07:11:45.000000000","message":"Should be arq.uuid.","commit_id":"07237a76809c06920f938824e44a01453b318169"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a763ef7ace198185db6d4b465a2ca2eaae94dd25","unresolved":false,"context_lines":[{"line_number":285,"context_line":"        elif arq.state \u003d\u003d constants.ARQ_BOUND:"},{"line_number":286,"context_line":"            status \u003d \"completed\""},{"line_number":287,"context_line":"        nova_api \u003d nova_client.API()"},{"line_number":288,"context_line":"        nova_api.notify_binding(context, instance_uuid, arq.id, status)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        # FIXME db_deployable.num_accelerators_in_use +\u003d 1"},{"line_number":291,"context_line":"        # FIXME write deployable to db"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_14ba52bf","line":288,"range":{"start_line":288,"start_character":56,"end_line":288,"end_character":62},"in_reply_to":"7faddb67_5b012039","updated":"2019-08-14 03:00:25.000000000","message":"Done","commit_id":"07237a76809c06920f938824e44a01453b318169"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"577faa5c3de39b25c0e0060ba663296410ee43b7","unresolved":false,"context_lines":[{"line_number":313,"context_line":"            if not instance_uuid:"},{"line_number":314,"context_line":"                instance_uuid \u003d valid_fields[arq_uuid][\u0027instance_uuid\u0027]"},{"line_number":315,"context_line":"            if patch[0][\u0027op\u0027] \u003d\u003d \u0027add\u0027:  # All ops are \u0027add\u0027"},{"line_number":316,"context_line":"                bind_or_unbind \u003d True"},{"line_number":317,"context_line":"                extarq.bind(context,"},{"line_number":318,"context_line":"                            valid_fields[arq_uuid][\u0027hostname\u0027],"},{"line_number":319,"context_line":"                            valid_fields[arq_uuid][\u0027device_rp_uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_2846bc7c","line":316,"updated":"2019-08-20 00:23:59.000000000","message":"I don\u0027t think we need unbind notification, as stated in the other file.","commit_id":"d47684cd1711996d3a7965b64488d1f84acafd5f"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"bbd9f5cbdd9f60970326892fe3c1651a04e01a27","unresolved":false,"context_lines":[{"line_number":313,"context_line":"                instance_uuid \u003d valid_fields[arq_uuid][\u0027instance_uuid\u0027]"},{"line_number":314,"context_line":"            if patch[0][\u0027op\u0027] \u003d\u003d \u0027add\u0027:  # All ops are \u0027add\u0027"},{"line_number":315,"context_line":"                # True if do binding, False if do unbinding."},{"line_number":316,"context_line":"                bind_action \u003d True"},{"line_number":317,"context_line":"                extarq.bind(context,"},{"line_number":318,"context_line":"                            valid_fields[arq_uuid][\u0027hostname\u0027],"},{"line_number":319,"context_line":"                            valid_fields[arq_uuid][\u0027device_rp_uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"7faddb67_59966cf2","line":316,"range":{"start_line":316,"start_character":16,"end_line":316,"end_character":34},"updated":"2019-08-20 07:23:02.000000000","message":"Minor: just a suggestion: Why not use patch[0][\u0027op\u0027] \u003d\u003d \u0027add\u0027 as the boolean?","commit_id":"efad87ada886d5d49c2e6caffa9a92696fdc1279"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"22215d8beb02b269f51b154df1d973eb6355497e","unresolved":false,"context_lines":[{"line_number":325,"context_line":"                            valid_fields[arq_uuid][\u0027hostname\u0027],"},{"line_number":326,"context_line":"                            valid_fields[arq_uuid][\u0027device_rp_uuid\u0027],"},{"line_number":327,"context_line":"                            valid_fields[arq_uuid][\u0027instance_uuid\u0027])"},{"line_number":328,"context_line":"                status \u003d \"completed\""},{"line_number":329,"context_line":"                if extarq.arq.state \u003d\u003d constants.ARQ_BIND_FAILED:"},{"line_number":330,"context_line":"                    status \u003d \"failed\""},{"line_number":331,"context_line":"                elif extarq.arq.state \u003d\u003d constants.ARQ_BOUND:"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_d77dceb2","line":328,"updated":"2019-08-27 03:07:41.000000000","message":"If first ARQ bind failed and second one succeeded, this will set the status to \u0027completed\u0027 instead of \u0027failed\u0027. The status should be initialized to \u0027completed\u0027 outside the loop.","commit_id":"9ba446cbd981355b7e9ad35845acb4d510b48377"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"daeacb15e9fbaffdd40055a5f7947d279717fb34","unresolved":false,"context_lines":[{"line_number":320,"context_line":"                instance_uuid \u003d valid_fields[arq_uuid][\u0027instance_uuid\u0027]"},{"line_number":321,"context_line":"            if patch[0][\u0027op\u0027] \u003d\u003d \u0027add\u0027:  # All ops are \u0027add\u0027"},{"line_number":322,"context_line":"                # True if do binding, False if do unbinding."},{"line_number":323,"context_line":"                bind_action \u003d True"},{"line_number":324,"context_line":"                extarq.bind(context,"},{"line_number":325,"context_line":"                            valid_fields[arq_uuid][\u0027hostname\u0027],"},{"line_number":326,"context_line":"                            valid_fields[arq_uuid][\u0027device_rp_uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_1dc3878c","line":323,"range":{"start_line":323,"start_character":16,"end_line":323,"end_character":34},"updated":"2019-08-27 06:16:06.000000000","message":"Hi, xinran. This var \u0027bind_action\u0027 should be defined before \u0027for\u0027 cycle in Line 315. SomeCase this will raise an error. Beacuse Line 338 will use this var. We can just init it like bind_action \u003d False before for cycle.","commit_id":"f7a2b642870f73a16400f6c0ae9b43c6d33b2161"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"5d80ffe6150301ba6056c9a165aefbfcfcc4cc9f","unresolved":false,"context_lines":[{"line_number":320,"context_line":"                instance_uuid \u003d valid_fields[arq_uuid][\u0027instance_uuid\u0027]"},{"line_number":321,"context_line":"            if patch[0][\u0027op\u0027] \u003d\u003d \u0027add\u0027:  # All ops are \u0027add\u0027"},{"line_number":322,"context_line":"                # True if do binding, False if do unbinding."},{"line_number":323,"context_line":"                bind_action \u003d True"},{"line_number":324,"context_line":"                extarq.bind(context,"},{"line_number":325,"context_line":"                            valid_fields[arq_uuid][\u0027hostname\u0027],"},{"line_number":326,"context_line":"                            valid_fields[arq_uuid][\u0027device_rp_uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_1dc94759","line":323,"range":{"start_line":323,"start_character":16,"end_line":323,"end_character":34},"in_reply_to":"7faddb67_1dc3878c","updated":"2019-08-27 06:37:47.000000000","message":"Done","commit_id":"f7a2b642870f73a16400f6c0ae9b43c6d33b2161"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"6c043bc51d1227ca4c427c13a7ec3d0dbbd23fe1","unresolved":false,"context_lines":[{"line_number":319,"context_line":"                            valid_fields[arq_uuid][\u0027hostname\u0027],"},{"line_number":320,"context_line":"                            valid_fields[arq_uuid][\u0027device_rp_uuid\u0027],"},{"line_number":321,"context_line":"                            valid_fields[arq_uuid][\u0027instance_uuid\u0027])"},{"line_number":322,"context_line":"                status \u003d \"completed\""},{"line_number":323,"context_line":"                if extarq.arq.state \u003d\u003d constants.ARQ_BIND_FAILED:"},{"line_number":324,"context_line":"                    status \u003d \"failed\""},{"line_number":325,"context_line":"                elif extarq.arq.state \u003d\u003d constants.ARQ_BOUND:"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_7e2559be","line":322,"updated":"2019-09-04 04:50:40.000000000","message":"If the first ARQ fails but 2nd one completes, this will set the status to completed, instead of failed.","commit_id":"824fe5bba5024a8e0b57f4d340dff7fa2ac2e783"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"5613acd54ec8736ef80611130a1f046a31c2ef89","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def create(self, context, device_profile_id\u003dNone):"},{"line_number":73,"context_line":"        \"\"\"Create an ExtARQ record in the DB.\"\"\""},{"line_number":74,"context_line":"        if \u0027device_profile_name\u0027 not in self.arq and not device_profile_id:"},{"line_number":75,"context_line":"            raise exception.ObjectActionError("},{"line_number":76,"context_line":"                action\u003d\u0027create\u0027,"},{"line_number":77,"context_line":"                reason\u003d\u0027Device profile name is required in ARQ\u0027)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_59bdd366","line":74,"range":{"start_line":74,"start_character":7,"end_line":74,"end_character":49},"updated":"2019-09-06 03:15:58.000000000","message":"Although there is no direct relationship between this line and this patch, I would like to ask a question. The arq object[1] currently stores the device_profile object instead of the name, so I don\u0027t think it can be obtained directly here.\n[1]. https://github.com/openstack/cyborg/blob/master/cyborg/objects/arq.py#L38","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"a66e70c172b8b966d1b61d9779ffc3c6ccbad70d","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def create(self, context, device_profile_id\u003dNone):"},{"line_number":73,"context_line":"        \"\"\"Create an ExtARQ record in the DB.\"\"\""},{"line_number":74,"context_line":"        if \u0027device_profile_name\u0027 not in self.arq and not device_profile_id:"},{"line_number":75,"context_line":"            raise exception.ObjectActionError("},{"line_number":76,"context_line":"                action\u003d\u0027create\u0027,"},{"line_number":77,"context_line":"                reason\u003d\u0027Device profile name is required in ARQ\u0027)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_df6be31c","line":74,"range":{"start_line":74,"start_character":7,"end_line":74,"end_character":49},"in_reply_to":"5faad753_3fba37de","updated":"2019-09-06 06:29:06.000000000","message":"Oh.. Thanks,Sorry for didn\u0027t find it.","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"ecc2c525a32f5db9303c760f9cd19b6b0da3b328","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def create(self, context, device_profile_id\u003dNone):"},{"line_number":73,"context_line":"        \"\"\"Create an ExtARQ record in the DB.\"\"\""},{"line_number":74,"context_line":"        if \u0027device_profile_name\u0027 not in self.arq and not device_profile_id:"},{"line_number":75,"context_line":"            raise exception.ObjectActionError("},{"line_number":76,"context_line":"                action\u003d\u0027create\u0027,"},{"line_number":77,"context_line":"                reason\u003d\u0027Device profile name is required in ARQ\u0027)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_3fba37de","line":74,"range":{"start_line":74,"start_character":7,"end_line":74,"end_character":49},"in_reply_to":"5faad753_59bdd366","updated":"2019-09-06 05:55:32.000000000","message":"This patch based on patch 670468: https://review.opendev.org/#/c/670468/25/cyborg/objects/arq.py,\nhere is the updated fields of arq object.","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"5613acd54ec8736ef80611130a1f046a31c2ef89","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    def delete_by_instance(cls, context, instance_uuid):"},{"line_number":132,"context_line":"        \"\"\"Delete all ARQs for given instance.\"\"\""},{"line_number":133,"context_line":"        obj_extarqs \u003d [extarq for extarq in objects.ExtARQ.list(context)"},{"line_number":134,"context_line":"                       if extarq.arq[\u0027instance_uuid\u0027] \u003d\u003d instance_uuid]"},{"line_number":135,"context_line":"        for obj_extarq in obj_extarqs:"},{"line_number":136,"context_line":"            # TODO unbind if state is \u0027Bound\u0027"},{"line_number":137,"context_line":"            LOG.info(\u0027Deleting obj_extarq uuid %s for instance %s\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_997fcbaa","line":134,"range":{"start_line":134,"start_character":37,"end_line":134,"end_character":51},"updated":"2019-09-06 03:15:58.000000000","message":"This should be device_instance_uuid? [1].https://github.com/openstack/cyborg/blob/master/cyborg/objects/arq.py#L42","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"ecc2c525a32f5db9303c760f9cd19b6b0da3b328","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    def delete_by_instance(cls, context, instance_uuid):"},{"line_number":132,"context_line":"        \"\"\"Delete all ARQs for given instance.\"\"\""},{"line_number":133,"context_line":"        obj_extarqs \u003d [extarq for extarq in objects.ExtARQ.list(context)"},{"line_number":134,"context_line":"                       if extarq.arq[\u0027instance_uuid\u0027] \u003d\u003d instance_uuid]"},{"line_number":135,"context_line":"        for obj_extarq in obj_extarqs:"},{"line_number":136,"context_line":"            # TODO unbind if state is \u0027Bound\u0027"},{"line_number":137,"context_line":"            LOG.info(\u0027Deleting obj_extarq uuid %s for instance %s\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_7fa50fb5","line":134,"range":{"start_line":134,"start_character":37,"end_line":134,"end_character":51},"in_reply_to":"5faad753_997fcbaa","updated":"2019-09-06 05:55:32.000000000","message":"same situation as I stated above.","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"5613acd54ec8736ef80611130a1f046a31c2ef89","unresolved":false,"context_lines":[{"line_number":307,"context_line":"        self.save(context)  # ARQ state changes get committed here"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"    @classmethod"},{"line_number":310,"context_line":"    def apply_patch(cls, context, patch_list, valid_fields):"},{"line_number":311,"context_line":"        \"\"\"Apply JSON patch. See api/controllers/v1/arqs.py. \"\"\""},{"line_number":312,"context_line":"        device_profile_name \u003d None"},{"line_number":313,"context_line":"        instance_uuid \u003d None"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_14088226","line":310,"range":{"start_line":310,"start_character":7,"end_line":310,"end_character":60},"updated":"2019-09-06 03:15:58.000000000","message":"Hi, Xinran. Now I can not understand this context of patch_list, Could you give some explain about these param or adding unittest about this function.","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"ecc2c525a32f5db9303c760f9cd19b6b0da3b328","unresolved":false,"context_lines":[{"line_number":307,"context_line":"        self.save(context)  # ARQ state changes get committed here"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"    @classmethod"},{"line_number":310,"context_line":"    def apply_patch(cls, context, patch_list, valid_fields):"},{"line_number":311,"context_line":"        \"\"\"Apply JSON patch. See api/controllers/v1/arqs.py. \"\"\""},{"line_number":312,"context_line":"        device_profile_name \u003d None"},{"line_number":313,"context_line":"        instance_uuid \u003d None"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_3f88f71d","line":310,"range":{"start_line":310,"start_character":7,"end_line":310,"end_character":60},"in_reply_to":"5faad753_14088226","updated":"2019-09-06 05:55:32.000000000","message":"https://review.opendev.org/#/c/670468/25/cyborg/api/controllers/v2/arqs.py, please see the API layer. Here is some description of patch_list like:\n        :param patch_list: A map from ARQ UUIDs to their JSON patches:\n            {\"$arq_uuid\": [\n                {\"path\": \"/hostname\", \"op\": ADD/RM, \"value\": \"...\"},\n                {\"path\": \"/device_rp_uuid\", \"op\": ADD/RM, \"value\": \"...\"},\n                {\"path\": \"/instance_uuid\", \"op\": ADD/RM, \"value\": \"...\"},\n               ],\n             \"$arq_uuid\": [...]\n            }","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"5613acd54ec8736ef80611130a1f046a31c2ef89","unresolved":false,"context_lines":[{"line_number":335,"context_line":"            else:"},{"line_number":336,"context_line":"                bind_action \u003d False"},{"line_number":337,"context_line":"                extarq.unbind(context)"},{"line_number":338,"context_line":"        if bind_action:"},{"line_number":339,"context_line":"            nova_api \u003d nova_client.NovaAPI()"},{"line_number":340,"context_line":"            nova_api.notify_binding(instance_uuid,"},{"line_number":341,"context_line":"                                    device_profile_name, status)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_14a40208","line":338,"range":{"start_line":338,"start_character":8,"end_line":338,"end_character":23},"updated":"2019-09-06 03:15:58.000000000","message":"This line means that only all arqs bind success, then will notify nova bind had success? But if some of arqs bind failed. Should we consider unbinding the successfully bound object?","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"ecc2c525a32f5db9303c760f9cd19b6b0da3b328","unresolved":false,"context_lines":[{"line_number":335,"context_line":"            else:"},{"line_number":336,"context_line":"                bind_action \u003d False"},{"line_number":337,"context_line":"                extarq.unbind(context)"},{"line_number":338,"context_line":"        if bind_action:"},{"line_number":339,"context_line":"            nova_api \u003d nova_client.NovaAPI()"},{"line_number":340,"context_line":"            nova_api.notify_binding(instance_uuid,"},{"line_number":341,"context_line":"                                    device_profile_name, status)"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_1f989b68","line":338,"range":{"start_line":338,"start_character":8,"end_line":338,"end_character":23},"in_reply_to":"5faad753_14a40208","updated":"2019-09-06 05:55:32.000000000","message":"This line means we only notify Nova when do binding, we will not notify Nova in case of unbinding. This is our agreement in this release. \nIf bind succeed, the status of event is \"complete\", otherwise \"failed\"","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"0de8e835e72c21e8cf2f74d1e58cb29c5355f72a","unresolved":false,"context_lines":[{"line_number":337,"context_line":"                extarq.unbind(context)"},{"line_number":338,"context_line":"        if bind_action:"},{"line_number":339,"context_line":"            nova_api \u003d nova_client.NovaAPI()"},{"line_number":340,"context_line":"            nova_api.notify_binding(instance_uuid,"},{"line_number":341,"context_line":"                                    device_profile_name, status)"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"    def unbind(self, context):"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_7499b61d","line":340,"range":{"start_line":340,"start_character":21,"end_line":340,"end_character":35},"updated":"2019-09-06 04:33:40.000000000","message":"If this fails for whatever reason, nothing deletes the ARQs. May be we should unbind and delete the ARQs on failure?","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"ecc2c525a32f5db9303c760f9cd19b6b0da3b328","unresolved":false,"context_lines":[{"line_number":337,"context_line":"                extarq.unbind(context)"},{"line_number":338,"context_line":"        if bind_action:"},{"line_number":339,"context_line":"            nova_api \u003d nova_client.NovaAPI()"},{"line_number":340,"context_line":"            nova_api.notify_binding(instance_uuid,"},{"line_number":341,"context_line":"                                    device_profile_name, status)"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"    def unbind(self, context):"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_ff9edf52","line":340,"range":{"start_line":340,"start_character":21,"end_line":340,"end_character":35},"in_reply_to":"5faad753_7499b61d","updated":"2019-09-06 05:55:32.000000000","message":"If this failed, I think VM will not boot successfully, and Nova should deal with that, not in this side.","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"a66e70c172b8b966d1b61d9779ffc3c6ccbad70d","unresolved":false,"context_lines":[{"line_number":337,"context_line":"                extarq.unbind(context)"},{"line_number":338,"context_line":"        if bind_action:"},{"line_number":339,"context_line":"            nova_api \u003d nova_client.NovaAPI()"},{"line_number":340,"context_line":"            nova_api.notify_binding(instance_uuid,"},{"line_number":341,"context_line":"                                    device_profile_name, status)"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"    def unbind(self, context):"}],"source_content_type":"text/x-python","patch_set":15,"id":"5faad753_ba3155ef","line":340,"range":{"start_line":340,"start_character":21,"end_line":340,"end_character":35},"in_reply_to":"5faad753_ff9edf52","updated":"2019-09-06 06:29:06.000000000","message":"Nova does this will be better.","commit_id":"7666ede20156f96bc611ec1b7e31f6a030aa3116"}],"cyborg/tests/unit/accelerator/drivers/fpga/intel/test_driver.py":[{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"52382b933988f2008d07a1c7f39b21da484da886","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        super(TestIntelFPGADriver, self).setUp()"},{"line_number":31,"context_line":"        self.syspath \u003d sysinfo.SYS_FPGA"},{"line_number":32,"context_line":"        self.pcipath \u003d sysinfo.PCI_DEVICES_PATH"},{"line_number":33,"context_line":"        self.pcipath_pattern \u003d sysinfo.PCI_DEVICES_PATH_PATTERN"},{"line_number":34,"context_line":"        tmp_sys_dir \u003d self.useFixture(fixtures.TempDir())"},{"line_number":35,"context_line":"        prepare_test_data.create_fake_sysfs(tmp_sys_dir.path)"},{"line_number":36,"context_line":"        tmp_path \u003d tmp_sys_dir.path"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_9bceb82b","line":33,"updated":"2019-08-09 07:11:45.000000000","message":"Seems to be same change as https://review.opendev.org/#/c/675058/. \n\nAlso unrelated to Nova notification.","commit_id":"07237a76809c06920f938824e44a01453b318169"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a763ef7ace198185db6d4b465a2ca2eaae94dd25","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        super(TestIntelFPGADriver, self).setUp()"},{"line_number":31,"context_line":"        self.syspath \u003d sysinfo.SYS_FPGA"},{"line_number":32,"context_line":"        self.pcipath \u003d sysinfo.PCI_DEVICES_PATH"},{"line_number":33,"context_line":"        self.pcipath_pattern \u003d sysinfo.PCI_DEVICES_PATH_PATTERN"},{"line_number":34,"context_line":"        tmp_sys_dir \u003d self.useFixture(fixtures.TempDir())"},{"line_number":35,"context_line":"        prepare_test_data.create_fake_sysfs(tmp_sys_dir.path)"},{"line_number":36,"context_line":"        tmp_path \u003d tmp_sys_dir.path"}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_b4b01edf","line":33,"in_reply_to":"7faddb67_9bceb82b","updated":"2019-08-14 03:00:25.000000000","message":"Add this here to pass the test, this patch has been merged now. Please rebase your p5 on master so we can remove this.","commit_id":"07237a76809c06920f938824e44a01453b318169"}],"requirements.txt":[{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"52382b933988f2008d07a1c7f39b21da484da886","unresolved":false,"context_lines":[{"line_number":27,"context_line":"psutil\u003e\u003d3.2.2 # BSD"},{"line_number":28,"context_line":"mock\u003e\u003d2.0.0 # BSD"},{"line_number":29,"context_line":"python-glanceclient\u003e\u003d2.3.0 # Apache-2.0"},{"line_number":30,"context_line":"python-novaclient\u003e\u003d9.1.0 # Apache-2.0"}],"source_content_type":"text/plain","patch_set":3,"id":"7faddb67_3bdf84d7","line":30,"updated":"2019-08-09 07:11:45.000000000","message":"Why do we need this dependency?","commit_id":"07237a76809c06920f938824e44a01453b318169"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"a763ef7ace198185db6d4b465a2ca2eaae94dd25","unresolved":false,"context_lines":[{"line_number":27,"context_line":"psutil\u003e\u003d3.2.2 # BSD"},{"line_number":28,"context_line":"mock\u003e\u003d2.0.0 # BSD"},{"line_number":29,"context_line":"python-glanceclient\u003e\u003d2.3.0 # Apache-2.0"},{"line_number":30,"context_line":"python-novaclient\u003e\u003d9.1.0 # Apache-2.0"}],"source_content_type":"text/plain","patch_set":3,"id":"7faddb67_74caa64f","line":30,"in_reply_to":"7faddb67_3bdf84d7","updated":"2019-08-14 03:00:25.000000000","message":"To raise novaclient related exception, please see https://review.opendev.org/#/c/674520/3/cyborg/common/nova_client.py L46 etc.","commit_id":"07237a76809c06920f938824e44a01453b318169"}]}
