)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"786a6bbf6d91cb1227dcb3a20bc3b780ffcd224a","unresolved":false,"context_lines":[{"line_number":24,"context_line":"connection_url \u003d http://169.254.0.1"},{"line_number":25,"context_line":"connection_username \u003d root"},{"line_number":26,"context_line":"connection_password \u003d xenroot"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: I684034359fe0571bc92dbcf342a9821553b1da35"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"ba5da102_7b0fb736","line":27,"updated":"2016-11-03 14:40:56.000000000","message":"DocImpact","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"}],"etc/oslo-config-generator/openvswitch_agent.ini":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":4,"context_line":""},{"line_number":5,"context_line":"namespace \u003d neutron.ml2.ovs.agent"},{"line_number":6,"context_line":"namespace \u003d oslo.log"},{"line_number":7,"context_line":"namespace \u003d neutron.ml2.xenapi"}],"source_content_type":"text/x-properties","patch_set":13,"id":"da4df55a_5c872561","line":7,"updated":"2016-12-22 14:02:48.000000000","message":"nit: maybe move one line up to keep ml2 stuff closer","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":4,"context_line":""},{"line_number":5,"context_line":"namespace \u003d neutron.ml2.ovs.agent"},{"line_number":6,"context_line":"namespace \u003d oslo.log"},{"line_number":7,"context_line":"namespace \u003d neutron.ml2.xenapi"}],"source_content_type":"text/x-properties","patch_set":13,"id":"da4df55a_ec7f1564","line":7,"in_reply_to":"da4df55a_5c872561","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"}],"neutron/agent/common/config.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"977554a98ac1f31fac31530268c4cf9946a9d240","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    # rootwrap daemon command, which may be necessary for Xen?"},{"line_number":44,"context_line":"    cfg.StrOpt(\u0027root_helper_daemon\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\"Root helper daemon application to use when possible. \""},{"line_number":46,"context_line":"                      \"For the agent which need run commands in Dom0 in the \""},{"line_number":47,"context_line":"                      \"hypervisor of XenServer, this item should be set as \""},{"line_number":48,"context_line":"                      \"\u0027xenapi_root_helper\u0027, so that it will keep a XenAPI \""},{"line_number":49,"context_line":"                      \"session to pass commands to Dom0.\")),"}],"source_content_type":"text/x-python","patch_set":17,"id":"ba5201f7_ea75b6ca","line":46,"range":{"start_line":46,"start_character":43,"end_line":46,"end_character":60},"updated":"2017-01-06 20:08:29.000000000","message":"needs to execute commands in Dom0","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"53964b34a3363378f470e1af19c20ac1c0ec123a","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    # rootwrap daemon command, which may be necessary for Xen?"},{"line_number":44,"context_line":"    cfg.StrOpt(\u0027root_helper_daemon\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\"Root helper daemon application to use when possible. \""},{"line_number":46,"context_line":"                      \"For the agent which need run commands in Dom0 in the \""},{"line_number":47,"context_line":"                      \"hypervisor of XenServer, this item should be set as \""},{"line_number":48,"context_line":"                      \"\u0027xenapi_root_helper\u0027, so that it will keep a XenAPI \""},{"line_number":49,"context_line":"                      \"session to pass commands to Dom0.\")),"}],"source_content_type":"text/x-python","patch_set":17,"id":"ba5201f7_a3f750d1","line":46,"range":{"start_line":46,"start_character":43,"end_line":46,"end_character":60},"in_reply_to":"ba5201f7_ea75b6ca","updated":"2017-01-07 04:54:12.000000000","message":"Done","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"977554a98ac1f31fac31530268c4cf9946a9d240","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    cfg.StrOpt(\u0027root_helper_daemon\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\"Root helper daemon application to use when possible. \""},{"line_number":46,"context_line":"                      \"For the agent which need run commands in Dom0 in the \""},{"line_number":47,"context_line":"                      \"hypervisor of XenServer, this item should be set as \""},{"line_number":48,"context_line":"                      \"\u0027xenapi_root_helper\u0027, so that it will keep a XenAPI \""},{"line_number":49,"context_line":"                      \"session to pass commands to Dom0.\")),"},{"line_number":50,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":17,"id":"ba5201f7_ca61d206","line":47,"range":{"start_line":47,"start_character":72,"end_line":47,"end_character":74},"updated":"2017-01-06 20:08:29.000000000","message":"-\u003e to?","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"53964b34a3363378f470e1af19c20ac1c0ec123a","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    cfg.StrOpt(\u0027root_helper_daemon\u0027,"},{"line_number":45,"context_line":"               help\u003d_(\"Root helper daemon application to use when possible. \""},{"line_number":46,"context_line":"                      \"For the agent which need run commands in Dom0 in the \""},{"line_number":47,"context_line":"                      \"hypervisor of XenServer, this item should be set as \""},{"line_number":48,"context_line":"                      \"\u0027xenapi_root_helper\u0027, so that it will keep a XenAPI \""},{"line_number":49,"context_line":"                      \"session to pass commands to Dom0.\")),"},{"line_number":50,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":17,"id":"ba5201f7_c30294b3","line":47,"range":{"start_line":47,"start_character":72,"end_line":47,"end_character":74},"in_reply_to":"ba5201f7_ca61d206","updated":"2017-01-07 04:54:12.000000000","message":"Done","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"}],"neutron/agent/common/ovs_lib.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":47,"context_line":"FAILMODE_STANDALONE \u003d \u0027standalone\u0027"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"ovs_conf.register_ovs_agent_opts()"},{"line_number":50,"context_line":"xenapi_conf.register_xenapi_opts()"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_77a19645","line":50,"updated":"2016-12-16 10:53:54.000000000","message":"in general, options should be registered by main() functions of interested processes.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"}],"neutron/agent/linux/utils.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"6f696e91e2a69405607e2dbc9ab736778dc34c2c","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        with cls.__lock:"},{"line_number":66,"context_line":"            if cls.__client is None:"},{"line_number":67,"context_line":"                if \"xenapi_root_helper\" in cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":68,"context_line":"                    from neutron.agent.linux import xenapi_root_helper as xrh"},{"line_number":69,"context_line":"                    cls.__client \u003d xrh.XenAPI_Client()"},{"line_number":70,"context_line":"                else:"},{"line_number":71,"context_line":"                    cls.__client \u003d client.Client("}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_d1570758","line":68,"updated":"2016-11-17 17:35:25.000000000","message":"Why as xrh?  I think it makes things less readable.\nI\u0027d suggest:\nfrom neutron.agent.linux import xenapi_root_helper\ncls.__client \u003d xenapi_root_helper.XenAPI_Client()","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"de547b13db9ca39a8d22c370759298e06a86e732","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        with cls.__lock:"},{"line_number":66,"context_line":"            if cls.__client is None:"},{"line_number":67,"context_line":"                if \"xenapi_root_helper\" in cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":68,"context_line":"                    from neutron.agent.linux import xenapi_root_helper as xrh"},{"line_number":69,"context_line":"                    cls.__client \u003d xrh.XenAPI_Client()"},{"line_number":70,"context_line":"                else:"},{"line_number":71,"context_line":"                    cls.__client \u003d client.Client("}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_4b188275","line":68,"in_reply_to":"7a77a97e_d1570758","updated":"2016-11-18 10:30:17.000000000","message":"Done","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    @classmethod"},{"line_number":64,"context_line":"    def get_client(cls):"},{"line_number":65,"context_line":"        with cls.__lock:"},{"line_number":66,"context_line":"            if cls.__client is None:"},{"line_number":67,"context_line":"                if \"xenapi_root_helper\" in cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":68,"context_line":"                    from neutron.agent.linux import xenapi_root_helper"},{"line_number":69,"context_line":"                    cls.__client \u003d xenapi_root_helper.XenAPI_Client()"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_46506d0b","line":66,"updated":"2016-12-16 10:53:54.000000000","message":"this change is not covered with new tests","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    @classmethod"},{"line_number":64,"context_line":"    def get_client(cls):"},{"line_number":65,"context_line":"        with cls.__lock:"},{"line_number":66,"context_line":"            if cls.__client is None:"},{"line_number":67,"context_line":"                if \"xenapi_root_helper\" in cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":68,"context_line":"                    from neutron.agent.linux import xenapi_root_helper"},{"line_number":69,"context_line":"                    cls.__client \u003d xenapi_root_helper.XenAPI_Client()"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_69b304ea","line":66,"in_reply_to":"1a6eadb0_46506d0b","updated":"2016-12-20 09:20:16.000000000","message":"Suer. Will add new test for this part.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    def get_client(cls):"},{"line_number":65,"context_line":"        with cls.__lock:"},{"line_number":66,"context_line":"            if cls.__client is None:"},{"line_number":67,"context_line":"                if \"xenapi_root_helper\" in cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":68,"context_line":"                    from neutron.agent.linux import xenapi_root_helper"},{"line_number":69,"context_line":"                    cls.__client \u003d xenapi_root_helper.XenAPI_Client()"},{"line_number":70,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_37663e51","line":67,"range":{"start_line":67,"start_character":19,"end_line":67,"end_character":39},"updated":"2016-12-16 10:53:54.000000000","message":"I believe this \u0027special case\u0027 value should be documented as such in root_helper_daemon option help text.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    def get_client(cls):"},{"line_number":65,"context_line":"        with cls.__lock:"},{"line_number":66,"context_line":"            if cls.__client is None:"},{"line_number":67,"context_line":"                if \"xenapi_root_helper\" in cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":68,"context_line":"                    from neutron.agent.linux import xenapi_root_helper"},{"line_number":69,"context_line":"                    cls.__client \u003d xenapi_root_helper.XenAPI_Client()"},{"line_number":70,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_57349a48","line":67,"range":{"start_line":67,"start_character":40,"end_line":67,"end_character":42},"updated":"2016-12-16 10:53:54.000000000","message":"nit: maybe use \u003d\u003d to be slightly more strict about accepted value","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    def get_client(cls):"},{"line_number":65,"context_line":"        with cls.__lock:"},{"line_number":66,"context_line":"            if cls.__client is None:"},{"line_number":67,"context_line":"                if \"xenapi_root_helper\" in cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":68,"context_line":"                    from neutron.agent.linux import xenapi_root_helper"},{"line_number":69,"context_line":"                    cls.__client \u003d xenapi_root_helper.XenAPI_Client()"},{"line_number":70,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_490f28e1","line":67,"range":{"start_line":67,"start_character":19,"end_line":67,"end_character":39},"in_reply_to":"1a6eadb0_37663e51","updated":"2016-12-20 09:20:16.000000000","message":"agree. thanks.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    def get_client(cls):"},{"line_number":65,"context_line":"        with cls.__lock:"},{"line_number":66,"context_line":"            if cls.__client is None:"},{"line_number":67,"context_line":"                if \"xenapi_root_helper\" in cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":68,"context_line":"                    from neutron.agent.linux import xenapi_root_helper"},{"line_number":69,"context_line":"                    cls.__client \u003d xenapi_root_helper.XenAPI_Client()"},{"line_number":70,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_092c5049","line":67,"range":{"start_line":67,"start_character":40,"end_line":67,"end_character":42},"in_reply_to":"1a6eadb0_57349a48","updated":"2016-12-20 09:20:16.000000000","message":"that\u0027s true. Will update it.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        with cls.__lock:"},{"line_number":66,"context_line":"            if cls.__client is None:"},{"line_number":67,"context_line":"                if \"xenapi_root_helper\" in cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":68,"context_line":"                    from neutron.agent.linux import xenapi_root_helper"},{"line_number":69,"context_line":"                    cls.__client \u003d xenapi_root_helper.XenAPI_Client()"},{"line_number":70,"context_line":"                else:"},{"line_number":71,"context_line":"                    cls.__client \u003d client.Client("}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_52082828","line":68,"range":{"start_line":68,"start_character":20,"end_line":68,"end_character":70},"updated":"2016-12-16 10:53:54.000000000","message":"what\u0027s the reason for local import and not a global one at the start of the module?","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        with cls.__lock:"},{"line_number":66,"context_line":"            if cls.__client is None:"},{"line_number":67,"context_line":"                if \"xenapi_root_helper\" in cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":68,"context_line":"                    from neutron.agent.linux import xenapi_root_helper"},{"line_number":69,"context_line":"                    cls.__client \u003d xenapi_root_helper.XenAPI_Client()"},{"line_number":70,"context_line":"                else:"},{"line_number":71,"context_line":"                    cls.__client \u003d client.Client("}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_29b90ccc","line":68,"range":{"start_line":68,"start_character":20,"end_line":68,"end_character":70},"in_reply_to":"1a6eadb0_52082828","updated":"2016-12-20 09:20:16.000000000","message":"Some xenapi specific libraries may not exists in non-xenapi env e.g. XenAPI. So restrict it to import this module for xenapi only.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    def get_client(cls):"},{"line_number":66,"context_line":"        with cls.__lock:"},{"line_number":67,"context_line":"            if cls.__client is None:"},{"line_number":68,"context_line":"                if \"xenapi_root_helper\" \u003d\u003d cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":69,"context_line":"                    cls.__client \u003d xenapi_root_helper.XenAPI_client()"},{"line_number":70,"context_line":"                else:"},{"line_number":71,"context_line":"                    cls.__client \u003d client.Client("}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_bcc49192","line":68,"range":{"start_line":68,"start_character":19,"end_line":68,"end_character":39},"updated":"2016-12-22 14:02:48.000000000","message":"I still don\u0027t see this special value documented in root_helper_daemon config option help text.","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    def get_client(cls):"},{"line_number":66,"context_line":"        with cls.__lock:"},{"line_number":67,"context_line":"            if cls.__client is None:"},{"line_number":68,"context_line":"                if \"xenapi_root_helper\" \u003d\u003d cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":69,"context_line":"                    cls.__client \u003d xenapi_root_helper.XenAPI_client()"},{"line_number":70,"context_line":"                else:"},{"line_number":71,"context_line":"                    cls.__client \u003d client.Client("}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_59f46086","line":68,"range":{"start_line":68,"start_character":19,"end_line":68,"end_character":39},"in_reply_to":"da4df55a_bcc49192","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"977554a98ac1f31fac31530268c4cf9946a9d240","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"from neutron._i18n import _, _LE"},{"line_number":42,"context_line":"from neutron.agent.common import config"},{"line_number":43,"context_line":"from neutron.agent.linux import xenapi_root_helper"},{"line_number":44,"context_line":"from neutron.common import utils"},{"line_number":45,"context_line":"from neutron import wsgi"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"ba5201f7_2a2a5e90","line":43,"range":{"start_line":43,"start_character":32,"end_line":43,"end_character":50},"updated":"2017-01-06 20:08:29.000000000","message":"... as xrh\n\nAnd then you don\u0027t need to wrap lines below as you do.","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"53964b34a3363378f470e1af19c20ac1c0ec123a","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"from neutron._i18n import _, _LE"},{"line_number":42,"context_line":"from neutron.agent.common import config"},{"line_number":43,"context_line":"from neutron.agent.linux import xenapi_root_helper"},{"line_number":44,"context_line":"from neutron.common import utils"},{"line_number":45,"context_line":"from neutron import wsgi"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"ba5201f7_e314f8e9","line":43,"range":{"start_line":43,"start_character":32,"end_line":43,"end_character":50},"in_reply_to":"ba5201f7_2a2a5e90","updated":"2017-01-07 04:54:12.000000000","message":"Bob suggested to make it more readable in the previous patch without \"as xrh\":\nhttps://review.openstack.org/#/c/390931/10/neutron/agent/linux/utils.py","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"977554a98ac1f31fac31530268c4cf9946a9d240","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    def get_client(cls):"},{"line_number":67,"context_line":"        with cls.__lock:"},{"line_number":68,"context_line":"            if cls.__client is None:"},{"line_number":69,"context_line":"                if xenapi_root_helper.ROOT_HELPER_DAEMON_TOKEN \u003d\u003d \\"},{"line_number":70,"context_line":"                    cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":71,"context_line":"                    cls.__client \u003d xenapi_root_helper.XenAPIClient()"},{"line_number":72,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":17,"id":"ba5201f7_8a118a5f","line":69,"range":{"start_line":69,"start_character":19,"end_line":69,"end_character":37},"updated":"2017-01-06 20:08:29.000000000","message":"-\u003e xrh and it will remove the need for wrapping","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"53964b34a3363378f470e1af19c20ac1c0ec123a","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    def get_client(cls):"},{"line_number":67,"context_line":"        with cls.__lock:"},{"line_number":68,"context_line":"            if cls.__client is None:"},{"line_number":69,"context_line":"                if xenapi_root_helper.ROOT_HELPER_DAEMON_TOKEN \u003d\u003d \\"},{"line_number":70,"context_line":"                    cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":71,"context_line":"                    cls.__client \u003d xenapi_root_helper.XenAPIClient()"},{"line_number":72,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":17,"id":"ba5201f7_23a7e0bd","line":69,"range":{"start_line":69,"start_character":19,"end_line":69,"end_character":37},"in_reply_to":"ba5201f7_8a118a5f","updated":"2017-01-07 04:54:12.000000000","message":"see the response on the previous comment. And unfortunately it\u0027s still longer than 79 characters even with xrh:(.","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"}],"neutron/agent/linux/xen_rootwrap_client.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/python"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright (c) 2016 OpenStack Foundation"},{"line_number":4,"context_line":"# All Rights Reserved."}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_00664a29","line":1,"updated":"2016-11-03 14:29:03.000000000","message":"This is not an executable. Please remove the shebang.","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/python"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright (c) 2016 OpenStack Foundation"},{"line_number":4,"context_line":"# All Rights Reserved."},{"line_number":5,"context_line":"#"},{"line_number":6,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_80b33a97","line":3,"updated":"2016-11-03 14:29:03.000000000","message":"Are you working for openstack foundation?","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"\"\"\"XenServer dom0 rootwrap client."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"This is the client to call dom0 XenAPI plugin to executes needed commands"},{"line_number":21,"context_line":"in dom0.  The XenAPI plugin is responsible determining whether a command is"},{"line_number":22,"context_line":"safe to execute."},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_40b5a27b","line":20,"range":{"start_line":20,"start_character":46,"end_line":20,"end_character":57},"updated":"2016-11-03 14:29:03.000000000","message":"to execute","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"\"\"\""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"from oslo_log import log as logging"},{"line_number":27,"context_line":"from oslo_serialization import jsonutils"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"import traceback"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_c02e12a4","line":26,"updated":"2016-11-03 14:29:03.000000000","message":"those imports should go into the same section as oslo_config in line 33, and XenAPI should be in the same section.","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from oslo_log import log as logging"},{"line_number":27,"context_line":"from oslo_serialization import jsonutils"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"import traceback"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"import XenAPI"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_c057f223","line":29,"updated":"2016-11-03 14:29:03.000000000","message":"this is stdlib, should go first.","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from oslo_config import cfg"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"# Add these options to agent\u0027s configure file seems a better option by getting"},{"line_number":39,"context_line":"# rootwrap conf file specified by root_wrap_helper and parse it at runtime?"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_001baa81","line":36,"updated":"2016-11-03 14:29:03.000000000","message":"where is it used?","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"# Add these options to agent\u0027s configure file seems a better option by getting"},{"line_number":39,"context_line":"# rootwrap conf file specified by root_wrap_helper and parse it at runtime?"},{"line_number":40,"context_line":"xenapi_opts \u003d ["},{"line_number":41,"context_line":"    cfg.StrOpt(\u0027connection_url\u0027,"},{"line_number":42,"context_line":"               help\u003d\u0027URL for connection to XenServer/Xen Cloud Platform. \u0027"},{"line_number":43,"context_line":"                    \u0027A special value of unix://local can be used to connect \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_3b08df27","line":40,"updated":"2016-11-03 14:29:03.000000000","message":"You should probably include those options into neutron/opts.py and relevant agent files in etc/oslo-config-generator.\n\nAlso note options are currently under consolidation under neutron/conf, so you should move them there.","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":39,"context_line":"# rootwrap conf file specified by root_wrap_helper and parse it at runtime?"},{"line_number":40,"context_line":"xenapi_opts \u003d ["},{"line_number":41,"context_line":"    cfg.StrOpt(\u0027connection_url\u0027,"},{"line_number":42,"context_line":"               help\u003d\u0027URL for connection to XenServer/Xen Cloud Platform. \u0027"},{"line_number":43,"context_line":"                    \u0027A special value of unix://local can be used to connect \u0027"},{"line_number":44,"context_line":"                    \u0027to the local unix socket.  \u0027"},{"line_number":45,"context_line":"                    \u0027Required if compute_driver\u003dxenapi.XenAPIDriver\u0027),"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_5b7033a4","line":42,"updated":"2016-11-03 14:29:03.000000000","message":"all help messages should be translatable","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    cfg.StrOpt(\u0027connection_url\u0027,"},{"line_number":42,"context_line":"               help\u003d\u0027URL for connection to XenServer/Xen Cloud Platform. \u0027"},{"line_number":43,"context_line":"                    \u0027A special value of unix://local can be used to connect \u0027"},{"line_number":44,"context_line":"                    \u0027to the local unix socket.  \u0027"},{"line_number":45,"context_line":"                    \u0027Required if compute_driver\u003dxenapi.XenAPIDriver\u0027),"},{"line_number":46,"context_line":"    cfg.StrOpt(\u0027connection_username\u0027,"},{"line_number":47,"context_line":"               default\u003d\u0027root\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_7b441749","line":44,"range":{"start_line":44,"start_character":34,"end_line":44,"end_character":38},"updated":"2016-11-03 14:29:03.000000000","message":"UNIX?","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    cfg.StrOpt(\u0027connection_url\u0027,"},{"line_number":42,"context_line":"               help\u003d\u0027URL for connection to XenServer/Xen Cloud Platform. \u0027"},{"line_number":43,"context_line":"                    \u0027A special value of unix://local can be used to connect \u0027"},{"line_number":44,"context_line":"                    \u0027to the local unix socket.  \u0027"},{"line_number":45,"context_line":"                    \u0027Required if compute_driver\u003dxenapi.XenAPIDriver\u0027),"},{"line_number":46,"context_line":"    cfg.StrOpt(\u0027connection_username\u0027,"},{"line_number":47,"context_line":"               default\u003d\u0027root\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_1b531b18","line":44,"range":{"start_line":44,"start_character":45,"end_line":44,"end_character":48},"updated":"2016-11-03 14:29:03.000000000","message":"Why two spaces?","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":42,"context_line":"               help\u003d\u0027URL for connection to XenServer/Xen Cloud Platform. \u0027"},{"line_number":43,"context_line":"                    \u0027A special value of unix://local can be used to connect \u0027"},{"line_number":44,"context_line":"                    \u0027to the local unix socket.  \u0027"},{"line_number":45,"context_line":"                    \u0027Required if compute_driver\u003dxenapi.XenAPIDriver\u0027),"},{"line_number":46,"context_line":"    cfg.StrOpt(\u0027connection_username\u0027,"},{"line_number":47,"context_line":"               default\u003d\u0027root\u0027,"},{"line_number":48,"context_line":"               help\u003d\u0027Username for connection to XenServer/Xen Cloud Platform. \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_bbb86f2b","line":45,"range":{"start_line":45,"start_character":33,"end_line":45,"end_character":67},"updated":"2016-11-03 14:29:03.000000000","message":"Where is that option? I don\u0027t see it in neutron. Do you refer to Nova? Remember that Neutron+Nova is not the only way to use Neutron. Consider rewording not to refer to nova option names.","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    cfg.StrOpt(\u0027connection_username\u0027,"},{"line_number":47,"context_line":"               default\u003d\u0027root\u0027,"},{"line_number":48,"context_line":"               help\u003d\u0027Username for connection to XenServer/Xen Cloud Platform. \u0027"},{"line_number":49,"context_line":"                    \u0027Used only if compute_driver\u003dxenapi.XenAPkkIDriver\u0027),"},{"line_number":50,"context_line":"    cfg.StrOpt(\u0027connection_password\u0027,"},{"line_number":51,"context_line":"               help\u003d\u0027Password for connection to XenServer/Xen Cloud Platform. \u0027"},{"line_number":52,"context_line":"                    \u0027Used only if compute_driver\u003dxenapi.XenAPIDriver\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_7b9977c3","line":49,"range":{"start_line":49,"start_character":59,"end_line":49,"end_character":64},"updated":"2016-11-03 14:29:03.000000000","message":"APkkI?","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":53,"context_line":"               secret\u003dTrue)"},{"line_number":54,"context_line":"               ]"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"cfg.CONF.register_opts(xenapi_opts, \"xenapi\")"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"class Client(object):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_3bf29f06","line":56,"updated":"2016-11-03 14:29:03.000000000","message":"Please avoid registering options in global scope. Instead, provide a register_*_opts function and call it where needed.","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e484204216b2e2ddce3ca7993e9c8af632061655","unresolved":false,"context_lines":[{"line_number":56,"context_line":"cfg.CONF.register_opts(xenapi_opts, \"xenapi\")"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"class Client(object):"},{"line_number":60,"context_line":"    def __init__(self):"},{"line_number":61,"context_line":"        self._session \u003d None"},{"line_number":62,"context_line":"        self._host \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_dbc28352","line":59,"updated":"2016-11-03 14:29:03.000000000","message":"I don\u0027t see any unit tests for the code.","commit_id":"8ca86a99693acb4434941b84663cea8e37f10bed"}],"neutron/agent/linux/xenapi_root_helper.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"6f696e91e2a69405607e2dbc9ab736778dc34c2c","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        import XenAPI"},{"line_number":47,"context_line":"        self.XenAPI \u003d XenAPI"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def xenapi_session_init(self, url, username, password):"},{"line_number":50,"context_line":"        session \u003d self.XenAPI.Session(url)"},{"line_number":51,"context_line":"        session.login_with_password(username, password)"},{"line_number":52,"context_line":"        self._host \u003d self.xenapi_get_this_host(session)"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_d43e158a","line":49,"updated":"2016-11-17 17:35:25.000000000","message":"I\u0027d suggest as this is an internal function, it should be \"_create_session\" which returns a session, set on self._session within the get_session() method at the bottom.\n\nHaving \u0027xenapi\u0027 in the name doesn\u0027t make sense - we *know* it\u0027s a xenapi client because the class is XenAPI_Client :)","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"de547b13db9ca39a8d22c370759298e06a86e732","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        import XenAPI"},{"line_number":47,"context_line":"        self.XenAPI \u003d XenAPI"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def xenapi_session_init(self, url, username, password):"},{"line_number":50,"context_line":"        session \u003d self.XenAPI.Session(url)"},{"line_number":51,"context_line":"        session.login_with_password(username, password)"},{"line_number":52,"context_line":"        self._host \u003d self.xenapi_get_this_host(session)"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_ab1f5659","line":49,"in_reply_to":"7a77a97e_d43e158a","updated":"2016-11-18 10:30:17.000000000","message":"Done","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"6f696e91e2a69405607e2dbc9ab736778dc34c2c","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        self._host \u003d self.xenapi_get_this_host(session)"},{"line_number":53,"context_line":"        self._session \u003d session"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def xenapi_call_plugin(self, plugin, fn, args):"},{"line_number":56,"context_line":"        return self.get_session().xenapi.host.call_plugin("},{"line_number":57,"context_line":"            self._host, plugin, fn, args)"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_14740d66","line":55,"updated":"2016-11-17 17:35:25.000000000","message":"call_plugin","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"de547b13db9ca39a8d22c370759298e06a86e732","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        self._host \u003d self.xenapi_get_this_host(session)"},{"line_number":53,"context_line":"        self._session \u003d session"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def xenapi_call_plugin(self, plugin, fn, args):"},{"line_number":56,"context_line":"        return self.get_session().xenapi.host.call_plugin("},{"line_number":57,"context_line":"            self._host, plugin, fn, args)"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_eb3dcec4","line":55,"in_reply_to":"7a77a97e_14740d66","updated":"2016-11-18 10:30:17.000000000","message":"Done","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"6f696e91e2a69405607e2dbc9ab736778dc34c2c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        return self.get_session().xenapi.host.call_plugin("},{"line_number":57,"context_line":"            self._host, plugin, fn, args)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def xenapi_get_this_host(self, session):"},{"line_number":60,"context_line":"        return session.xenapi.session.get_this_host(session.handle)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def execute(self, cmd, cmd_input\u003dNone):"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_540125ae","line":59,"updated":"2016-11-17 17:35:25.000000000","message":"perhaps:\ndef _this_host(self):\nif not self._host\n    session \u003d self.get_session()\n    self._host \u003d session.xenapi.session.get_this_host(session.handle)\nreturn self._host","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"de547b13db9ca39a8d22c370759298e06a86e732","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        return self.get_session().xenapi.host.call_plugin("},{"line_number":57,"context_line":"            self._host, plugin, fn, args)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def xenapi_get_this_host(self, session):"},{"line_number":60,"context_line":"        return session.xenapi.session.get_this_host(session.handle)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def execute(self, cmd, cmd_input\u003dNone):"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_0b392ad7","line":59,"in_reply_to":"7a77a97e_540125ae","updated":"2016-11-18 10:30:17.000000000","message":"Done","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"6f696e91e2a69405607e2dbc9ab736778dc34c2c","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            traceback.print_exc()"},{"line_number":78,"context_line":"            out \u003d \"\""},{"line_number":79,"context_line":"            err \u003d \"Exception raised when execute command.\""},{"line_number":80,"context_line":"            return RC_XENAPI_PLUGIN_FAILURE, out, err"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def get_session(self):"},{"line_number":83,"context_line":"        if self._session is None:"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_d4a295fb","line":80,"updated":"2016-11-17 17:35:25.000000000","message":"Where is this magic value used?","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"xenapi root helper"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"For xenapi, need run some commands in dom0 with privilege. This xenapi"},{"line_number":19,"context_line":"root helper contains the class of XenAPI_Client to support it:"},{"line_number":20,"context_line":"XenAPI_Client will keep a XenAPI session to dom0 and allow to run commands"},{"line_number":21,"context_line":"in dom0 via calling XenAPI plugin. The XenAPI plugin is responsible to"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_b2709c73","line":18,"range":{"start_line":18,"start_character":0,"end_line":18,"end_character":57},"updated":"2016-12-16 10:53:54.000000000","message":"Consider: For xenapi, we may need to run some commands in dom0 with additional privileges.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"xenapi root helper"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"For xenapi, need run some commands in dom0 with privilege. This xenapi"},{"line_number":19,"context_line":"root helper contains the class of XenAPI_Client to support it:"},{"line_number":20,"context_line":"XenAPI_Client will keep a XenAPI session to dom0 and allow to run commands"},{"line_number":21,"context_line":"in dom0 via calling XenAPI plugin. The XenAPI plugin is responsible to"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_c9db381a","line":18,"range":{"start_line":18,"start_character":0,"end_line":18,"end_character":57},"in_reply_to":"1a6eadb0_b2709c73","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":20,"context_line":"XenAPI_Client will keep a XenAPI session to dom0 and allow to run commands"},{"line_number":21,"context_line":"in dom0 via calling XenAPI plugin. The XenAPI plugin is responsible to"},{"line_number":22,"context_line":"determine whether a command is safe to execute."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"\"\"\""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import traceback"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_320bacd7","line":23,"updated":"2016-12-16 10:53:54.000000000","message":"nit: redundant line","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":20,"context_line":"XenAPI_Client will keep a XenAPI session to dom0 and allow to run commands"},{"line_number":21,"context_line":"in dom0 via calling XenAPI plugin. The XenAPI plugin is responsible to"},{"line_number":22,"context_line":"determine whether a command is safe to execute."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"\"\"\""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import traceback"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_092b70ec","line":23,"in_reply_to":"1a6eadb0_320bacd7","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from neutron.conf.agent import xenapi_conf"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"RC_XENAPI_PLUGIN_FAILURE \u003d 96"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":39,"context_line":"xenapi_conf.register_xenapi_opts(cfg.CONF)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_b266dcea","line":36,"range":{"start_line":36,"start_character":27,"end_line":36,"end_character":29},"updated":"2016-12-16 10:53:54.000000000","message":"how do we choose the value? This value is the same as RC_NOEXECFOUND from oslo.rootwrap, so you basically hiding a legit error type from consumers of the client.\n\nWhich exceptions can call_plugin() raise? We may need to attempt to map them to codes defined in oslo.rootwrap, specifically:\n\nRC_UNAUTHORIZED \u003d 99\nRC_NOCOMMAND \u003d 98\nRC_BADCONFIG \u003d 97\nRC_NOEXECFOUND \u003d 96","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from neutron.conf.agent import xenapi_conf"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"RC_XENAPI_PLUGIN_FAILURE \u003d 96"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":39,"context_line":"xenapi_conf.register_xenapi_opts(cfg.CONF)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_a968bc22","line":36,"range":{"start_line":36,"start_character":27,"end_line":36,"end_character":29},"in_reply_to":"1a6eadb0_b266dcea","updated":"2016-12-20 09:20:16.000000000","message":"Good point. Will map exceptions to the oslo.rootwrap codes.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":39,"context_line":"xenapi_conf.register_xenapi_opts(cfg.CONF)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class XenAPI_Client(object):"},{"line_number":43,"context_line":"    def __init__(self):"},{"line_number":44,"context_line":"        self._session \u003d None"},{"line_number":45,"context_line":"        self._host \u003d None"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_722284a4","line":42,"range":{"start_line":42,"start_character":12,"end_line":42,"end_character":13},"updated":"2016-12-16 10:53:54.000000000","message":"nit: it\u0027s not very common to use underscore in camel-cased names.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":39,"context_line":"xenapi_conf.register_xenapi_opts(cfg.CONF)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class XenAPI_Client(object):"},{"line_number":43,"context_line":"    def __init__(self):"},{"line_number":44,"context_line":"        self._session \u003d None"},{"line_number":45,"context_line":"        self._host \u003d None"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_695dc478","line":42,"range":{"start_line":42,"start_character":12,"end_line":42,"end_character":13},"in_reply_to":"1a6eadb0_722284a4","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def __init__(self):"},{"line_number":44,"context_line":"        self._session \u003d None"},{"line_number":45,"context_line":"        self._host \u003d None"},{"line_number":46,"context_line":"        import XenAPI"},{"line_number":47,"context_line":"        self.XenAPI \u003d XenAPI"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def _call_plugin(self, plugin, fn, args):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_d2da7816","line":46,"updated":"2016-12-16 10:53:54.000000000","message":"why do we import it here and not at the top?","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def __init__(self):"},{"line_number":44,"context_line":"        self._session \u003d None"},{"line_number":45,"context_line":"        self._host \u003d None"},{"line_number":46,"context_line":"        import XenAPI"},{"line_number":47,"context_line":"        self.XenAPI \u003d XenAPI"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def _call_plugin(self, plugin, fn, args):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_e9539437","line":46,"in_reply_to":"1a6eadb0_d2da7816","updated":"2016-12-20 09:20:16.000000000","message":"XenAPI may not exist on some non-xenapi env. e.g. the jenkins UT test machine. If we put it at the top, it will fail the test at the begin.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self._session \u003d None"},{"line_number":45,"context_line":"        self._host \u003d None"},{"line_number":46,"context_line":"        import XenAPI"},{"line_number":47,"context_line":"        self.XenAPI \u003d XenAPI"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def _call_plugin(self, plugin, fn, args):"},{"line_number":50,"context_line":"        host \u003d self._this_host()"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_7200c466","line":47,"range":{"start_line":47,"start_character":8,"end_line":47,"end_character":20},"updated":"2016-12-16 10:53:54.000000000","message":"assuming you indeed don\u0027t have a reason to import the module locally, then this line and this attribute are not needed too.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            self._host \u003d session.xenapi.session.get_this_host(session.handle)"},{"line_number":63,"context_line":"        return self._host"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def execute(self, cmd, cmd_input\u003dNone):"},{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            result_raw \u003d self._call_plugin("},{"line_number":68,"context_line":"                \u0027netwrap\u0027, \u0027run_command\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_92a640ac","line":65,"range":{"start_line":65,"start_character":27,"end_line":65,"end_character":36},"updated":"2016-12-16 10:53:54.000000000","message":"it\u0027s called stdin\u003d in oslo.rootwrap client","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            self._host \u003d session.xenapi.session.get_this_host(session.handle)"},{"line_number":63,"context_line":"        return self._host"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def execute(self, cmd, cmd_input\u003dNone):"},{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            result_raw \u003d self._call_plugin("},{"line_number":68,"context_line":"                \u0027netwrap\u0027, \u0027run_command\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_edaabf84","line":65,"range":{"start_line":65,"start_character":27,"end_line":65,"end_character":36},"in_reply_to":"1a6eadb0_92a640ac","updated":"2016-12-20 09:20:16.000000000","message":"hmm, it may be better to make it to be consist. I will change it.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            self._host \u003d session.xenapi.session.get_this_host(session.handle)"},{"line_number":63,"context_line":"        return self._host"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def execute(self, cmd, cmd_input\u003dNone):"},{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            result_raw \u003d self._call_plugin("},{"line_number":68,"context_line":"                \u0027netwrap\u0027, \u0027run_command\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_2df917c9","line":65,"range":{"start_line":65,"start_character":27,"end_line":65,"end_character":36},"in_reply_to":"1a6eadb0_92a640ac","updated":"2016-12-20 09:20:16.000000000","message":"yes, maybe it\u0027s better to make this function de","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            err \u003d result[\u0027err\u0027]"},{"line_number":75,"context_line":"            return returncode, out, err"},{"line_number":76,"context_line":"        except Exception as e:"},{"line_number":77,"context_line":"            LOG.error(_LE(\"Exception raised when execute command \""},{"line_number":78,"context_line":"                          \"[%(cmd)s]:[%(except)s]\"),"},{"line_number":79,"context_line":"                      {\u0027cmd\u0027: cmd, \u0027except\u0027: e})"},{"line_number":80,"context_line":"            traceback.print_exc()"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_127790a0","line":77,"range":{"start_line":77,"start_character":49,"end_line":77,"end_character":56},"updated":"2016-12-16 10:53:54.000000000","message":"executing","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            err \u003d result[\u0027err\u0027]"},{"line_number":75,"context_line":"            return returncode, out, err"},{"line_number":76,"context_line":"        except Exception as e:"},{"line_number":77,"context_line":"            LOG.error(_LE(\"Exception raised when execute command \""},{"line_number":78,"context_line":"                          \"[%(cmd)s]:[%(except)s]\"),"},{"line_number":79,"context_line":"                      {\u0027cmd\u0027: cmd, \u0027except\u0027: e})"},{"line_number":80,"context_line":"            traceback.print_exc()"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_0dae1b98","line":77,"range":{"start_line":77,"start_character":49,"end_line":77,"end_character":56},"in_reply_to":"1a6eadb0_127790a0","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            err \u003d result[\u0027err\u0027]"},{"line_number":75,"context_line":"            return returncode, out, err"},{"line_number":76,"context_line":"        except Exception as e:"},{"line_number":77,"context_line":"            LOG.error(_LE(\"Exception raised when execute command \""},{"line_number":78,"context_line":"                          \"[%(cmd)s]:[%(except)s]\"),"},{"line_number":79,"context_line":"                      {\u0027cmd\u0027: cmd, \u0027except\u0027: e})"},{"line_number":80,"context_line":"            traceback.print_exc()"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_cd76e3a2","line":77,"range":{"start_line":77,"start_character":49,"end_line":77,"end_character":56},"in_reply_to":"1a6eadb0_127790a0","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        except Exception as e:"},{"line_number":77,"context_line":"            LOG.error(_LE(\"Exception raised when execute command \""},{"line_number":78,"context_line":"                          \"[%(cmd)s]:[%(except)s]\"),"},{"line_number":79,"context_line":"                      {\u0027cmd\u0027: cmd, \u0027except\u0027: e})"},{"line_number":80,"context_line":"            traceback.print_exc()"},{"line_number":81,"context_line":"            out \u003d \"\""},{"line_number":82,"context_line":"            err \u003d \"Exception raised when execute command.\""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_f245b442","line":79,"range":{"start_line":79,"start_character":35,"end_line":79,"end_character":47},"updated":"2016-12-16 10:53:54.000000000","message":"if you would use LOG.exception instead, your exception would be automatically logged.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        except Exception as e:"},{"line_number":77,"context_line":"            LOG.error(_LE(\"Exception raised when execute command \""},{"line_number":78,"context_line":"                          \"[%(cmd)s]:[%(except)s]\"),"},{"line_number":79,"context_line":"                      {\u0027cmd\u0027: cmd, \u0027except\u0027: e})"},{"line_number":80,"context_line":"            traceback.print_exc()"},{"line_number":81,"context_line":"            out \u003d \"\""},{"line_number":82,"context_line":"            err \u003d \"Exception raised when execute command.\""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_2d7cb71f","line":79,"range":{"start_line":79,"start_character":35,"end_line":79,"end_character":47},"in_reply_to":"1a6eadb0_f245b442","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            LOG.error(_LE(\"Exception raised when execute command \""},{"line_number":78,"context_line":"                          \"[%(cmd)s]:[%(except)s]\"),"},{"line_number":79,"context_line":"                      {\u0027cmd\u0027: cmd, \u0027except\u0027: e})"},{"line_number":80,"context_line":"            traceback.print_exc()"},{"line_number":81,"context_line":"            out \u003d \"\""},{"line_number":82,"context_line":"            err \u003d \"Exception raised when execute command.\""},{"line_number":83,"context_line":"            # Return an error code which is different from the regular"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_9244804a","line":80,"updated":"2016-12-16 10:53:54.000000000","message":"Can\u0027t we instead use LOG.exception for that matter in line 77?","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            LOG.error(_LE(\"Exception raised when execute command \""},{"line_number":78,"context_line":"                          \"[%(cmd)s]:[%(except)s]\"),"},{"line_number":79,"context_line":"                      {\u0027cmd\u0027: cmd, \u0027except\u0027: e})"},{"line_number":80,"context_line":"            traceback.print_exc()"},{"line_number":81,"context_line":"            out \u003d \"\""},{"line_number":82,"context_line":"            err \u003d \"Exception raised when execute command.\""},{"line_number":83,"context_line":"            # Return an error code which is different from the regular"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_6d76af3f","line":80,"in_reply_to":"1a6eadb0_9244804a","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                      {\u0027cmd\u0027: cmd, \u0027except\u0027: e})"},{"line_number":80,"context_line":"            traceback.print_exc()"},{"line_number":81,"context_line":"            out \u003d \"\""},{"line_number":82,"context_line":"            err \u003d \"Exception raised when execute command.\""},{"line_number":83,"context_line":"            # Return an error code which is different from the regular"},{"line_number":84,"context_line":"            # errors. If the command originator choose check_exit_code,"},{"line_number":85,"context_line":"            # it will result into a RuntimeError."}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_728524cd","line":82,"range":{"start_line":82,"start_character":12,"end_line":82,"end_character":58},"updated":"2016-12-16 10:53:54.000000000","message":"It seems like rootwrap client always returns \"\" for both out and err on an exception. I think we should do the same.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                      {\u0027cmd\u0027: cmd, \u0027except\u0027: e})"},{"line_number":80,"context_line":"            traceback.print_exc()"},{"line_number":81,"context_line":"            out \u003d \"\""},{"line_number":82,"context_line":"            err \u003d \"Exception raised when execute command.\""},{"line_number":83,"context_line":"            # Return an error code which is different from the regular"},{"line_number":84,"context_line":"            # errors. If the command originator choose check_exit_code,"},{"line_number":85,"context_line":"            # it will result into a RuntimeError."}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_f2ecd4bc","line":82,"range":{"start_line":82,"start_character":41,"end_line":82,"end_character":48},"updated":"2016-12-16 10:53:54.000000000","message":"executing","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                      {\u0027cmd\u0027: cmd, \u0027except\u0027: e})"},{"line_number":80,"context_line":"            traceback.print_exc()"},{"line_number":81,"context_line":"            out \u003d \"\""},{"line_number":82,"context_line":"            err \u003d \"Exception raised when execute command.\""},{"line_number":83,"context_line":"            # Return an error code which is different from the regular"},{"line_number":84,"context_line":"            # errors. If the command originator choose check_exit_code,"},{"line_number":85,"context_line":"            # it will result into a RuntimeError."}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_8da86b79","line":82,"range":{"start_line":82,"start_character":12,"end_line":82,"end_character":58},"in_reply_to":"1a6eadb0_728524cd","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            try:"},{"line_number":94,"context_line":"                self._session \u003d self._create_session(url, username, password)"},{"line_number":95,"context_line":"            except Exception as e:"},{"line_number":96,"context_line":"                LOG.error(_LE(\"Fail to initiate XenAPI session: %s\"), e)"},{"line_number":97,"context_line":"                raise SystemExit(1)"},{"line_number":98,"context_line":"        return self._session"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_3232cca7","line":96,"range":{"start_line":96,"start_character":31,"end_line":96,"end_character":35},"updated":"2016-12-16 10:53:54.000000000","message":"Failed","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            try:"},{"line_number":94,"context_line":"                self._session \u003d self._create_session(url, username, password)"},{"line_number":95,"context_line":"            except Exception as e:"},{"line_number":96,"context_line":"                LOG.error(_LE(\"Fail to initiate XenAPI session: %s\"), e)"},{"line_number":97,"context_line":"                raise SystemExit(1)"},{"line_number":98,"context_line":"        return self._session"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_adb527d1","line":96,"range":{"start_line":96,"start_character":31,"end_line":96,"end_character":35},"in_reply_to":"1a6eadb0_3232cca7","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":94,"context_line":"                self._session \u003d self._create_session(url, username, password)"},{"line_number":95,"context_line":"            except Exception as e:"},{"line_number":96,"context_line":"                LOG.error(_LE(\"Fail to initiate XenAPI session: %s\"), e)"},{"line_number":97,"context_line":"                raise SystemExit(1)"},{"line_number":98,"context_line":"        return self._session"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_32a72cbe","line":97,"range":{"start_line":97,"start_character":16,"end_line":97,"end_character":35},"updated":"2016-12-16 10:53:54.000000000","message":"so you exit from the agent process completely? I am not sure it\u0027s something we should do. Instead, just bubble the exception up and allow the caller to decide if it\u0027s worth exiting, or proceeding.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":94,"context_line":"                self._session \u003d self._create_session(url, username, password)"},{"line_number":95,"context_line":"            except Exception as e:"},{"line_number":96,"context_line":"                LOG.error(_LE(\"Fail to initiate XenAPI session: %s\"), e)"},{"line_number":97,"context_line":"                raise SystemExit(1)"},{"line_number":98,"context_line":"        return self._session"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_8d44ebb7","line":97,"range":{"start_line":97,"start_character":16,"end_line":97,"end_character":35},"in_reply_to":"1a6eadb0_32a72cbe","updated":"2016-12-20 09:20:16.000000000","message":"I think this session is used for all commands need to be executed in dom0. So if it failed to get session, it should exit.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# return code values defined in oslo_rootwrap"},{"line_number":34,"context_line":"RC_UNAUTHORIZED \u003d 99"},{"line_number":35,"context_line":"RC_NOEXECFOUND \u003d 96"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_dce4f50e","line":34,"updated":"2016-12-22 14:02:48.000000000","message":"I think it\u0027s better to reuse constants as defined in oslo_rootwrap.cmd.* and not copy their values here.","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# return code values defined in oslo_rootwrap"},{"line_number":34,"context_line":"RC_UNAUTHORIZED \u003d 99"},{"line_number":35,"context_line":"RC_NOEXECFOUND \u003d 96"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_8cb689da","line":34,"in_reply_to":"da4df55a_dce4f50e","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":38,"context_line":"xenapi_conf.register_xenapi_opts(cfg.CONF)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"class XenAPI_client(object):"},{"line_number":42,"context_line":"    def __init__(self):"},{"line_number":43,"context_line":"        self._session \u003d None"},{"line_number":44,"context_line":"        self._host \u003d None"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_5ca645c2","line":41,"range":{"start_line":41,"start_character":6,"end_line":41,"end_character":19},"updated":"2016-12-22 14:02:48.000000000","message":"nit: I was actually suggesting something like \u0027XenAPIClient\u0027 that would be more in line with other class names in neutron tree. We don\u0027t usually use underscores for class names, only for variables.","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":38,"context_line":"xenapi_conf.register_xenapi_opts(cfg.CONF)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"class XenAPI_client(object):"},{"line_number":42,"context_line":"    def __init__(self):"},{"line_number":43,"context_line":"        self._session \u003d None"},{"line_number":44,"context_line":"        self._host \u003d None"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_ccb091e0","line":41,"range":{"start_line":41,"start_character":6,"end_line":41,"end_character":19},"in_reply_to":"da4df55a_5ca645c2","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        session.login_with_password(username, password)"},{"line_number":55,"context_line":"        return session"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _get_return_code(self, failure_details):"},{"line_number":58,"context_line":"        if (len(failure_details) \u003d\u003d 4 and"},{"line_number":59,"context_line":"            \u0027XENAPI_PLUGIN_FAILURE\u0027 \u003d\u003d failure_details[0]):"},{"line_number":60,"context_line":"            if (\u0027is not permitted\u0027 in failure_details[3]):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_7c3b09ec","line":57,"updated":"2016-12-22 14:02:48.000000000","message":"This function seems to miss a default catch action, meaning that if neither of the branches is triggered, it returns None. Is it expected?","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        session.login_with_password(username, password)"},{"line_number":55,"context_line":"        return session"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _get_return_code(self, failure_details):"},{"line_number":58,"context_line":"        if (len(failure_details) \u003d\u003d 4 and"},{"line_number":59,"context_line":"            \u0027XENAPI_PLUGIN_FAILURE\u0027 \u003d\u003d failure_details[0]):"},{"line_number":60,"context_line":"            if (\u0027is not permitted\u0027 in failure_details[3]):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_b78ba21d","line":57,"in_reply_to":"da4df55a_7c3b09ec","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        return session"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _get_return_code(self, failure_details):"},{"line_number":58,"context_line":"        if (len(failure_details) \u003d\u003d 4 and"},{"line_number":59,"context_line":"            \u0027XENAPI_PLUGIN_FAILURE\u0027 \u003d\u003d failure_details[0]):"},{"line_number":60,"context_line":"            if (\u0027is not permitted\u0027 in failure_details[3]):"},{"line_number":61,"context_line":"                return RC_UNAUTHORIZED"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_dc86b5b8","line":58,"range":{"start_line":58,"start_character":36,"end_line":58,"end_character":37},"updated":"2016-12-22 14:02:48.000000000","message":"What does this 4 value mean, and why is it special? Could you please describe the format of the details array here in comments, or link to some docs that would clarify it for readers of the code?","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        return session"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _get_return_code(self, failure_details):"},{"line_number":58,"context_line":"        if (len(failure_details) \u003d\u003d 4 and"},{"line_number":59,"context_line":"            \u0027XENAPI_PLUGIN_FAILURE\u0027 \u003d\u003d failure_details[0]):"},{"line_number":60,"context_line":"            if (\u0027is not permitted\u0027 in failure_details[3]):"},{"line_number":61,"context_line":"                return RC_UNAUTHORIZED"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_97885e24","line":58,"range":{"start_line":58,"start_character":36,"end_line":58,"end_character":37},"in_reply_to":"da4df55a_dc86b5b8","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _get_return_code(self, failure_details):"},{"line_number":58,"context_line":"        if (len(failure_details) \u003d\u003d 4 and"},{"line_number":59,"context_line":"            \u0027XENAPI_PLUGIN_FAILURE\u0027 \u003d\u003d failure_details[0]):"},{"line_number":60,"context_line":"            if (\u0027is not permitted\u0027 in failure_details[3]):"},{"line_number":61,"context_line":"                return RC_UNAUTHORIZED"},{"line_number":62,"context_line":"            elif (\u0027No such file or directory\u0027 in failure_details[3]):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_3cbc216c","line":59,"range":{"start_line":59,"start_character":12,"end_line":59,"end_character":35},"updated":"2016-12-22 14:02:48.000000000","message":"any change XenAPI ships a constant value we could reuse here instead of the string literal?","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _get_return_code(self, failure_details):"},{"line_number":58,"context_line":"        if (len(failure_details) \u003d\u003d 4 and"},{"line_number":59,"context_line":"            \u0027XENAPI_PLUGIN_FAILURE\u0027 \u003d\u003d failure_details[0]):"},{"line_number":60,"context_line":"            if (\u0027is not permitted\u0027 in failure_details[3]):"},{"line_number":61,"context_line":"                return RC_UNAUTHORIZED"},{"line_number":62,"context_line":"            elif (\u0027No such file or directory\u0027 in failure_details[3]):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_57a0b69f","line":59,"range":{"start_line":59,"start_character":12,"end_line":59,"end_character":35},"in_reply_to":"da4df55a_3cbc216c","updated":"2016-12-23 15:29:12.000000000","message":"unfortunately there is no such constant value. It\u0027s hardcoded in the code. see here:\nhttps://github.com/xapi-project/xen-api/blob/master/scripts/examples/python/XenAPIPlugin.py#L42","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    def _get_return_code(self, failure_details):"},{"line_number":58,"context_line":"        if (len(failure_details) \u003d\u003d 4 and"},{"line_number":59,"context_line":"            \u0027XENAPI_PLUGIN_FAILURE\u0027 \u003d\u003d failure_details[0]):"},{"line_number":60,"context_line":"            if (\u0027is not permitted\u0027 in failure_details[3]):"},{"line_number":61,"context_line":"                return RC_UNAUTHORIZED"},{"line_number":62,"context_line":"            elif (\u0027No such file or directory\u0027 in failure_details[3]):"},{"line_number":63,"context_line":"                return RC_NOEXECFOUND"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_bcdbb1ec","line":60,"range":{"start_line":60,"start_character":16,"end_line":60,"end_character":34},"updated":"2016-12-22 14:02:48.000000000","message":"Where does the message come from? From the underlying system? What if the locale is not en_US, will it work? If not, then what else do we have available in that failure_details array that could be used more safely to detect specific type of the failure?","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    def _get_return_code(self, failure_details):"},{"line_number":58,"context_line":"        if (len(failure_details) \u003d\u003d 4 and"},{"line_number":59,"context_line":"            \u0027XENAPI_PLUGIN_FAILURE\u0027 \u003d\u003d failure_details[0]):"},{"line_number":60,"context_line":"            if (\u0027is not permitted\u0027 in failure_details[3]):"},{"line_number":61,"context_line":"                return RC_UNAUTHORIZED"},{"line_number":62,"context_line":"            elif (\u0027No such file or directory\u0027 in failure_details[3]):"},{"line_number":63,"context_line":"                return RC_NOEXECFOUND"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_b7bd62d9","line":60,"range":{"start_line":60,"start_character":16,"end_line":60,"end_character":34},"in_reply_to":"da4df55a_bcdbb1ec","updated":"2016-12-23 15:29:12.000000000","message":"this is reported form the plugin netwrap which runs actually in dom0. But the message for RC_NOEXECFOUND does reported from underlying system. I will change the netwrap plugin to catch this exception and set a predefined string.","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            if (\u0027is not permitted\u0027 in failure_details[3]):"},{"line_number":61,"context_line":"                return RC_UNAUTHORIZED"},{"line_number":62,"context_line":"            elif (\u0027No such file or directory\u0027 in failure_details[3]):"},{"line_number":63,"context_line":"                return RC_NOEXECFOUND"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _get_XenAPI(self):"},{"line_number":66,"context_line":"        # Delay importing XenAPI as this module may not exist"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_dc231504","line":63,"updated":"2016-12-22 14:02:48.000000000","message":"(No action required) any more codes we could map to mimic oslo.rootwrap some more?","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _get_XenAPI(self):"},{"line_number":66,"context_line":"        # Delay importing XenAPI as this module may not exist"},{"line_number":67,"context_line":"        # for non-XenServer hypervisors."},{"line_number":68,"context_line":"        if self._XenAPI is None:"},{"line_number":69,"context_line":"            import XenAPI"},{"line_number":70,"context_line":"            self._XenAPI \u003d XenAPI"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_dcf5d583","line":67,"updated":"2016-12-22 14:02:48.000000000","message":"silly question: why not just adding the dependency to requirements.txt, since it\u0027s already tracked in openstack/requirements:global-requirements.txt?","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _get_XenAPI(self):"},{"line_number":66,"context_line":"        # Delay importing XenAPI as this module may not exist"},{"line_number":67,"context_line":"        # for non-XenServer hypervisors."},{"line_number":68,"context_line":"        if self._XenAPI is None:"},{"line_number":69,"context_line":"            import XenAPI"},{"line_number":70,"context_line":"            self._XenAPI \u003d XenAPI"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_97377eaf","line":67,"in_reply_to":"da4df55a_dcf5d583","updated":"2016-12-23 15:29:12.000000000","message":"Unfortunately the current XenAPI.py from pipy is incompatible with python3.x. If we just import it at the top, it will fail python3 Unit tests.","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            LOG.exception(_LE(\u0027Failed to execute command: %s\u0027), cmd)"},{"line_number":92,"context_line":"            out \u003d \"\""},{"line_number":93,"context_line":"            err \u003d \"\""},{"line_number":94,"context_line":"            returncode \u003d self._get_return_code(failure.details)"},{"line_number":95,"context_line":"            return returncode, out, err"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def get_session(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_7c122964","line":94,"updated":"2016-12-22 14:02:48.000000000","message":"since _get_return_code can return None, do you think it\u0027s correct to return None to the caller in case of failure?","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            LOG.exception(_LE(\u0027Failed to execute command: %s\u0027), cmd)"},{"line_number":92,"context_line":"            out \u003d \"\""},{"line_number":93,"context_line":"            err \u003d \"\""},{"line_number":94,"context_line":"            returncode \u003d self._get_return_code(failure.details)"},{"line_number":95,"context_line":"            return returncode, out, err"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def get_session(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_ac98ad1c","line":94,"in_reply_to":"da4df55a_7c122964","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":20382,"name":"YuYang","email":"yuyangwang1985@gmail.com","username":"YuYangWang"},"change_message_id":"7a0aa38c830c26ed171730b6e36ceb014787a2c9","unresolved":false,"context_lines":[{"line_number":85,"context_line":"            self._host \u003d session.xenapi.session.get_this_host(session.handle)"},{"line_number":86,"context_line":"        return self._host"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def execute(self, cmd, stdin\u003dNone):"},{"line_number":89,"context_line":"        out \u003d \"\""},{"line_number":90,"context_line":"        err \u003d \"\""},{"line_number":91,"context_line":"        if cmd is None or len(cmd) \u003d\u003d 0:"},{"line_number":92,"context_line":"            err \u003d \"No command specified.\""},{"line_number":93,"context_line":"            return oslo_rootwrap_cmd.RC_NOCOMMAND, out, err"},{"line_number":94,"context_line":"        try:"},{"line_number":95,"context_line":"            result_raw \u003d self._call_plugin("},{"line_number":96,"context_line":"                \u0027netwrap\u0027, \u0027run_command\u0027,"},{"line_number":97,"context_line":"                {\u0027cmd\u0027: jsonutils.dumps(cmd),"},{"line_number":98,"context_line":"                 \u0027cmd_input\u0027: jsonutils.dumps(stdin)})"},{"line_number":99,"context_line":"            result \u003d jsonutils.loads(result_raw)"},{"line_number":100,"context_line":"            returncode \u003d result[\u0027returncode\u0027]"},{"line_number":101,"context_line":"            out \u003d result[\u0027out\u0027]"},{"line_number":102,"context_line":"            err \u003d result[\u0027err\u0027]"},{"line_number":103,"context_line":"            return returncode, out, err"},{"line_number":104,"context_line":"        except self._get_XenAPI().Failure as failure:"},{"line_number":105,"context_line":"            LOG.exception(_LE(\u0027Failed to execute command: %s\u0027), cmd)"},{"line_number":106,"context_line":"            returncode \u003d self._get_return_code(failure.details)"},{"line_number":107,"context_line":"            return returncode, out, err"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def get_session(self):"},{"line_number":110,"context_line":"        if self._session is None:"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5201f7_b6785091","line":107,"range":{"start_line":88,"start_character":0,"end_line":107,"end_character":39},"updated":"2016-12-29 06:35:16.000000000","message":"this should has time out to set.because some times the command  not back.thanks!","commit_id":"ecc68b4e979417b01fd91420320491a5a0214ea0"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"7f250c093c6e97a2e380f7b87429050fbdc1f7e1","unresolved":false,"context_lines":[{"line_number":85,"context_line":"            self._host \u003d session.xenapi.session.get_this_host(session.handle)"},{"line_number":86,"context_line":"        return self._host"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def execute(self, cmd, stdin\u003dNone):"},{"line_number":89,"context_line":"        out \u003d \"\""},{"line_number":90,"context_line":"        err \u003d \"\""},{"line_number":91,"context_line":"        if cmd is None or len(cmd) \u003d\u003d 0:"},{"line_number":92,"context_line":"            err \u003d \"No command specified.\""},{"line_number":93,"context_line":"            return oslo_rootwrap_cmd.RC_NOCOMMAND, out, err"},{"line_number":94,"context_line":"        try:"},{"line_number":95,"context_line":"            result_raw \u003d self._call_plugin("},{"line_number":96,"context_line":"                \u0027netwrap\u0027, \u0027run_command\u0027,"},{"line_number":97,"context_line":"                {\u0027cmd\u0027: jsonutils.dumps(cmd),"},{"line_number":98,"context_line":"                 \u0027cmd_input\u0027: jsonutils.dumps(stdin)})"},{"line_number":99,"context_line":"            result \u003d jsonutils.loads(result_raw)"},{"line_number":100,"context_line":"            returncode \u003d result[\u0027returncode\u0027]"},{"line_number":101,"context_line":"            out \u003d result[\u0027out\u0027]"},{"line_number":102,"context_line":"            err \u003d result[\u0027err\u0027]"},{"line_number":103,"context_line":"            return returncode, out, err"},{"line_number":104,"context_line":"        except self._get_XenAPI().Failure as failure:"},{"line_number":105,"context_line":"            LOG.exception(_LE(\u0027Failed to execute command: %s\u0027), cmd)"},{"line_number":106,"context_line":"            returncode \u003d self._get_return_code(failure.details)"},{"line_number":107,"context_line":"            return returncode, out, err"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def get_session(self):"},{"line_number":110,"context_line":"        if self._session is None:"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba5201f7_4b5f6f72","line":107,"range":{"start_line":88,"start_character":0,"end_line":107,"end_character":39},"in_reply_to":"ba5201f7_b6785091","updated":"2016-12-30 03:13:21.000000000","message":"YuYang: Understood logically a timeout should be better. But could you share your experiences which have command not return back? In oslo_rootwrap which suports the existing root_helper_daemon has no timeout too.\nhttps://github.com/openstack/oslo.rootwrap/blob/master/oslo_rootwrap/cmd.py#L103\n\nAnd there is no timeout for the non-daemon mode root_helper in:\nhttps://github.com/openstack/neutron/blob/master/bin/neutron-rootwrap-xen-dom0#L112","commit_id":"ecc68b4e979417b01fd91420320491a5a0214ea0"}],"neutron/conf/agent/xenapi_conf.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":20,"context_line":"XENAPI_CONF_SECTION \u003d \u0027xenapi\u0027"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"XENAPI_OPTS \u003d ["},{"line_number":23,"context_line":"    cfg.StrOpt(\u0027connection_url\u0027, default\u003d\u0027\u0027,"},{"line_number":24,"context_line":"               help\u003d_(\"URL for connection to XenServer/Xen Cloud Platform.\")),"},{"line_number":25,"context_line":"    cfg.StrOpt(\u0027connection_username\u0027, default\u003d\u0027root\u0027,"},{"line_number":26,"context_line":"               help\u003d_(\"Username for connection to XenServer/Xen Cloud \""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_f7004604","line":23,"range":{"start_line":23,"start_character":33,"end_line":23,"end_character":44},"updated":"2016-12-16 10:53:54.000000000","message":"why default\u003dNone (the default for the library) not enough?","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":20,"context_line":"XENAPI_CONF_SECTION \u003d \u0027xenapi\u0027"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"XENAPI_OPTS \u003d ["},{"line_number":23,"context_line":"    cfg.StrOpt(\u0027connection_url\u0027, default\u003d\u0027\u0027,"},{"line_number":24,"context_line":"               help\u003d_(\"URL for connection to XenServer/Xen Cloud Platform.\")),"},{"line_number":25,"context_line":"    cfg.StrOpt(\u0027connection_username\u0027, default\u003d\u0027root\u0027,"},{"line_number":26,"context_line":"               help\u003d_(\"Username for connection to XenServer/Xen Cloud \""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_cd7b43f3","line":23,"range":{"start_line":23,"start_character":33,"end_line":23,"end_character":44},"in_reply_to":"1a6eadb0_f7004604","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    cfg.StrOpt(\u0027connection_username\u0027, default\u003d\u0027root\u0027,"},{"line_number":26,"context_line":"               help\u003d_(\"Username for connection to XenServer/Xen Cloud \""},{"line_number":27,"context_line":"                      \"Platform.\")),"},{"line_number":28,"context_line":"    cfg.StrOpt(\u0027connection_password\u0027, default\u003d\"\","},{"line_number":29,"context_line":"               help\u003d_(\"Password for connection to XenServer/Xen Cloud \""},{"line_number":30,"context_line":"                      \"Platform.\"))"},{"line_number":31,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_37371e00","line":28,"updated":"2016-12-16 10:53:54.000000000","message":"I think you should mark the option with secret\u003dTrue so that it\u0027s not logged in log files.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    cfg.StrOpt(\u0027connection_username\u0027, default\u003d\u0027root\u0027,"},{"line_number":26,"context_line":"               help\u003d_(\"Username for connection to XenServer/Xen Cloud \""},{"line_number":27,"context_line":"                      \"Platform.\")),"},{"line_number":28,"context_line":"    cfg.StrOpt(\u0027connection_password\u0027, default\u003d\"\","},{"line_number":29,"context_line":"               help\u003d_(\"Password for connection to XenServer/Xen Cloud \""},{"line_number":30,"context_line":"                      \"Platform.\"))"},{"line_number":31,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_1202300a","line":28,"range":{"start_line":28,"start_character":38,"end_line":28,"end_character":49},"updated":"2016-12-16 10:53:54.000000000","message":"same question on default","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    cfg.StrOpt(\u0027connection_username\u0027, default\u003d\u0027root\u0027,"},{"line_number":26,"context_line":"               help\u003d_(\"Username for connection to XenServer/Xen Cloud \""},{"line_number":27,"context_line":"                      \"Platform.\")),"},{"line_number":28,"context_line":"    cfg.StrOpt(\u0027connection_password\u0027, default\u003d\"\","},{"line_number":29,"context_line":"               help\u003d_(\"Password for connection to XenServer/Xen Cloud \""},{"line_number":30,"context_line":"                      \"Platform.\"))"},{"line_number":31,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_ad78c7f9","line":28,"in_reply_to":"1a6eadb0_37371e00","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"}],"neutron/conf/plugins/ml2/drivers/xenapi.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"6f696e91e2a69405607e2dbc9ab736778dc34c2c","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"XENAPI_CONF_SECTION \u003d \u0027xenapi\u0027"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"xenapi_opts \u003d ["},{"line_number":23,"context_line":"    cfg.StrOpt(\u0027connection_url\u0027, default\u003d\u0027\u0027,"},{"line_number":24,"context_line":"               help\u003d_(\"URL for connection to XenServer/Xen Cloud Platform.\")),"},{"line_number":25,"context_line":"    cfg.StrOpt(\u0027connection_username\u0027, default\u003d\u0027root\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_f42231a2","line":22,"updated":"2016-11-17 17:35:25.000000000","message":"Ihar suggested using neutron/opts.py; and since xenapi.py isn\u0027t a *driver* it doesn\u0027t make sense to have this here IMO.","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"de547b13db9ca39a8d22c370759298e06a86e732","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"XENAPI_CONF_SECTION \u003d \u0027xenapi\u0027"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"xenapi_opts \u003d ["},{"line_number":23,"context_line":"    cfg.StrOpt(\u0027connection_url\u0027, default\u003d\u0027\u0027,"},{"line_number":24,"context_line":"               help\u003d_(\"URL for connection to XenServer/Xen Cloud Platform.\")),"},{"line_number":25,"context_line":"    cfg.StrOpt(\u0027connection_username\u0027, default\u003d\u0027root\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_8ba1bafa","line":22,"in_reply_to":"7a77a97e_f42231a2","updated":"2016-11-18 10:30:17.000000000","message":"I think neutron/opts.py is used to generate configure file automatically? Yes xenapi is not a driver. maybe better to put it under agent as it will run an agent in domU to pass commands to dom0.","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"}],"neutron/opts.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":273,"context_line":"         ),"},{"line_number":274,"context_line":"        (\u0027securitygroup\u0027,"},{"line_number":275,"context_line":"         neutron.conf.agent.securitygroups_rpc.security_group_opts),"},{"line_number":276,"context_line":"        (\u0027xenapi\u0027,"},{"line_number":277,"context_line":"         neutron.conf.agent.xenapi_conf.XENAPI_OPTS)"},{"line_number":278,"context_line":"    ]"},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_329bac19","line":276,"updated":"2016-12-16 10:53:54.000000000","message":"is ovs the only agent that may need to call privileged commands?","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":273,"context_line":"         ),"},{"line_number":274,"context_line":"        (\u0027securitygroup\u0027,"},{"line_number":275,"context_line":"         neutron.conf.agent.securitygroups_rpc.security_group_opts),"},{"line_number":276,"context_line":"        (\u0027xenapi\u0027,"},{"line_number":277,"context_line":"         neutron.conf.agent.xenapi_conf.XENAPI_OPTS)"},{"line_number":278,"context_line":"    ]"},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_53fd123a","line":276,"in_reply_to":"1a6eadb0_329bac19","updated":"2016-12-20 09:20:16.000000000","message":"It\u0027s only needed by neutron-openvswitch-agent.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"}],"neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"6f696e91e2a69405607e2dbc9ab736778dc34c2c","unresolved":false,"context_lines":[{"line_number":2163,"context_line":"        # commands target xen dom0 rather than domU."},{"line_number":2164,"context_line":"        cfg.CONF.register_opts(ip_lib.OPTS)"},{"line_number":2165,"context_line":"        cfg.CONF.set_default(\u0027ip_lib_force_root\u0027, True)"},{"line_number":2166,"context_line":"        xenapi_conf.register_xenapi_opts()"},{"line_number":2167,"context_line":""},{"line_number":2168,"context_line":""},{"line_number":2169,"context_line":"def main(bridge_classes):"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_b1c28be7","line":2166,"updated":"2016-11-17 17:35:25.000000000","message":"Is this the right thing to do?  Should we just be doing a cfg.CONF.import_group for the xenapi driver?","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":2155,"context_line":""},{"line_number":2156,"context_line":""},{"line_number":2157,"context_line":"def prepare_xen_compute():"},{"line_number":2158,"context_line":"    is_xen_compute_host \u003d \u0027rootwrap-xen-dom0\u0027 in cfg.CONF.AGENT.root_helper \\"},{"line_number":2159,"context_line":"        or \u0027xenapi_root_helper\u0027 in cfg.CONF.AGENT.root_helper_daemon"},{"line_number":2160,"context_line":"    if is_xen_compute_host:"},{"line_number":2161,"context_line":"        # Force ip_lib to always use the root helper to ensure that ip"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_b275fccb","line":2158,"updated":"2016-12-16 10:53:54.000000000","message":"is there a use case where root_helper is not rootwrap-xen-dom0 while root_helper_daemon is xenapi_root_helper?","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":2155,"context_line":""},{"line_number":2156,"context_line":""},{"line_number":2157,"context_line":"def prepare_xen_compute():"},{"line_number":2158,"context_line":"    is_xen_compute_host \u003d \u0027rootwrap-xen-dom0\u0027 in cfg.CONF.AGENT.root_helper \\"},{"line_number":2159,"context_line":"        or \u0027xenapi_root_helper\u0027 in cfg.CONF.AGENT.root_helper_daemon"},{"line_number":2160,"context_line":"    if is_xen_compute_host:"},{"line_number":2161,"context_line":"        # Force ip_lib to always use the root helper to ensure that ip"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_b09adcc3","line":2158,"in_reply_to":"1a6eadb0_b275fccb","updated":"2016-12-20 09:20:16.000000000","message":"Logically root_helper can be empty but has \"root_helper_daemon \u003d xenapi_root_helper\". The rootwrap-xen-dom0 is the proxy script running in domU.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":2156,"context_line":""},{"line_number":2157,"context_line":"def prepare_xen_compute():"},{"line_number":2158,"context_line":"    is_xen_compute_host \u003d \u0027rootwrap-xen-dom0\u0027 in cfg.CONF.AGENT.root_helper \\"},{"line_number":2159,"context_line":"        or \u0027xenapi_root_helper\u0027 in cfg.CONF.AGENT.root_helper_daemon"},{"line_number":2160,"context_line":"    if is_xen_compute_host:"},{"line_number":2161,"context_line":"        # Force ip_lib to always use the root helper to ensure that ip"},{"line_number":2162,"context_line":"        # commands target xen dom0 rather than domU."}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_92b3a097","line":2159,"range":{"start_line":2159,"start_character":32,"end_line":2159,"end_character":34},"updated":"2016-12-16 10:53:54.000000000","message":"\u003d\u003d?","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":2156,"context_line":""},{"line_number":2157,"context_line":"def prepare_xen_compute():"},{"line_number":2158,"context_line":"    is_xen_compute_host \u003d \u0027rootwrap-xen-dom0\u0027 in cfg.CONF.AGENT.root_helper \\"},{"line_number":2159,"context_line":"        or \u0027xenapi_root_helper\u0027 in cfg.CONF.AGENT.root_helper_daemon"},{"line_number":2160,"context_line":"    if is_xen_compute_host:"},{"line_number":2161,"context_line":"        # Force ip_lib to always use the root helper to ensure that ip"},{"line_number":2162,"context_line":"        # commands target xen dom0 rather than domU."}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_72b8c475","line":2159,"range":{"start_line":2159,"start_character":11,"end_line":2159,"end_character":31},"updated":"2016-12-16 10:53:54.000000000","message":"this is the second time the value is used in code. consider defining a constant to store it.","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":2156,"context_line":""},{"line_number":2157,"context_line":"def prepare_xen_compute():"},{"line_number":2158,"context_line":"    is_xen_compute_host \u003d \u0027rootwrap-xen-dom0\u0027 in cfg.CONF.AGENT.root_helper \\"},{"line_number":2159,"context_line":"        or \u0027xenapi_root_helper\u0027 in cfg.CONF.AGENT.root_helper_daemon"},{"line_number":2160,"context_line":"    if is_xen_compute_host:"},{"line_number":2161,"context_line":"        # Force ip_lib to always use the root helper to ensure that ip"},{"line_number":2162,"context_line":"        # commands target xen dom0 rather than domU."}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_b0fe5c03","line":2159,"range":{"start_line":2159,"start_character":11,"end_line":2159,"end_character":31},"in_reply_to":"1a6eadb0_72b8c475","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":2157,"context_line":""},{"line_number":2158,"context_line":"def prepare_xen_compute():"},{"line_number":2159,"context_line":"    is_xen_compute_host \u003d \u0027rootwrap-xen-dom0\u0027 in cfg.CONF.AGENT.root_helper \\"},{"line_number":2160,"context_line":"        or \u0027xenapi_root_helper\u0027 \u003d\u003d cfg.CONF.AGENT.root_helper_daemon"},{"line_number":2161,"context_line":"    if is_xen_compute_host:"},{"line_number":2162,"context_line":"        xenapi_conf.register_xenapi_opts()"},{"line_number":2163,"context_line":"        # Force ip_lib to always use the root helper to ensure that ip"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_a75c7a26","line":2160,"range":{"start_line":2160,"start_character":11,"end_line":2160,"end_character":31},"updated":"2016-12-22 14:02:48.000000000","message":"I pointed out before that it would be better to have the literal replaced by a common constant reused everywhere we need the value","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":2157,"context_line":""},{"line_number":2158,"context_line":"def prepare_xen_compute():"},{"line_number":2159,"context_line":"    is_xen_compute_host \u003d \u0027rootwrap-xen-dom0\u0027 in cfg.CONF.AGENT.root_helper \\"},{"line_number":2160,"context_line":"        or \u0027xenapi_root_helper\u0027 \u003d\u003d cfg.CONF.AGENT.root_helper_daemon"},{"line_number":2161,"context_line":"    if is_xen_compute_host:"},{"line_number":2162,"context_line":"        xenapi_conf.register_xenapi_opts()"},{"line_number":2163,"context_line":"        # Force ip_lib to always use the root helper to ensure that ip"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_63917352","line":2160,"range":{"start_line":2160,"start_character":11,"end_line":2160,"end_character":31},"in_reply_to":"da4df55a_a75c7a26","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"977554a98ac1f31fac31530268c4cf9946a9d240","unresolved":false,"context_lines":[{"line_number":2135,"context_line":""},{"line_number":2136,"context_line":"def prepare_xen_compute():"},{"line_number":2137,"context_line":"    is_xen_compute_host \u003d \u0027rootwrap-xen-dom0\u0027 in cfg.CONF.AGENT.root_helper \\"},{"line_number":2138,"context_line":"        or xenapi_root_helper.ROOT_HELPER_DAEMON_TOKEN \u003d\u003d \\"},{"line_number":2139,"context_line":"        cfg.CONF.AGENT.root_helper_daemon"},{"line_number":2140,"context_line":"    if is_xen_compute_host:"},{"line_number":2141,"context_line":"        xenapi_conf.register_xenapi_opts()"}],"source_content_type":"text/x-python","patch_set":17,"id":"ba5201f7_65ef371e","line":2138,"range":{"start_line":2138,"start_character":11,"end_line":2138,"end_character":29},"updated":"2017-01-06 20:08:29.000000000","message":"xrh?","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"53964b34a3363378f470e1af19c20ac1c0ec123a","unresolved":false,"context_lines":[{"line_number":2135,"context_line":""},{"line_number":2136,"context_line":"def prepare_xen_compute():"},{"line_number":2137,"context_line":"    is_xen_compute_host \u003d \u0027rootwrap-xen-dom0\u0027 in cfg.CONF.AGENT.root_helper \\"},{"line_number":2138,"context_line":"        or xenapi_root_helper.ROOT_HELPER_DAEMON_TOKEN \u003d\u003d \\"},{"line_number":2139,"context_line":"        cfg.CONF.AGENT.root_helper_daemon"},{"line_number":2140,"context_line":"    if is_xen_compute_host:"},{"line_number":2141,"context_line":"        xenapi_conf.register_xenapi_opts()"}],"source_content_type":"text/x-python","patch_set":17,"id":"ba5201f7_63ad689a","line":2138,"range":{"start_line":2138,"start_character":11,"end_line":2138,"end_character":29},"in_reply_to":"ba5201f7_65ef371e","updated":"2017-01-07 04:54:12.000000000","message":"see the previous reply. May we keep it for more readable?","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"}],"neutron/plugins/ml2/drivers/openvswitch/agent/xenapi/etc/xapi.d/plugins/netwrap":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"977554a98ac1f31fac31530268c4cf9946a9d240","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"MSG_UNAUTHORIZED \u003d \"Unauthorized command\""},{"line_number":37,"context_line":"MSG_NOT_FOUND \u003d \"Executable not found\""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"ALLOWED_CMDS \u003d ["},{"line_number":40,"context_line":"    \u0027ip\u0027,"}],"source_content_type":"application/octet-stream","patch_set":17,"id":"ba5201f7_850edbe2","line":37,"updated":"2017-01-06 20:08:29.000000000","message":"I guess we duplicate here because of different runtimes (py2.4 vs py2.7+)?","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"53964b34a3363378f470e1af19c20ac1c0ec123a","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"MSG_UNAUTHORIZED \u003d \"Unauthorized command\""},{"line_number":37,"context_line":"MSG_NOT_FOUND \u003d \"Executable not found\""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"ALLOWED_CMDS \u003d ["},{"line_number":40,"context_line":"    \u0027ip\u0027,"}],"source_content_type":"application/octet-stream","patch_set":17,"id":"ba5201f7_63e9e8b6","line":37,"in_reply_to":"ba5201f7_850edbe2","updated":"2017-01-07 04:54:12.000000000","message":"That\u0027s true:-)\nThis plugin will be executed in Dom0 with py2.4.","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"977554a98ac1f31fac31530268c4cf9946a9d240","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                                stderr\u003dpipe, close_fds\u003dTrue)"},{"line_number":69,"context_line":"    except OSError, e:"},{"line_number":70,"context_line":"        if e.errno \u003d\u003d errno.ENOENT:"},{"line_number":71,"context_line":"             raise PluginError(MSG_UNAUTHORIZE)"},{"line_number":72,"context_line":"    (out, err) \u003d proc.communicate(cmd_input)"},{"line_number":73,"context_line":"    return proc.returncode, out, err"},{"line_number":74,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":17,"id":"ba5201f7_c54e233a","line":71,"range":{"start_line":71,"start_character":35,"end_line":71,"end_character":46},"updated":"2017-01-06 20:08:29.000000000","message":"UNAUTHORIZE*D*?","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"53964b34a3363378f470e1af19c20ac1c0ec123a","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                                stderr\u003dpipe, close_fds\u003dTrue)"},{"line_number":69,"context_line":"    except OSError, e:"},{"line_number":70,"context_line":"        if e.errno \u003d\u003d errno.ENOENT:"},{"line_number":71,"context_line":"             raise PluginError(MSG_UNAUTHORIZE)"},{"line_number":72,"context_line":"    (out, err) \u003d proc.communicate(cmd_input)"},{"line_number":73,"context_line":"    return proc.returncode, out, err"},{"line_number":74,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":17,"id":"ba5201f7_a393d059","line":71,"range":{"start_line":71,"start_character":35,"end_line":71,"end_character":46},"in_reply_to":"ba5201f7_c54e233a","updated":"2017-01-07 04:54:12.000000000","message":"Done","commit_id":"ab8fe945bb4d796cdc72166feb18ecc9e1a50c52"}],"neutron/tests/unit/agent/linux/test_utils.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_xenapi_root_helper(self):"},{"line_number":41,"context_line":"        with mock.patch.object(utils, \u0027cfg\u0027) as cfg:"},{"line_number":42,"context_line":"            cfg.CONF.AGENT.root_helper_daemon \u003d \u0027xenapi_root_helper\u0027"},{"line_number":43,"context_line":"            cmd_client \u003d utils.RootwrapDaemonHelper.get_client()"},{"line_number":44,"context_line":"            self.assertIsInstance(cmd_client,"},{"line_number":45,"context_line":"                                  utils.xenapi_root_helper.XenAPI_client)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_a7aabad2","line":42,"updated":"2016-12-22 14:02:48.000000000","message":"Use set_override instead, then you don\u0027t need to mock oslo.config out.","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_xenapi_root_helper(self):"},{"line_number":41,"context_line":"        with mock.patch.object(utils, \u0027cfg\u0027) as cfg:"},{"line_number":42,"context_line":"            cfg.CONF.AGENT.root_helper_daemon \u003d \u0027xenapi_root_helper\u0027"},{"line_number":43,"context_line":"            cmd_client \u003d utils.RootwrapDaemonHelper.get_client()"},{"line_number":44,"context_line":"            self.assertIsInstance(cmd_client,"},{"line_number":45,"context_line":"                                  utils.xenapi_root_helper.XenAPI_client)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_6787f261","line":42,"range":{"start_line":42,"start_character":48,"end_line":42,"end_character":68},"updated":"2016-12-22 14:02:48.000000000","message":"yet another place where a common constant could come handy","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_xenapi_root_helper(self):"},{"line_number":41,"context_line":"        with mock.patch.object(utils, \u0027cfg\u0027) as cfg:"},{"line_number":42,"context_line":"            cfg.CONF.AGENT.root_helper_daemon \u003d \u0027xenapi_root_helper\u0027"},{"line_number":43,"context_line":"            cmd_client \u003d utils.RootwrapDaemonHelper.get_client()"},{"line_number":44,"context_line":"            self.assertIsInstance(cmd_client,"},{"line_number":45,"context_line":"                                  utils.xenapi_root_helper.XenAPI_client)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_23168b55","line":42,"range":{"start_line":42,"start_character":48,"end_line":42,"end_character":68},"in_reply_to":"da4df55a_6787f261","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_xenapi_root_helper(self):"},{"line_number":41,"context_line":"        with mock.patch.object(utils, \u0027cfg\u0027) as cfg:"},{"line_number":42,"context_line":"            cfg.CONF.AGENT.root_helper_daemon \u003d \u0027xenapi_root_helper\u0027"},{"line_number":43,"context_line":"            cmd_client \u003d utils.RootwrapDaemonHelper.get_client()"},{"line_number":44,"context_line":"            self.assertIsInstance(cmd_client,"},{"line_number":45,"context_line":"                                  utils.xenapi_root_helper.XenAPI_client)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_961cd7c2","line":42,"in_reply_to":"da4df55a_a7aabad2","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"}],"neutron/tests/unit/agent/linux/test_xenapi_root_helper.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"6f696e91e2a69405607e2dbc9ab736778dc34c2c","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            self.assertEqual(\"\", err)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def test_execute_failure(self):"},{"line_number":58,"context_line":"        RC_XENAPI_PLUGIN_FAILURE \u003d 96"},{"line_number":59,"context_line":"        ERR_MESSAGE \u003d \"Exception raised when execute command.\""},{"line_number":60,"context_line":"        cmd \u003d [\"fake_not_exist_cmd\"]"},{"line_number":61,"context_line":"        expect_cmd_args \u003d {\u0027cmd\u0027: \u0027[\"fake_not_exist_cmd\"]\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_146a4db3","line":58,"updated":"2016-11-17 17:35:25.000000000","message":"OK, I see this is used here, but this magic value isn\u0027t used anywhere else?","commit_id":"c82c18303421960346ea6f6c52f2a8a81b9c98d9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        with mock.patch.object(helper.XenAPI_Client, \"_call_plugin\","},{"line_number":47,"context_line":"                               return_value\u003draw_result) as mock_call_plugin:"},{"line_number":48,"context_line":"            xenapi_client \u003d self._get_fake_xenapi_client()"},{"line_number":49,"context_line":"            (returncode, out, err) \u003d xenapi_client.execute(cmd)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"            mock_call_plugin.assert_called_once_with("},{"line_number":52,"context_line":"                \u0027netwrap\u0027, \u0027run_command\u0027, expect_cmd_args)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_7246047c","line":49,"range":{"start_line":49,"start_character":12,"end_line":49,"end_character":13},"updated":"2016-12-16 10:53:54.000000000","message":"nit: you don\u0027t need braces here","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        with mock.patch.object(helper.XenAPI_Client, \"_call_plugin\","},{"line_number":47,"context_line":"                               return_value\u003draw_result) as mock_call_plugin:"},{"line_number":48,"context_line":"            xenapi_client \u003d self._get_fake_xenapi_client()"},{"line_number":49,"context_line":"            (returncode, out, err) \u003d xenapi_client.execute(cmd)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"            mock_call_plugin.assert_called_once_with("},{"line_number":52,"context_line":"                \u0027netwrap\u0027, \u0027run_command\u0027, expect_cmd_args)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_50aa68d3","line":49,"range":{"start_line":49,"start_character":12,"end_line":49,"end_character":13},"in_reply_to":"1a6eadb0_7246047c","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            self.assertEqual(\"\", err)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def test_execute_failure(self):"},{"line_number":58,"context_line":"        RC_XENAPI_PLUGIN_FAILURE \u003d 96"},{"line_number":59,"context_line":"        ERR_MESSAGE \u003d \"Exception raised when execute command.\""},{"line_number":60,"context_line":"        cmd \u003d [\"fake_not_exist_cmd\"]"},{"line_number":61,"context_line":"        expect_cmd_args \u003d {\u0027cmd\u0027: \u0027[\"fake_not_exist_cmd\"]\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_f229349c","line":58,"range":{"start_line":58,"start_character":8,"end_line":58,"end_character":37},"updated":"2016-12-16 10:53:54.000000000","message":"couldn\u0027t you reuse the value from the module that already defines it instead of duplicating it here?","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            self.assertEqual(\"\", err)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def test_execute_failure(self):"},{"line_number":58,"context_line":"        RC_XENAPI_PLUGIN_FAILURE \u003d 96"},{"line_number":59,"context_line":"        ERR_MESSAGE \u003d \"Exception raised when execute command.\""},{"line_number":60,"context_line":"        cmd \u003d [\"fake_not_exist_cmd\"]"},{"line_number":61,"context_line":"        expect_cmd_args \u003d {\u0027cmd\u0027: \u0027[\"fake_not_exist_cmd\"]\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_10f630f9","line":58,"range":{"start_line":58,"start_character":8,"end_line":58,"end_character":37},"in_reply_to":"1a6eadb0_f229349c","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ce0758df6467489ee88629feeb51ecf21d8d32cc","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        with mock.patch.object(helper.XenAPI_Client, \"_call_plugin\","},{"line_number":65,"context_line":"                               site_effect\u003dException()) as mock_call_plugin:"},{"line_number":66,"context_line":"            xenapi_client \u003d self._get_fake_xenapi_client()"},{"line_number":67,"context_line":"            (returncode, out, err) \u003d xenapi_client.execute(cmd)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"            mock_call_plugin.assert_called_once_with("},{"line_number":70,"context_line":"                \u0027netwrap\u0027, \u0027run_command\u0027, expect_cmd_args)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_2618d174","line":67,"range":{"start_line":67,"start_character":12,"end_line":67,"end_character":13},"updated":"2016-12-16 10:53:54.000000000","message":"ditto for braces","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2272edcf3471e16c2c163d2fe6e79f160952a6a2","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        with mock.patch.object(helper.XenAPI_Client, \"_call_plugin\","},{"line_number":65,"context_line":"                               site_effect\u003dException()) as mock_call_plugin:"},{"line_number":66,"context_line":"            xenapi_client \u003d self._get_fake_xenapi_client()"},{"line_number":67,"context_line":"            (returncode, out, err) \u003d xenapi_client.execute(cmd)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"            mock_call_plugin.assert_called_once_with("},{"line_number":70,"context_line":"                \u0027netwrap\u0027, \u0027run_command\u0027, expect_cmd_args)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_30ddec70","line":67,"range":{"start_line":67,"start_character":12,"end_line":67,"end_character":13},"in_reply_to":"1a6eadb0_2618d174","updated":"2016-12-20 09:20:16.000000000","message":"Done","commit_id":"886ded6941ec1c2c7dde503d27187714e490107f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":25,"context_line":"        class FakeXenapiClient(helper.XenAPI_client):"},{"line_number":26,"context_line":"            def __init__(self):"},{"line_number":27,"context_line":"                super(FakeXenapiClient, self).__init__()"},{"line_number":28,"context_line":"                # Mock XenAPI which may not exist in the unit test env."},{"line_number":29,"context_line":"                self.XenAPI \u003d mock.MagicMock()"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        return FakeXenapiClient()"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_47d02e54","line":28,"updated":"2016-12-22 14:02:48.000000000","message":"I am thinking, maybe we can avoid mocking it that hard if we would add a new runtime dependency.","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":25,"context_line":"        class FakeXenapiClient(helper.XenAPI_client):"},{"line_number":26,"context_line":"            def __init__(self):"},{"line_number":27,"context_line":"                super(FakeXenapiClient, self).__init__()"},{"line_number":28,"context_line":"                # Mock XenAPI which may not exist in the unit test env."},{"line_number":29,"context_line":"                self.XenAPI \u003d mock.MagicMock()"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        return FakeXenapiClient()"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_c3a13fab","line":28,"in_reply_to":"da4df55a_47d02e54","updated":"2016-12-23 15:29:12.000000000","message":"the same reason: Currently XenAPI is incompatible with python3.x. If not mock it, it will broken py3.x unit tests.","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        xenapi_conf.register_xenapi_opts(conf)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def test_get_return_code_unauthourized(self):"},{"line_number":39,"context_line":"        failure_details \u003d [\u0027XENAPI_PLUGIN_FAILURE\u0027,"},{"line_number":40,"context_line":"                           \u0027run_command\u0027,"},{"line_number":41,"context_line":"                           \u0027PluginError\u0027,"},{"line_number":42,"context_line":"                           \"Dom0 execution of \u0027cmd\u0027 is not permitted\"]"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_07bf06fc","line":39,"range":{"start_line":39,"start_character":27,"end_line":39,"end_character":50},"updated":"2016-12-22 14:02:48.000000000","message":"Not sure I like the way we copy-paste the same literals around","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        xenapi_conf.register_xenapi_opts(conf)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def test_get_return_code_unauthourized(self):"},{"line_number":39,"context_line":"        failure_details \u003d [\u0027XENAPI_PLUGIN_FAILURE\u0027,"},{"line_number":40,"context_line":"                           \u0027run_command\u0027,"},{"line_number":41,"context_line":"                           \u0027PluginError\u0027,"},{"line_number":42,"context_line":"                           \"Dom0 execution of \u0027cmd\u0027 is not permitted\"]"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_c0ddb515","line":39,"range":{"start_line":39,"start_character":27,"end_line":39,"end_character":50},"in_reply_to":"da4df55a_07bf06fc","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                           \"Dom0 execution of \u0027cmd\u0027 is not permitted\"]"},{"line_number":43,"context_line":"        xenapi_client \u003d self._get_fake_xenapi_client()"},{"line_number":44,"context_line":"        rc \u003d xenapi_client._get_return_code(failure_details)"},{"line_number":45,"context_line":"        self.assertEqual(rc, helper.RC_UNAUTHORIZED)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_get_return_code_noexecfound(self):"},{"line_number":48,"context_line":"        failure_details \u003d [\u0027XENAPI_PLUGIN_FAILURE\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_67d8d254","line":45,"range":{"start_line":45,"start_character":25,"end_line":45,"end_character":51},"updated":"2016-12-22 14:02:48.000000000","message":"nit: the common convension is to put the expected value as first argument to assertEqual, then the value to match as the 2nd argument.","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                           \"Dom0 execution of \u0027cmd\u0027 is not permitted\"]"},{"line_number":43,"context_line":"        xenapi_client \u003d self._get_fake_xenapi_client()"},{"line_number":44,"context_line":"        rc \u003d xenapi_client._get_return_code(failure_details)"},{"line_number":45,"context_line":"        self.assertEqual(rc, helper.RC_UNAUTHORIZED)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_get_return_code_noexecfound(self):"},{"line_number":48,"context_line":"        failure_details \u003d [\u0027XENAPI_PLUGIN_FAILURE\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_a0c0b12b","line":45,"range":{"start_line":45,"start_character":25,"end_line":45,"end_character":51},"in_reply_to":"da4df55a_67d8d254","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.assertEqual(rc, helper.RC_UNAUTHORIZED)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_get_return_code_noexecfound(self):"},{"line_number":48,"context_line":"        failure_details \u003d [\u0027XENAPI_PLUGIN_FAILURE\u0027,"},{"line_number":49,"context_line":"                           \u0027run_command\u0027,"},{"line_number":50,"context_line":"                           \u0027OSError\u0027,"},{"line_number":51,"context_line":"                           \u0027[Errno 2] No such file or directory\u0027]"},{"line_number":52,"context_line":"        xenapi_client \u003d self._get_fake_xenapi_client()"},{"line_number":53,"context_line":"        rc \u003d xenapi_client._get_return_code(failure_details)"},{"line_number":54,"context_line":"        self.assertEqual(rc, helper.RC_NOEXECFOUND)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_670a92d4","line":51,"range":{"start_line":48,"start_character":8,"end_line":51,"end_character":65},"updated":"2016-12-22 14:02:48.000000000","message":"(No action required) So the failure details returned by XenAPI don\u0027t even contain CLI return code? What a bummer. :-x","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.assertEqual(rc, helper.RC_UNAUTHORIZED)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_get_return_code_noexecfound(self):"},{"line_number":48,"context_line":"        failure_details \u003d [\u0027XENAPI_PLUGIN_FAILURE\u0027,"},{"line_number":49,"context_line":"                           \u0027run_command\u0027,"},{"line_number":50,"context_line":"                           \u0027OSError\u0027,"},{"line_number":51,"context_line":"                           \u0027[Errno 2] No such file or directory\u0027]"},{"line_number":52,"context_line":"        xenapi_client \u003d self._get_fake_xenapi_client()"},{"line_number":53,"context_line":"        rc \u003d xenapi_client._get_return_code(failure_details)"},{"line_number":54,"context_line":"        self.assertEqual(rc, helper.RC_NOEXECFOUND)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_40a465a5","line":51,"range":{"start_line":48,"start_character":8,"end_line":51,"end_character":65},"in_reply_to":"da4df55a_670a92d4","updated":"2016-12-23 15:29:12.000000000","message":"If command got executed, it XenAPI will return the return code. But if this command doesn\u0027t exist, it will raise an exception and contain the failure_details as here.","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2ab8af28557a75413d5baba8e1f8f692e556a473","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        with mock.patch.object(helper.XenAPI_client, \"_call_plugin\","},{"line_number":63,"context_line":"                               return_value\u003draw_result) as mock_call_plugin:"},{"line_number":64,"context_line":"            xenapi_client \u003d self._get_fake_xenapi_client()"},{"line_number":65,"context_line":"            (returncode, out, err) \u003d xenapi_client.execute(cmd)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"            mock_call_plugin.assert_called_once_with("},{"line_number":68,"context_line":"                \u0027netwrap\u0027, \u0027run_command\u0027, expect_cmd_args)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_67bff2d0","line":65,"range":{"start_line":65,"start_character":12,"end_line":65,"end_character":13},"updated":"2016-12-22 14:02:48.000000000","message":"you don\u0027t need those braces","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c6efc2ab3ca4bce9d39a2941e720c5dbcc9e0891","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        with mock.patch.object(helper.XenAPI_client, \"_call_plugin\","},{"line_number":63,"context_line":"                               return_value\u003draw_result) as mock_call_plugin:"},{"line_number":64,"context_line":"            xenapi_client \u003d self._get_fake_xenapi_client()"},{"line_number":65,"context_line":"            (returncode, out, err) \u003d xenapi_client.execute(cmd)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"            mock_call_plugin.assert_called_once_with("},{"line_number":68,"context_line":"                \u0027netwrap\u0027, \u0027run_command\u0027, expect_cmd_args)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da4df55a_40cb8553","line":65,"range":{"start_line":65,"start_character":12,"end_line":65,"end_character":13},"in_reply_to":"da4df55a_67bff2d0","updated":"2016-12-23 15:29:12.000000000","message":"Done","commit_id":"de5677af94d891cf45f810c49e667ac77f94ebf5"}]}
