)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"f6b0fad4da927ced0263f85bbaa06bcb2c2193ba","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Use python package instead of sshpass to execute remote commands."},{"line_number":10,"context_line":"Fixing this issue, using paramiko"},{"line_number":11,"context_line":"Partial-Bug: #1511658"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I102d178b2fb1f621f2a61b26a939e69613156c19"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ba63e191_0057face","line":11,"range":{"start_line":11,"start_character":14,"end_line":11,"end_character":21},"updated":"2016-01-20 06:05:31.000000000","message":"Please use Closes-Bug: #1511658 if it is actually closing the bug and nothing more needed.","commit_id":"9fbc137d053905aa366ce3aa5b86be65dfba69b9"}],"tacker/common/cmd_executer.py":[{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"57f0fbc6ccc07c73ae25713497af25f9424fef7b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":2,"context_line":"# not use this file except in compliance with the License. You may obtain"},{"line_number":3,"context_line":"# a copy of the License at"},{"line_number":4,"context_line":"#"},{"line_number":5,"context_line":"#      http://www.apache.org/licenses/LICENSE-2.0"},{"line_number":6,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":5,"id":"7af24918_abec1cc8","line":3,"range":{"start_line":3,"start_character":9,"end_line":3,"end_character":11},"updated":"2016-03-02 03:24:34.000000000","message":"please add LOG.exception, LOG.error, LOG.debug in this file","commit_id":"a362aadaaaf0bf4d4e0aac7e44e13d4eb4060f23"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"de3da90a989a579f19efc5665b340b08c6e0927a","unresolved":false,"context_lines":[{"line_number":10,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"# under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"from tacker.openstack.common import log as logging"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import paramiko"},{"line_number":16,"context_line":"import socket"}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_407bf029","line":13,"range":{"start_line":13,"start_character":0,"end_line":13,"end_character":50},"updated":"2016-03-11 05:08:31.000000000","message":"PEP8: good practice to have project specific imports after 3rd party imports in import ordering","commit_id":"8cc923bf264dd3fa2dd3902c58bba1293f62c5da"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"de3da90a989a579f19efc5665b340b08c6e0927a","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"from tacker.openstack.common import log as logging"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import paramiko"},{"line_number":16,"context_line":"import socket"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_40cdb085","line":15,"range":{"start_line":15,"start_character":7,"end_line":15,"end_character":15},"updated":"2016-03-11 05:08:31.000000000","message":"we will need to add this to tacker requirements.txt","commit_id":"8cc923bf264dd3fa2dd3902c58bba1293f62c5da"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"6d263dbe84b095a95f2f13d291fa9ff2265d7439","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                stdin.write(input_data)"},{"line_number":101,"context_line":"            stdout \u003d channel.makefile(\u0027rb\u0027)"},{"line_number":102,"context_line":"            stderr \u003d channel.makefile_stderr()"},{"line_number":103,"context_line":"            cmd_err \u003d stderr.readlines()"},{"line_number":104,"context_line":"            cmd_out \u003d stdout.readlines()"},{"line_number":105,"context_line":"            return_code \u003d channel.recv_exit_status()"},{"line_number":106,"context_line":"            stdin.close()"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba0121b8_c97b0f27","line":103,"range":{"start_line":103,"start_character":29,"end_line":103,"end_character":38},"updated":"2016-03-30 23:10:33.000000000","message":"this line is throwing up an error when testing with openwrt image","commit_id":"31de8aef300db241ac2d86ab8a70bb27f3a93824"},{"author":{"_account_id":6348,"name":"xu-haiwei","email":"hai-xu@xr.jp.nec.com","username":"xu-haiwei"},"change_message_id":"7ec05dd3445d49faee811f57c0bbf3512e28d4ca","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        if not self.__paramiko_conn.is_authenticated():"},{"line_number":85,"context_line":"            self.__paramiko_conn.close()"},{"line_number":86,"context_line":"            LOG.error(_(\"Authentication failed: %s\"), self.__ip)"},{"line_number":87,"context_line":"            raise Exception(\u0027Authentication failed: %s\u0027 % self.__ip)"},{"line_number":88,"context_line":"        LOG.debug(_(\"Connected with client: %s\"), self.__ip)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def close_session(self):"}],"source_content_type":"text/x-python","patch_set":15,"id":"bab6814e_cdc75794","line":87,"updated":"2016-05-23 04:02:14.000000000","message":"Since NotAuthorized() exception is defined in tacker.common.exceptions, we should use it instead of Exception().","commit_id":"92c59f30f2c3720bce7ff07a037aa152ca5809f0"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"18877bc9e666867053e3f9f442a3f5621957f5e6","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        if not self.__paramiko_conn.is_authenticated():"},{"line_number":85,"context_line":"            self.__paramiko_conn.close()"},{"line_number":86,"context_line":"            LOG.error(_(\"Authentication failed: %s\"), self.__ip)"},{"line_number":87,"context_line":"            raise Exception(\u0027Authentication failed: %s\u0027 % self.__ip)"},{"line_number":88,"context_line":"        LOG.debug(_(\"Connected with client: %s\"), self.__ip)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def close_session(self):"}],"source_content_type":"text/x-python","patch_set":15,"id":"9abb7d3a_306c0b9c","line":87,"in_reply_to":"bab6814e_cdc75794","updated":"2016-06-03 08:27:30.000000000","message":"Done","commit_id":"92c59f30f2c3720bce7ff07a037aa152ca5809f0"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"e83489e6187522946bcfab31caf592ab85eff8b0","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            LOG.error(_(\"Could not connect to %s. Giving up\") % self.__host)"},{"line_number":73,"context_line":"            raise"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def close_session(self):"},{"line_number":76,"context_line":"        self.__ssh.close()"},{"line_number":77,"context_line":"        LOG.debug(_(\"Connection close\"))"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_874b075f","line":75,"range":{"start_line":75,"start_character":0,"end_line":75,"end_character":28},"updated":"2016-06-16 05:04:11.000000000","message":"where is this called?","commit_id":"4717911b7865d49f2f3d177ed1f2bf433579ccbf"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"81ded6b644b8ba3884609a4f1b37be74f6133c4f","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            LOG.error(_(\"Could not connect to %s. Giving up\") % self.__host)"},{"line_number":73,"context_line":"            raise"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def close_session(self):"},{"line_number":76,"context_line":"        self.__ssh.close()"},{"line_number":77,"context_line":"        LOG.debug(_(\"Connection close\"))"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_870bca7c","line":75,"range":{"start_line":75,"start_character":0,"end_line":75,"end_character":28},"in_reply_to":"7aa08908_874b075f","updated":"2016-06-17 04:23:45.000000000","message":"I missed it, will be used in destructor in updated patch.","commit_id":"4717911b7865d49f2f3d177ed1f2bf433579ccbf"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"e83489e6187522946bcfab31caf592ab85eff8b0","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        try:"},{"line_number":81,"context_line":"            stdin, stdout, stderr \u003d self.__ssh.exec_command(cmd)"},{"line_number":82,"context_line":"            if input_data:"},{"line_number":83,"context_line":"                stdin.write(input_data)"},{"line_number":84,"context_line":"                stdin.flush()"},{"line_number":85,"context_line":"                cmd_out \u003d stdout.readlines()"},{"line_number":86,"context_line":"                cmd_err \u003d stderr.readlines()"},{"line_number":87,"context_line":"                return_code \u003d self.__ssh.recv_exit_status()"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_879947d3","line":84,"range":{"start_line":83,"start_character":16,"end_line":84,"end_character":29},"updated":"2016-06-16 05:04:11.000000000","message":"pl put few more debug logs here to ensure the stdin write was successful","commit_id":"4717911b7865d49f2f3d177ed1f2bf433579ccbf"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"81ded6b644b8ba3884609a4f1b37be74f6133c4f","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        try:"},{"line_number":81,"context_line":"            stdin, stdout, stderr \u003d self.__ssh.exec_command(cmd)"},{"line_number":82,"context_line":"            if input_data:"},{"line_number":83,"context_line":"                stdin.write(input_data)"},{"line_number":84,"context_line":"                stdin.flush()"},{"line_number":85,"context_line":"                cmd_out \u003d stdout.readlines()"},{"line_number":86,"context_line":"                cmd_err \u003d stderr.readlines()"},{"line_number":87,"context_line":"                return_code \u003d self.__ssh.recv_exit_status()"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_a72086f9","line":84,"range":{"start_line":83,"start_character":16,"end_line":84,"end_character":29},"in_reply_to":"7aa08908_879947d3","updated":"2016-06-17 04:23:45.000000000","message":"Done","commit_id":"4717911b7865d49f2f3d177ed1f2bf433579ccbf"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"e83489e6187522946bcfab31caf592ab85eff8b0","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            if input_data:"},{"line_number":83,"context_line":"                stdin.write(input_data)"},{"line_number":84,"context_line":"                stdin.flush()"},{"line_number":85,"context_line":"                cmd_out \u003d stdout.readlines()"},{"line_number":86,"context_line":"                cmd_err \u003d stderr.readlines()"},{"line_number":87,"context_line":"                return_code \u003d self.__ssh.recv_exit_status()"},{"line_number":88,"context_line":"        except paramiko.SSHException:"},{"line_number":89,"context_line":"            LOG.error(_(\"Command execution failed at %s. Giving up\")"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_e735abdb","line":86,"range":{"start_line":85,"start_character":16,"end_line":86,"end_character":44},"updated":"2016-06-16 05:04:11.000000000","message":"both stdout and stderr are empty. it is getting hung here. you may want to check if channel is ready and then read. also not sure why stdout is returning empty here in 1 st place. can you pl debug this?","commit_id":"4717911b7865d49f2f3d177ed1f2bf433579ccbf"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"81ded6b644b8ba3884609a4f1b37be74f6133c4f","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            if input_data:"},{"line_number":83,"context_line":"                stdin.write(input_data)"},{"line_number":84,"context_line":"                stdin.flush()"},{"line_number":85,"context_line":"                cmd_out \u003d stdout.readlines()"},{"line_number":86,"context_line":"                cmd_err \u003d stderr.readlines()"},{"line_number":87,"context_line":"                return_code \u003d self.__ssh.recv_exit_status()"},{"line_number":88,"context_line":"        except paramiko.SSHException:"},{"line_number":89,"context_line":"            LOG.error(_(\"Command execution failed at %s. Giving up\")"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_87110a60","line":86,"range":{"start_line":85,"start_character":16,"end_line":86,"end_character":44},"in_reply_to":"7aa08908_e735abdb","updated":"2016-06-17 04:23:45.000000000","message":"Good catch as well as input :)\n\nI investigated this issue and come up with this point:\n\n\nWhen you start a background process from the shell on the server, it inherits references to the shell\u0027s standard streams. Unless you prevent this by redirecting these, or the process closes them itself (daemons will generally do this), the existence of the new process will cause sshd to wait indefinitely, since it will never see eof on the pipe connecting it to the (now defunct) shell process — because that pipe also connects it to your background process. \n\nRef: http://www.snailbook.com/faq/background-jobs.auto.html\n\nIn our case, we needs to explicitly shutdown the stdin channel.\n\nFixed now.","commit_id":"4717911b7865d49f2f3d177ed1f2bf433579ccbf"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"974d87af39b082ddad1028a8fc035beb5e66abd2","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"            endtime \u003d time.time() + self.__timeout"},{"line_number":93,"context_line":"            while not stdout.channel.eof_received:"},{"line_number":94,"context_line":"                time.sleep(1)"},{"line_number":95,"context_line":"                if time.time() \u003e endtime:"},{"line_number":96,"context_line":"                    LOG.debug(_(\"Timeout occurred, no stdout available.\"))"},{"line_number":97,"context_line":"                    stdout.channel.close()"}],"source_content_type":"text/x-python","patch_set":19,"id":"5a9d85d2_f4ff1c32","line":94,"range":{"start_line":94,"start_character":16,"end_line":94,"end_character":29},"updated":"2016-06-20 20:29:59.000000000","message":"using sleep to check stdout channel eof is not a good approach. we should be using channels inbuilt functions [1] and [2] to check if stdout is ready.\n\n[1] http://docs.paramiko.org/en/1.17/api/channel.html#paramiko.channel.Channel.exit_status_ready\n\n[2] http://docs.paramiko.org/en/1.17/api/channel.html#paramiko.channel.Channel.recv_ready","commit_id":"505de3ec326390d4fb43738d865d4353b88f870f"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"7b0cd9fdf42ec60cd27b985813015b6bd9a7b77e","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"            endtime \u003d time.time() + self.__timeout"},{"line_number":93,"context_line":"            while not stdout.channel.eof_received:"},{"line_number":94,"context_line":"                time.sleep(1)"},{"line_number":95,"context_line":"                if time.time() \u003e endtime:"},{"line_number":96,"context_line":"                    LOG.debug(_(\"Timeout occurred, no stdout available.\"))"},{"line_number":97,"context_line":"                    stdout.channel.close()"}],"source_content_type":"text/x-python","patch_set":19,"id":"3aaa91ec_ff726748","line":94,"range":{"start_line":94,"start_character":16,"end_line":94,"end_character":29},"in_reply_to":"3aaa91ec_e1d80520","updated":"2016-06-27 23:18:46.000000000","message":"thanks for trying this out. why do we need sleep intervals here? we can just check for the channel to be ready without a sleep interval.","commit_id":"505de3ec326390d4fb43738d865d4353b88f870f"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"61fbfbc06bc7dcfb29e502f267e8419f029db012","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"            endtime \u003d time.time() + self.__timeout"},{"line_number":93,"context_line":"            while not stdout.channel.eof_received:"},{"line_number":94,"context_line":"                time.sleep(1)"},{"line_number":95,"context_line":"                if time.time() \u003e endtime:"},{"line_number":96,"context_line":"                    LOG.debug(_(\"Timeout occurred, no stdout available.\"))"},{"line_number":97,"context_line":"                    stdout.channel.close()"}],"source_content_type":"text/x-python","patch_set":19,"id":"3aaa91ec_45080c92","line":94,"range":{"start_line":94,"start_character":16,"end_line":94,"end_character":29},"in_reply_to":"3aaa91ec_ff726748","updated":"2016-06-28 06:23:21.000000000","message":"Yes, we can use the channel ready but that would not make sure all data is sent by server in stdout buffer. \n\nActually what i am trying to achieve with while loop and sleep is\n  1. We wait till all data is present in stdout, by checking the stdout.channel.eof_received flag\n\n  2. If somehow (data is too big) it is stuck for long time then we should get out of it with some timeout.\n\nsleep is used to check the \"eof_received\" flag in intervals so that we wait enough to check whether stdout data is ready.\n \nI agree this is actually not needed but just making sure stdout is completely ready before we try to read data.","commit_id":"505de3ec326390d4fb43738d865d4353b88f870f"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"89450a9fbf74da704c8db7835cc015fe1f3de84b","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"            endtime \u003d time.time() + self.__timeout"},{"line_number":93,"context_line":"            while not stdout.channel.eof_received:"},{"line_number":94,"context_line":"                time.sleep(1)"},{"line_number":95,"context_line":"                if time.time() \u003e endtime:"},{"line_number":96,"context_line":"                    LOG.debug(_(\"Timeout occurred, no stdout available.\"))"},{"line_number":97,"context_line":"                    stdout.channel.close()"}],"source_content_type":"text/x-python","patch_set":19,"id":"3aaa91ec_e1d80520","line":94,"range":{"start_line":94,"start_character":16,"end_line":94,"end_character":29},"in_reply_to":"5a9d85d2_f4ff1c32","updated":"2016-06-22 11:14:00.000000000","message":"I have tried with exit_status_ready() \u0026 recv_ready() without sleep call (without polling logic) example code-[1].\n\nAnd from log [2] it is clear that these functions return status immediately without any wait.\n\nFrom their document and code (checked the source code), it is mentioned that these function will return the status immediately  without any polling or wait for remote process exit/data available. These fucntion can be used to implement the polling logic. So if we use those we still need to write polling logic with sleep as done in current code.  \n\n\nAnd we need polling, to not be in block state in stdout.readlines(),recv_exit_status() etc\n\n[1]: http://paste.openstack.org/show/521131/\n[2]: http://paste.openstack.org/show/521133/","commit_id":"505de3ec326390d4fb43738d865d4353b88f870f"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"7b0cd9fdf42ec60cd27b985813015b6bd9a7b77e","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    LOG.debug(_(\"Timeout occurred, no stdout available.\"))"},{"line_number":97,"context_line":"                    stdout.channel.close()"},{"line_number":98,"context_line":"                    break"},{"line_number":99,"context_line":"            cmd_out \u003d stdout.readlines()"},{"line_number":100,"context_line":"            cmd_err \u003d stderr.readlines()"},{"line_number":101,"context_line":"            return_code \u003d stdout.channel.recv_exit_status()"},{"line_number":102,"context_line":"        except paramiko.SSHException:"}],"source_content_type":"text/x-python","patch_set":19,"id":"3aaa91ec_3fba2fc1","line":99,"range":{"start_line":99,"start_character":29,"end_line":99,"end_character":38},"updated":"2016-06-27 23:18:46.000000000","message":"if this is going to be blocking call, we need not have the above while logic. it may only be required if we need to read the stdout realtime aggressively. I think for now, let us just use the readlines() to read the stdout output and we can later enhance it to read the output from channel realtime.","commit_id":"505de3ec326390d4fb43738d865d4353b88f870f"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"61fbfbc06bc7dcfb29e502f267e8419f029db012","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    LOG.debug(_(\"Timeout occurred, no stdout available.\"))"},{"line_number":97,"context_line":"                    stdout.channel.close()"},{"line_number":98,"context_line":"                    break"},{"line_number":99,"context_line":"            cmd_out \u003d stdout.readlines()"},{"line_number":100,"context_line":"            cmd_err \u003d stderr.readlines()"},{"line_number":101,"context_line":"            return_code \u003d stdout.channel.recv_exit_status()"},{"line_number":102,"context_line":"        except paramiko.SSHException:"}],"source_content_type":"text/x-python","patch_set":19,"id":"3aaa91ec_170917de","line":99,"range":{"start_line":99,"start_character":29,"end_line":99,"end_character":38},"in_reply_to":"3aaa91ec_3fba2fc1","updated":"2016-06-28 06:23:21.000000000","message":"Yes, you are right, readlines() is blocking. \n\nI agree with you that we can remove the above while loop and timeout logic and readlines() works fine for normal cases.\n\nBut in any case where server hangs on writing the data on stdout buffer file then readlines() will be hanged as it does not find EOF, we should have timeout logic. There is open issue for that[1]\n\nI am ok to handle that case later based on need. \n\nThanks for review and your direction. \n\n1- https://github.com/paramiko/paramiko/issues/109","commit_id":"505de3ec326390d4fb43738d865d4353b88f870f"}],"tacker/vm/mgmt_drivers/openwrt/openwrt.py":[{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"99825935296b7d3b4f6276ce4119947c6236b3a4","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        return device.get(\u0027mgmt_url\u0027, \u0027\u0027)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    @log.log"},{"line_number":53,"context_line":"    def _config_service(self, mgmt_ip_address, service, config):"},{"line_number":54,"context_line":"        user \u003d cfg.CONF.openwrt.user"},{"line_number":55,"context_line":"        password \u003d cfg.CONF.openwrt.password"},{"line_number":56,"context_line":"        commander \u003d cmd_executer.RemoteCommandExecutor("}],"source_content_type":"text/x-python","patch_set":4,"id":"3a57f1b5_8a959d41","line":53,"range":{"start_line":53,"start_character":56,"end_line":53,"end_character":62},"updated":"2016-02-10 00:24:40.000000000","message":"the method is not handling the service configuration part. this got missed?","commit_id":"f6b0d3b1ea15a9b756eea86b696f904f1035a610"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"3b982e8830c0a94f89111c1e7ce66dbb12639d8d","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        return device.get(\u0027mgmt_url\u0027, \u0027\u0027)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    @log.log"},{"line_number":53,"context_line":"    def _config_service(self, mgmt_ip_address, service, config):"},{"line_number":54,"context_line":"        user \u003d cfg.CONF.openwrt.user"},{"line_number":55,"context_line":"        password \u003d cfg.CONF.openwrt.password"},{"line_number":56,"context_line":"        commander \u003d cmd_executer.RemoteCommandExecutor("}],"source_content_type":"text/x-python","patch_set":4,"id":"3a57f1b5_762fe3a1","line":53,"range":{"start_line":53,"start_character":56,"end_line":53,"end_character":62},"in_reply_to":"3a57f1b5_8a959d41","updated":"2016-02-10 09:12:27.000000000","message":"Yes, We need to take care of that.","commit_id":"f6b0d3b1ea15a9b756eea86b696f904f1035a610"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"de3da90a989a579f19efc5665b340b08c6e0927a","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                                                       password,"},{"line_number":58,"context_line":"                                                       mgmt_ip_address)"},{"line_number":59,"context_line":"        cmd \u003d \"uci import %s; /etc/init.d/%s restart\" % (service, service)"},{"line_number":60,"context_line":"        commander.execute_command(cmd, input_data\u003dconfig)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    @log.log"},{"line_number":63,"context_line":"    def mgmt_call(self, plugin, context, device, kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_6030ace9","line":60,"range":{"start_line":60,"start_character":18,"end_line":60,"end_character":33},"updated":"2016-03-11 05:08:31.000000000","message":"It will be helpful to catch the exception raised from execute_command and throw Tacker specific exception something like: MgmtDriverException(\"VNF configuration failed\") as a warning.","commit_id":"8cc923bf264dd3fa2dd3902c58bba1293f62c5da"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"6d263dbe84b095a95f2f13d291fa9ff2265d7439","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            commander.execute_command(cmd, input_data\u003dconfig)"},{"line_number":63,"context_line":"        except Exception:"},{"line_number":64,"context_line":"            LOG.exception(_(\"Error while executing command on remote\"))"},{"line_number":65,"context_line":"            raise MgmtDriverException(\"VNF configuration failed\")"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    @log.log"},{"line_number":68,"context_line":"    def mgmt_call(self, plugin, context, device, kwargs):"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba0121b8_49bd3fb6","line":65,"range":{"start_line":65,"start_character":37,"end_line":65,"end_character":39},"updated":"2016-03-30 23:10:33.000000000","message":"message\u003d","commit_id":"31de8aef300db241ac2d86ab8a70bb27f3a93824"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"a3594ecb456067de6c51dccb2da6eda099802357","unresolved":false,"context_lines":[{"line_number":63,"context_line":"            commander.execute_command(cmd, input_data\u003dconfig)"},{"line_number":64,"context_line":"        except Exception as ex:"},{"line_number":65,"context_line":"            LOG.error(_(\"While executing command on remote: %s\"), ex)"},{"line_number":66,"context_line":"            raise MgmtDriverException(message\u003d\"VNF configuration failed\")"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    @log.log"},{"line_number":69,"context_line":"    def mgmt_call(self, plugin, context, device, kwargs):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a061dce_dc8406d4","line":66,"range":{"start_line":66,"start_character":18,"end_line":66,"end_character":37},"updated":"2016-04-08 02:50:01.000000000","message":"put the message into MgmtDriverException.message, and make it translatable. thanks","commit_id":"5551e19203323463a6787ded66b210e86a99e1c3"}],"tacker/vm/plugin.py":[{"author":{"_account_id":12455,"name":"bharaththiruveedula","email":"bharath_ves@hotmail.com","username":"bharaththiruveedula"},"change_message_id":"0c017ab798fbf3696ab67b0efc98bce7c467bcb5","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        try:"},{"line_number":231,"context_line":"            self.mgmt_call(context, device_dict, kwargs)"},{"line_number":232,"context_line":"        except MgmtDriverException:"},{"line_number":233,"context_line":"            LOG.error(_(\u0027VNF configuration failed\u0027))"},{"line_number":234,"context_line":"        except Exception:"},{"line_number":235,"context_line":"            LOG.exception(_(\u0027create_device_wait\u0027))"},{"line_number":236,"context_line":"            new_status \u003d constants.ERROR"}],"source_content_type":"text/x-python","patch_set":15,"id":"bab6814e_3eafae95","line":233,"updated":"2016-05-19 08:32:33.000000000","message":"If exception raises while configuring the \"VDU\", won\u0027t you change the status of the device?","commit_id":"92c59f30f2c3720bce7ff07a037aa152ca5809f0"},{"author":{"_account_id":13380,"name":"Sridhar Ramaswamy","email":"srics.r@gmail.com","username":"srics-r"},"change_message_id":"594bd599e58cee5cbfadd5ffa50ee45bf43bbcc7","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        try:"},{"line_number":231,"context_line":"            self.mgmt_call(context, device_dict, kwargs)"},{"line_number":232,"context_line":"        except MgmtDriverException:"},{"line_number":233,"context_line":"            LOG.error(_(\u0027VNF configuration failed\u0027))"},{"line_number":234,"context_line":"        except Exception:"},{"line_number":235,"context_line":"            LOG.exception(_(\u0027create_device_wait\u0027))"},{"line_number":236,"context_line":"            new_status \u003d constants.ERROR"}],"source_content_type":"text/x-python","patch_set":15,"id":"bab6814e_9098941d","line":233,"in_reply_to":"bab6814e_3aa8218d","updated":"2016-05-23 19:21:16.000000000","message":"Fair enough. Let\u0027s keep it then.","commit_id":"92c59f30f2c3720bce7ff07a037aa152ca5809f0"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"1dd989d2e1ee4196837db5061c4d9e453acfe7c5","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        try:"},{"line_number":231,"context_line":"            self.mgmt_call(context, device_dict, kwargs)"},{"line_number":232,"context_line":"        except MgmtDriverException:"},{"line_number":233,"context_line":"            LOG.error(_(\u0027VNF configuration failed\u0027))"},{"line_number":234,"context_line":"        except Exception:"},{"line_number":235,"context_line":"            LOG.exception(_(\u0027create_device_wait\u0027))"},{"line_number":236,"context_line":"            new_status \u003d constants.ERROR"}],"source_content_type":"text/x-python","patch_set":15,"id":"bab6814e_bd952888","line":233,"in_reply_to":"bab6814e_3aa8218d","updated":"2016-05-20 04:45:15.000000000","message":"Good catch.\nI missed that.\n\n@Sridhar\n\nAs in case of generic exception, new_status is set to ERROR(line #236), IMO same behaviour should be for MgmtDriverException too.","commit_id":"92c59f30f2c3720bce7ff07a037aa152ca5809f0"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"18877bc9e666867053e3f9f442a3f5621957f5e6","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        try:"},{"line_number":231,"context_line":"            self.mgmt_call(context, device_dict, kwargs)"},{"line_number":232,"context_line":"        except MgmtDriverException:"},{"line_number":233,"context_line":"            LOG.error(_(\u0027VNF configuration failed\u0027))"},{"line_number":234,"context_line":"        except Exception:"},{"line_number":235,"context_line":"            LOG.exception(_(\u0027create_device_wait\u0027))"},{"line_number":236,"context_line":"            new_status \u003d constants.ERROR"}],"source_content_type":"text/x-python","patch_set":15,"id":"9abb7d3a_3cd17dce","line":233,"in_reply_to":"bab6814e_3eafae95","updated":"2016-06-03 08:27:30.000000000","message":"Done","commit_id":"92c59f30f2c3720bce7ff07a037aa152ca5809f0"},{"author":{"_account_id":13380,"name":"Sridhar Ramaswamy","email":"srics.r@gmail.com","username":"srics-r"},"change_message_id":"dedf725548d4b877b09fb0fe101ca0867e0e4e08","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        try:"},{"line_number":231,"context_line":"            self.mgmt_call(context, device_dict, kwargs)"},{"line_number":232,"context_line":"        except MgmtDriverException:"},{"line_number":233,"context_line":"            LOG.error(_(\u0027VNF configuration failed\u0027))"},{"line_number":234,"context_line":"        except Exception:"},{"line_number":235,"context_line":"            LOG.exception(_(\u0027create_device_wait\u0027))"},{"line_number":236,"context_line":"            new_status \u003d constants.ERROR"}],"source_content_type":"text/x-python","patch_set":15,"id":"bab6814e_906e5eff","line":233,"in_reply_to":"bab6814e_3eafae95","updated":"2016-05-19 19:25:34.000000000","message":"I\u0027d suggest lets not introduce any new state change logic as part of this enhancement. We can take up overhauling status handling in a refactoring work item.","commit_id":"92c59f30f2c3720bce7ff07a037aa152ca5809f0"},{"author":{"_account_id":12455,"name":"bharaththiruveedula","email":"bharath_ves@hotmail.com","username":"bharaththiruveedula"},"change_message_id":"a6fc3773d01f5662655bef10ff402f20409464cf","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        try:"},{"line_number":231,"context_line":"            self.mgmt_call(context, device_dict, kwargs)"},{"line_number":232,"context_line":"        except MgmtDriverException:"},{"line_number":233,"context_line":"            LOG.error(_(\u0027VNF configuration failed\u0027))"},{"line_number":234,"context_line":"        except Exception:"},{"line_number":235,"context_line":"            LOG.exception(_(\u0027create_device_wait\u0027))"},{"line_number":236,"context_line":"            new_status \u003d constants.ERROR"}],"source_content_type":"text/x-python","patch_set":15,"id":"bab6814e_3aa8218d","line":233,"in_reply_to":"bab6814e_906e5eff","updated":"2016-05-20 02:07:51.000000000","message":"@sridhar, we are not introducing any new state here. Infact this  patch is missing to change the state to \u0027ERROR\u0027, if you can see the line L236","commit_id":"92c59f30f2c3720bce7ff07a037aa152ca5809f0"},{"author":{"_account_id":12455,"name":"bharaththiruveedula","email":"bharath_ves@hotmail.com","username":"bharaththiruveedula"},"change_message_id":"0c017ab798fbf3696ab67b0efc98bce7c467bcb5","unresolved":false,"context_lines":[{"line_number":306,"context_line":"                region_name\u003dregion_name)"},{"line_number":307,"context_line":"            self.mgmt_call(context, device_dict, kwargs)"},{"line_number":308,"context_line":"        except MgmtDriverException:"},{"line_number":309,"context_line":"            LOG.error(_(\u0027VNF configuration failed\u0027))"},{"line_number":310,"context_line":"        except Exception:"},{"line_number":311,"context_line":"            LOG.exception(_(\u0027_update_device_wait\u0027))"},{"line_number":312,"context_line":"            new_status \u003d constants.ERROR"}],"source_content_type":"text/x-python","patch_set":15,"id":"bab6814e_b9a9f87d","line":309,"updated":"2016-05-19 08:32:33.000000000","message":"If exception raises while configuring the \"VDU\", won\u0027t you change the status of the device?","commit_id":"92c59f30f2c3720bce7ff07a037aa152ca5809f0"},{"author":{"_account_id":12455,"name":"bharaththiruveedula","email":"bharath_ves@hotmail.com","username":"bharaththiruveedula"},"change_message_id":"a6fc3773d01f5662655bef10ff402f20409464cf","unresolved":false,"context_lines":[{"line_number":306,"context_line":"                region_name\u003dregion_name)"},{"line_number":307,"context_line":"            self.mgmt_call(context, device_dict, kwargs)"},{"line_number":308,"context_line":"        except MgmtDriverException:"},{"line_number":309,"context_line":"            LOG.error(_(\u0027VNF configuration failed\u0027))"},{"line_number":310,"context_line":"        except Exception:"},{"line_number":311,"context_line":"            LOG.exception(_(\u0027_update_device_wait\u0027))"},{"line_number":312,"context_line":"            new_status \u003d constants.ERROR"}],"source_content_type":"text/x-python","patch_set":15,"id":"bab6814e_fa9a196d","line":309,"in_reply_to":"bab6814e_105a6e4f","updated":"2016-05-20 02:07:51.000000000","message":"@sridhar, we are not introducing any new state here. Infact this  patch is missing to change the state to \u0027ERROR\u0027, if you can see the line L312","commit_id":"92c59f30f2c3720bce7ff07a037aa152ca5809f0"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"18877bc9e666867053e3f9f442a3f5621957f5e6","unresolved":false,"context_lines":[{"line_number":306,"context_line":"                region_name\u003dregion_name)"},{"line_number":307,"context_line":"            self.mgmt_call(context, device_dict, kwargs)"},{"line_number":308,"context_line":"        except MgmtDriverException:"},{"line_number":309,"context_line":"            LOG.error(_(\u0027VNF configuration failed\u0027))"},{"line_number":310,"context_line":"        except Exception:"},{"line_number":311,"context_line":"            LOG.exception(_(\u0027_update_device_wait\u0027))"},{"line_number":312,"context_line":"            new_status \u003d constants.ERROR"}],"source_content_type":"text/x-python","patch_set":15,"id":"9abb7d3a_1cd479bb","line":309,"in_reply_to":"bab6814e_b9a9f87d","updated":"2016-06-03 08:27:30.000000000","message":"Done","commit_id":"92c59f30f2c3720bce7ff07a037aa152ca5809f0"},{"author":{"_account_id":13380,"name":"Sridhar Ramaswamy","email":"srics.r@gmail.com","username":"srics-r"},"change_message_id":"dedf725548d4b877b09fb0fe101ca0867e0e4e08","unresolved":false,"context_lines":[{"line_number":306,"context_line":"                region_name\u003dregion_name)"},{"line_number":307,"context_line":"            self.mgmt_call(context, device_dict, kwargs)"},{"line_number":308,"context_line":"        except MgmtDriverException:"},{"line_number":309,"context_line":"            LOG.error(_(\u0027VNF configuration failed\u0027))"},{"line_number":310,"context_line":"        except Exception:"},{"line_number":311,"context_line":"            LOG.exception(_(\u0027_update_device_wait\u0027))"},{"line_number":312,"context_line":"            new_status \u003d constants.ERROR"}],"source_content_type":"text/x-python","patch_set":15,"id":"bab6814e_105a6e4f","line":309,"in_reply_to":"bab6814e_b9a9f87d","updated":"2016-05-19 19:25:34.000000000","message":"Same response as above. Let\u0027s take up overhauling status handling in a refactoring work item.","commit_id":"92c59f30f2c3720bce7ff07a037aa152ca5809f0"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"e83489e6187522946bcfab31caf592ab85eff8b0","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            new_status \u003d constants.ERROR"},{"line_number":238,"context_line":"            self.set_device_error_status_reason(context, device_id,"},{"line_number":239,"context_line":"            \u0027Unable to configure VDU\u0027)"},{"line_number":240,"context_line":"        except Exception:"},{"line_number":241,"context_line":"            LOG.exception(_(\u0027create_device_wait\u0027))"},{"line_number":242,"context_line":"            new_status \u003d constants.ERROR"},{"line_number":243,"context_line":"            self.set_device_error_status_reason(context, device_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_3737654e","line":240,"range":{"start_line":240,"start_character":15,"end_line":240,"end_character":24},"updated":"2016-06-16 05:04:11.000000000","message":"do we need this generic Exception? I think it is redundant.","commit_id":"4717911b7865d49f2f3d177ed1f2bf433579ccbf"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"0f1f5a3f8dde2ff795529d468b3618232b99c2ca","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            new_status \u003d constants.ERROR"},{"line_number":238,"context_line":"            self.set_device_error_status_reason(context, device_id,"},{"line_number":239,"context_line":"            \u0027Unable to configure VDU\u0027)"},{"line_number":240,"context_line":"        except Exception:"},{"line_number":241,"context_line":"            LOG.exception(_(\u0027create_device_wait\u0027))"},{"line_number":242,"context_line":"            new_status \u003d constants.ERROR"},{"line_number":243,"context_line":"            self.set_device_error_status_reason(context, device_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_4d62a317","line":240,"range":{"start_line":240,"start_character":15,"end_line":240,"end_character":24},"in_reply_to":"7aa08908_3737654e","updated":"2016-06-17 05:01:24.000000000","message":"In mgmnt_call, MgmtDriverException can be raised by _config_service() only.  So IMO we should keep generic Exception too.\n\nPlease suggest","commit_id":"4717911b7865d49f2f3d177ed1f2bf433579ccbf"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"e9abb85f9145c99618a1a8d11b8b322cb2cbec27","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            new_status \u003d constants.ERROR"},{"line_number":238,"context_line":"            self.set_device_error_status_reason(context, device_id,"},{"line_number":239,"context_line":"            \u0027Unable to configure VDU\u0027)"},{"line_number":240,"context_line":"        except Exception:"},{"line_number":241,"context_line":"            LOG.exception(_(\u0027create_device_wait\u0027))"},{"line_number":242,"context_line":"            new_status \u003d constants.ERROR"},{"line_number":243,"context_line":"            self.set_device_error_status_reason(context, device_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_9fd5d2b8","line":240,"range":{"start_line":240,"start_character":15,"end_line":240,"end_character":24},"in_reply_to":"7aa08908_4d62a317","updated":"2016-06-17 05:36:27.000000000","message":"Yes, but AFAIK, except for _config_service, there is no other piece of code in openwrt.py that can throw an Exception as it stands today. In case, they do throw an Exception, it needs to be gracefully handled in the driver itself (can be subclasses of MgmtDriverException). What do you think?","commit_id":"4717911b7865d49f2f3d177ed1f2bf433579ccbf"},{"author":{"_account_id":18955,"name":"dharmendra","email":"dharmendra.kushwaha@gmail.com","username":"dharmendra"},"change_message_id":"e98718cb9eddb058cc1f794150e992ec80b5f6e3","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            new_status \u003d constants.ERROR"},{"line_number":238,"context_line":"            self.set_device_error_status_reason(context, device_id,"},{"line_number":239,"context_line":"            \u0027Unable to configure VDU\u0027)"},{"line_number":240,"context_line":"        except Exception:"},{"line_number":241,"context_line":"            LOG.exception(_(\u0027create_device_wait\u0027))"},{"line_number":242,"context_line":"            new_status \u003d constants.ERROR"},{"line_number":243,"context_line":"            self.set_device_error_status_reason(context, device_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_e2455943","line":240,"range":{"start_line":240,"start_character":15,"end_line":240,"end_character":24},"in_reply_to":"7aa08908_9fd5d2b8","updated":"2016-06-17 05:58:53.000000000","message":"Yes, It is a good approach. Thanks.","commit_id":"4717911b7865d49f2f3d177ed1f2bf433579ccbf"},{"author":{"_account_id":13485,"name":"Sripriya Seetharam","email":"sseetha@brocade.com","username":"Sripriya"},"change_message_id":"e83489e6187522946bcfab31caf592ab85eff8b0","unresolved":false,"context_lines":[{"line_number":318,"context_line":"            new_status \u003d constants.ERROR"},{"line_number":319,"context_line":"            self.set_device_error_status_reason(context, device_dict[\u0027id\u0027],"},{"line_number":320,"context_line":"                                                six.text_type(e))"},{"line_number":321,"context_line":"        except Exception as e:"},{"line_number":322,"context_line":"            LOG.exception(_(\u0027_update_device_wait\u0027))"},{"line_number":323,"context_line":"            new_status \u003d constants.ERROR"},{"line_number":324,"context_line":"            self.set_device_error_status_reason(context, device_dict[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_1e2e4efa","line":321,"range":{"start_line":321,"start_character":15,"end_line":321,"end_character":24},"updated":"2016-06-16 05:04:11.000000000","message":"same as L240 comment","commit_id":"4717911b7865d49f2f3d177ed1f2bf433579ccbf"}]}
