)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11076,"name":"Shivanand Tendulker","email":"stendulker@gmail.com","username":"stendulker"},"change_message_id":"7896334eeef4cfa42cf60d7b2b27f6f17d7b6271","unresolved":false,"context_lines":[{"line_number":7,"context_line":"set-console-mode should validate terminal command"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now, node-set-console-mode run with error but no any"},{"line_number":10,"context_line":"message from command client if shellinabox has not been"},{"line_number":11,"context_line":"installed.  This change add execution access check for the"},{"line_number":12,"context_line":"terminal command."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"ba8a016a_2a79da2f","line":10,"updated":"2015-11-23 05:55:43.000000000","message":"This message looks confusing.","commit_id":"ea071289c8f973dfd58c722625a02abc890bb0ed"}],"ironic/common/exception.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"02408b2493d67e4dac6dc6e525d412de162fd349","unresolved":false,"context_lines":[{"line_number":263,"context_line":"    _msg_fmt \u003d _(\"Port %(port)s could not be found.\")"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"class NoCommand(NotFound):"},{"line_number":267,"context_line":"    _msg_fmt \u003d _(\"Command %(cmd)s can not be found\")"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a2ca52d_839d415b","line":266,"updated":"2015-10-15 09:26:33.000000000","message":"IMO better CommandNotFound","commit_id":"79effe106ca1ff0dab63d2ec6297b4512559ece5"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"6918a572426fc246c759b226273983a3ae1341e5","unresolved":false,"context_lines":[{"line_number":263,"context_line":"    _msg_fmt \u003d _(\"Port %(port)s could not be found.\")"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"class NoCommand(NotFound):"},{"line_number":267,"context_line":"    _msg_fmt \u003d _(\"Command %(cmd)s can not be found\")"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a2ca52d_f95626d1","line":266,"in_reply_to":"5a2ca52d_839d415b","updated":"2015-10-15 09:50:26.000000000","message":"There is ConsoleSubprocessFailed exception, why not use it?","commit_id":"79effe106ca1ff0dab63d2ec6297b4512559ece5"}],"ironic/common/utils.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"02408b2493d67e4dac6dc6e525d412de162fd349","unresolved":false,"context_lines":[{"line_number":691,"context_line":"def which(cmd):"},{"line_number":692,"context_line":"    \"\"\"Check that the command is able to execute."},{"line_number":693,"context_line":""},{"line_number":694,"context_line":"    :param cmd: Command to check"},{"line_number":695,"context_line":"    \"\"\""},{"line_number":696,"context_line":"    def is_exe(filepath):"},{"line_number":697,"context_line":"        return os.path.isfile(filepath) and os.access(filepath, os.X_OK)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a2ca52d_83eb01b0","line":694,"updated":"2015-10-15 09:26:33.000000000","message":"Missing returns","commit_id":"79effe106ca1ff0dab63d2ec6297b4512559ece5"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"02408b2493d67e4dac6dc6e525d412de162fd349","unresolved":false,"context_lines":[{"line_number":701,"context_line":"        if is_exe(cmd):"},{"line_number":702,"context_line":"            return cmd"},{"line_number":703,"context_line":"    else:"},{"line_number":704,"context_line":"        for path in os.environ[\"PATH\"].split(os.pathsep):"},{"line_number":705,"context_line":"            path \u003d path.strip(\u0027\"\u0027)"},{"line_number":706,"context_line":"            exe_file \u003d os.path.join(path, cmd)"},{"line_number":707,"context_line":"            if is_exe(exe_file):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a2ca52d_fee84c12","line":704,"updated":"2015-10-15 09:26:33.000000000","message":"Conductor is long-running process, and PATH can be changed after it\u0027s started. It\u0027s not a big problem, but there is nice bash \"type\" command http://linuxcommand.org/lc3_man_pages/typeh.html , what about to use it?","commit_id":"79effe106ca1ff0dab63d2ec6297b4512559ece5"},{"author":{"_account_id":11042,"name":"chenglch","email":"chenglch@cn.ibm.com","username":"chenglch"},"change_message_id":"f9439f860c231e28cb0cd0f6226649723b545ffb","unresolved":false,"context_lines":[{"line_number":701,"context_line":"        if is_exe(cmd):"},{"line_number":702,"context_line":"            return cmd"},{"line_number":703,"context_line":"    else:"},{"line_number":704,"context_line":"        for path in os.environ[\"PATH\"].split(os.pathsep):"},{"line_number":705,"context_line":"            path \u003d path.strip(\u0027\"\u0027)"},{"line_number":706,"context_line":"            exe_file \u003d os.path.join(path, cmd)"},{"line_number":707,"context_line":"            if is_exe(exe_file):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a2ca52d_c9b80578","line":704,"in_reply_to":"5a2ca52d_fee84c12","updated":"2015-10-16 06:52:43.000000000","message":"Thanks very much for this advice, but I have some concerns to execute a bash \u0027type\u0027 command:\n\n1. \u0027type\u0027 command may not support the other os platform as this method may be used as a common method.\n\n2. \u0027type\u0027 will check the bash builtin command, but in most cases, we hope to check the program file in the daemon process.\n\n3. I think execute a command in a subprocess need more system resource.","commit_id":"79effe106ca1ff0dab63d2ec6297b4512559ece5"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"02408b2493d67e4dac6dc6e525d412de162fd349","unresolved":false,"context_lines":[{"line_number":707,"context_line":"            if is_exe(exe_file):"},{"line_number":708,"context_line":"                return exe_file"},{"line_number":709,"context_line":""},{"line_number":710,"context_line":"    return None"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a2ca52d_03d8511c","line":710,"updated":"2015-10-15 09:26:33.000000000","message":"This line is not needed.","commit_id":"79effe106ca1ff0dab63d2ec6297b4512559ece5"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"b173c60a92d6671ffd9f1a20e37cd145b3614057","unresolved":false,"context_lines":[{"line_number":688,"context_line":"    )"},{"line_number":689,"context_line":""},{"line_number":690,"context_line":""},{"line_number":691,"context_line":"def which(cmd):"},{"line_number":692,"context_line":"    \"\"\"Locate a program."},{"line_number":693,"context_line":""},{"line_number":694,"context_line":"    :param cmd: command path to check."}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_42689c87","line":691,"updated":"2015-10-20 06:30:46.000000000","message":"Is this input is a command name or a with full path?","commit_id":"cbf86631fb3fd9cb188e00bb39ef0d0c1c6adedc"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"b173c60a92d6671ffd9f1a20e37cd145b3614057","unresolved":false,"context_lines":[{"line_number":691,"context_line":"def which(cmd):"},{"line_number":692,"context_line":"    \"\"\"Locate a program."},{"line_number":693,"context_line":""},{"line_number":694,"context_line":"    :param cmd: command path to check."},{"line_number":695,"context_line":"    :returns: the absolute path of the program file."},{"line_number":696,"context_line":"    :raises: InvalidParameterValue when the command can not be found."},{"line_number":697,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_c2126c09","line":694,"updated":"2015-10-20 06:30:46.000000000","message":"concern: if this is single program name or the input is a full path for a program? It is better that we clarify here please.","commit_id":"cbf86631fb3fd9cb188e00bb39ef0d0c1c6adedc"},{"author":{"_account_id":11042,"name":"chenglch","email":"chenglch@cn.ibm.com","username":"chenglch"},"change_message_id":"60cb43104e7ea95c8078e0d7839c4fee7eaddfdb","unresolved":false,"context_lines":[{"line_number":691,"context_line":"def which(cmd):"},{"line_number":692,"context_line":"    \"\"\"Locate a program."},{"line_number":693,"context_line":""},{"line_number":694,"context_line":"    :param cmd: command path to check."},{"line_number":695,"context_line":"    :returns: the absolute path of the program file."},{"line_number":696,"context_line":"    :raises: InvalidParameterValue when the command can not be found."},{"line_number":697,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_5fe03cfa","line":694,"in_reply_to":"3a29b11f_c2126c09","updated":"2015-10-21 06:31:31.000000000","message":"Both the single program name and a full path for a program.\nI will add it in the next patch.","commit_id":"cbf86631fb3fd9cb188e00bb39ef0d0c1c6adedc"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"b173c60a92d6671ffd9f1a20e37cd145b3614057","unresolved":false,"context_lines":[{"line_number":709,"context_line":"            exe_file \u003d os.path.join(path, cmd)"},{"line_number":710,"context_line":"            if is_exe(exe_file):"},{"line_number":711,"context_line":"                return exe_file"},{"line_number":712,"context_line":"    raise exception.InvalidParameterValue("},{"line_number":713,"context_line":"        _(\"Command %(cmd)s can not be found\") % {"},{"line_number":714,"context_line":"            \u0027cmd\u0027: cmd})"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_224a40c6","line":712,"updated":"2015-10-20 06:30:46.000000000","message":"how about exception.PathNotFound?","commit_id":"cbf86631fb3fd9cb188e00bb39ef0d0c1c6adedc"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"b173c60a92d6671ffd9f1a20e37cd145b3614057","unresolved":false,"context_lines":[{"line_number":710,"context_line":"            if is_exe(exe_file):"},{"line_number":711,"context_line":"                return exe_file"},{"line_number":712,"context_line":"    raise exception.InvalidParameterValue("},{"line_number":713,"context_line":"        _(\"Command %(cmd)s can not be found\") % {"},{"line_number":714,"context_line":"            \u0027cmd\u0027: cmd})"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_428c1c7f","line":713,"updated":"2015-10-20 06:30:46.000000000","message":"how about the below message?\n\nCommand %(cmd)s can not be found in path %(path)s.","commit_id":"cbf86631fb3fd9cb188e00bb39ef0d0c1c6adedc"},{"author":{"_account_id":11042,"name":"chenglch","email":"chenglch@cn.ibm.com","username":"chenglch"},"change_message_id":"60cb43104e7ea95c8078e0d7839c4fee7eaddfdb","unresolved":false,"context_lines":[{"line_number":710,"context_line":"            if is_exe(exe_file):"},{"line_number":711,"context_line":"                return exe_file"},{"line_number":712,"context_line":"    raise exception.InvalidParameterValue("},{"line_number":713,"context_line":"        _(\"Command %(cmd)s can not be found\") % {"},{"line_number":714,"context_line":"            \u0027cmd\u0027: cmd})"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_bf6ab07f","line":713,"in_reply_to":"3a29b11f_428c1c7f","updated":"2015-10-21 06:31:31.000000000","message":"Actually I hope this method is a little like the which command, if the command is not a full path name, this method will search the PATH env dict which is not a path string.","commit_id":"cbf86631fb3fd9cb188e00bb39ef0d0c1c6adedc"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"e5cb0e78441210f466f52f0a675b8ac52d351bb7","unresolved":false,"context_lines":[{"line_number":709,"context_line":"            exe_file \u003d os.path.join(path, cmd)"},{"line_number":710,"context_line":"            if is_exe(exe_file):"},{"line_number":711,"context_line":"                return exe_file"},{"line_number":712,"context_line":"    raise exception.CommandNotFound(cmd\u003dcmd)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a29b11f_9e4d33c6","line":712,"updated":"2015-10-22 12:25:00.000000000","message":"Discussing this on IRC with dtantsur, and we were wondering why you were implementing your own which function, when you could just call out to the system which function for this check, or even simpler just try calling the command your checking with a \"--help\" argument and see if its successful?","commit_id":"94475fd3b32600b2d15325d8f19bf2aa1f28f591"},{"author":{"_account_id":11042,"name":"chenglch","email":"chenglch@cn.ibm.com","username":"chenglch"},"change_message_id":"3c678c7bbf8dec1a86383248424bfb9c94dbe320","unresolved":false,"context_lines":[{"line_number":709,"context_line":"            exe_file \u003d os.path.join(path, cmd)"},{"line_number":710,"context_line":"            if is_exe(exe_file):"},{"line_number":711,"context_line":"                return exe_file"},{"line_number":712,"context_line":"    raise exception.CommandNotFound(cmd\u003dcmd)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a29b11f_26bddbd7","line":712,"in_reply_to":"3a29b11f_9e4d33c6","updated":"2015-10-23 01:55:59.000000000","message":"As system which or check with \u0027--help\u0027 may fork a process, I worry about the code’s efficiency in the validate method which will be called every time while starting the console.\n\nMaybe implementing own which function is not a good way, I will try to check with \u0027shellinaboxd --help\u0027 instead.\n\nThanks.","commit_id":"94475fd3b32600b2d15325d8f19bf2aa1f28f591"}],"ironic/conductor/manager.py":[{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"6918a572426fc246c759b226273983a3ae1341e5","unresolved":false,"context_lines":[{"line_number":1676,"context_line":"                task.release_resources()"},{"line_number":1677,"context_line":"            else:"},{"line_number":1678,"context_line":"                node.last_error \u003d None"},{"line_number":1679,"context_line":"                node.save()"},{"line_number":1680,"context_line":"                task.spawn_after(self._spawn_worker,"},{"line_number":1681,"context_line":"                                 self._set_console_mode, task, enabled)"},{"line_number":1682,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a2ca52d_99ce12b3","line":1679,"updated":"2015-10-15 09:50:26.000000000","message":"I\u0027d prefer this new check to be added only here, before spawn_after, as validate usually just checks that all needed parameters are present in driver_info.","commit_id":"79effe106ca1ff0dab63d2ec6297b4512559ece5"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"604838f94f8f556e9962024310e880a14d4e217d","unresolved":false,"context_lines":[{"line_number":1676,"context_line":"                task.release_resources()"},{"line_number":1677,"context_line":"            else:"},{"line_number":1678,"context_line":"                node.last_error \u003d None"},{"line_number":1679,"context_line":"                node.save()"},{"line_number":1680,"context_line":"                task.spawn_after(self._spawn_worker,"},{"line_number":1681,"context_line":"                                 self._set_console_mode, task, enabled)"},{"line_number":1682,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a2ca52d_b9642e22","line":1679,"in_reply_to":"5a2ca52d_99ce12b3","updated":"2015-10-15 10:00:47.000000000","message":"Or maybe you could add it to validate as you do now and throw InvalidParameterValue instead of new exception, as this console command seems to be config parameter.","commit_id":"79effe106ca1ff0dab63d2ec6297b4512559ece5"}],"ironic/drivers/modules/console_utils.py":[{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"332c08803fd4d413b849b8a7faeed109ece4c592","unresolved":false,"context_lines":[{"line_number":146,"context_line":"    \"\"\"Indicates whether the shellinabox is ready.\"\"\""},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    if not utils.which(CONF.console.terminal):"},{"line_number":149,"context_line":"        raise exception.InvalidParameterValue("},{"line_number":150,"context_line":"            _(\"Command %(cmd)s can not be found\") % {"},{"line_number":151,"context_line":"                \u0027cmd\u0027: CONF.console.terminal})"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_b741e53b","line":149,"updated":"2015-10-19 09:13:45.000000000","message":"InvalidParameterValue seems weird, maybe NotFound or some new exception here?","commit_id":"acebe3d69d93f79b7e5cd9b77eaee347f24a2443"},{"author":{"_account_id":11042,"name":"chenglch","email":"chenglch@cn.ibm.com","username":"chenglch"},"change_message_id":"06fc1b94ada20bdd909e66260b635608dd37947b","unresolved":false,"context_lines":[{"line_number":146,"context_line":"    \"\"\"Indicates whether the shellinabox is ready.\"\"\""},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    if not utils.which(CONF.console.terminal):"},{"line_number":149,"context_line":"        raise exception.InvalidParameterValue("},{"line_number":150,"context_line":"            _(\"Command %(cmd)s can not be found\") % {"},{"line_number":151,"context_line":"                \u0027cmd\u0027: CONF.console.terminal})"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_37ae0086","line":149,"in_reply_to":"3a29b11f_b741e53b","updated":"2015-10-20 05:49:48.000000000","message":"Thanks Zhenguo, in the first patch, Vladyslav Drok has a little concern about where to validate this command, as console is a little different from the other driver which validate the configuration in the __init__ method, so I think InvalidParameterValue exception is a choice.","commit_id":"acebe3d69d93f79b7e5cd9b77eaee347f24a2443"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"b173c60a92d6671ffd9f1a20e37cd145b3614057","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        raise exception.PasswordFileFailedToCreate(error\u003de)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"def check_shellinabox_ready():"},{"line_number":146,"context_line":"    \"\"\"Indicates whether the shellinabox is ready.\"\"\""},{"line_number":147,"context_line":"    utils.which(CONF.console.terminal)"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_c2b34ce8","line":145,"updated":"2015-10-20 06:30:46.000000000","message":"Just check if command is ready, no exception raised if can not find command in path? If yes, can we add string to show the exceptions which will be raised from this call?","commit_id":"cbf86631fb3fd9cb188e00bb39ef0d0c1c6adedc"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"2a78da54dce8906071b0e4cb9638dd165ba2f93a","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"shellinabox_ready \u003d False"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def _get_console_pid_dir():"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a26ad4f_f5cad0a0","line":64,"updated":"2015-10-29 06:55:45.000000000","message":"concern: we can not assume it is not ready for all case, such as we run shellinabox, but the conductor is restarted for some reason, I understand the shellinabox process is still working as well, so should we need to sync this flat after conductor is restarted? correct me if wrong understanding here, thanks","commit_id":"1dc7652ba5b6fb3b3fcd9566b0cc9d4b43291743"},{"author":{"_account_id":11042,"name":"chenglch","email":"chenglch@cn.ibm.com","username":"chenglch"},"change_message_id":"3eb262eda8929cae236847bd9adbe7e85c0ac036","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"shellinabox_ready \u003d False"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def _get_console_pid_dir():"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa80f949_23e59c08","line":64,"in_reply_to":"1a26ad4f_f5cad0a0","updated":"2015-11-04 02:28:59.000000000","message":"This global help variable just indicates whether the shellinabox command can be executed or not during the lifecycle of the conductor process, as console driver do not need to fork a process to verify the command every time when the validate method is called.\n\nI think there is no need to sync the state of this variable. If conductor is restarted, when the console api is called, driver.condole.validate() method will check and set this variable again.","commit_id":"1dc7652ba5b6fb3b3fcd9566b0cc9d4b43291743"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"0e65db5f1aea1eab955a040dc841edc9229d9e43","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"shellinabox_ready \u003d False"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def _get_console_pid_dir():"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa80f949_75a03bf5","line":64,"in_reply_to":"fa80f949_23e59c08","updated":"2015-11-04 03:05:11.000000000","message":"ok, got it, thanks for the response.","commit_id":"1dc7652ba5b6fb3b3fcd9566b0cc9d4b43291743"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"61a17fc4f209538b8d5586353c0234e7fe551224","unresolved":false,"context_lines":[{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    exp_str \u003d _(\"Invalid terminal parameter in console section of the \""},{"line_number":159,"context_line":"                \"configuration file. Command %(cmd)s can not be found.\")"},{"line_number":160,"context_line":"    cmd \u003d \u0027type \u0027 + CONF.console.terminal"},{"line_number":161,"context_line":"    try:"},{"line_number":162,"context_line":"        with open(os.devnull, \u0027wb\u0027) as nullfile:"},{"line_number":163,"context_line":"            subprocess.check_call(cmd, stdout\u003dnullfile, stderr\u003dnullfile,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa80f949_39385ed3","line":160,"updated":"2015-11-05 14:29:11.000000000","message":"type is a bash builtin I\u0027m not sure we should be using shell specific commands, I would prefer this be implemented using either which, or by calling out to shellinaboxd --version or -h. Something like: \n\n        with open(os.devnull, \u0027wb\u0027) as null:\n            subprocess.check_call((CONF.console.terminal, \u0027-h\u0027,), \n                                  stderr\u003dnull, stdout\u003dnull)","commit_id":"1dc7652ba5b6fb3b3fcd9566b0cc9d4b43291743"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"8af85efeeb619a05adde34b9d00b70a4d18a7c43","unresolved":false,"context_lines":[{"line_number":160,"context_line":"    :raises: InvalidParameterValue when the wrong terminal parameter in the"},{"line_number":161,"context_line":"             console section of the configuration file is specified."},{"line_number":162,"context_line":"    \"\"\""},{"line_number":163,"context_line":"    global shellinabox_ready"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    if shellinabox_ready:"},{"line_number":166,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba8a016a_d2048e16","line":163,"updated":"2015-11-17 03:19:26.000000000","message":"I have concern about such global level var, if it working with multi console opening for different servers at the same time?","commit_id":"d521572a8a4e05acfb63dc4f7876add71fa09567"},{"author":{"_account_id":11042,"name":"chenglch","email":"chenglch@cn.ibm.com","username":"chenglch"},"change_message_id":"01729f7da807844e27357e208d546fccafb63689","unresolved":false,"context_lines":[{"line_number":160,"context_line":"    :raises: InvalidParameterValue when the wrong terminal parameter in the"},{"line_number":161,"context_line":"             console section of the configuration file is specified."},{"line_number":162,"context_line":"    \"\"\""},{"line_number":163,"context_line":"    global shellinabox_ready"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    if shellinabox_ready:"},{"line_number":166,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba8a016a_127536f8","line":163,"in_reply_to":"ba8a016a_d2048e16","updated":"2015-11-17 03:56:01.000000000","message":"In this case ,the global variable do not work well ( check multiple times) but the result is right. If the admin is installing the shellinabox at the same time, some results may be wrong.","commit_id":"d521572a8a4e05acfb63dc4f7876add71fa09567"}],"ironic/drivers/modules/ipminative.py":[{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"b173c60a92d6671ffd9f1a20e37cd145b3614057","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        :raises: MissingParameterValue when required IPMI credentials or"},{"line_number":572,"context_line":"            the IPMI terminal port are missing"},{"line_number":573,"context_line":"        :raises: InvalidParameterValue when the IPMI terminal port is not"},{"line_number":574,"context_line":"                an integer."},{"line_number":575,"context_line":"        \"\"\""},{"line_number":576,"context_line":"        console_utils.check_shellinabox_ready()"},{"line_number":577,"context_line":"        driver_info \u003d _parse_driver_info(task.node)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_e22be8e9","line":574,"updated":"2015-10-20 06:30:46.000000000","message":"Should we add new case into raises to cover shellinabox command can not be found case?","commit_id":"cbf86631fb3fd9cb188e00bb39ef0d0c1c6adedc"},{"author":{"_account_id":11042,"name":"chenglch","email":"chenglch@cn.ibm.com","username":"chenglch"},"change_message_id":"75625f99a35b0cd5ad2d619de37725af93fb0c51","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        :raises: MissingParameterValue when required IPMI credentials or"},{"line_number":572,"context_line":"            the IPMI terminal port are missing"},{"line_number":573,"context_line":"        :raises: InvalidParameterValue when the IPMI terminal port is not"},{"line_number":574,"context_line":"                an integer."},{"line_number":575,"context_line":"        \"\"\""},{"line_number":576,"context_line":"        console_utils.check_shellinabox_ready()"},{"line_number":577,"context_line":"        driver_info \u003d _parse_driver_info(task.node)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_440421bf","line":574,"in_reply_to":"3a29b11f_e22be8e9","updated":"2015-10-20 10:09:19.000000000","message":"As console is a little different from the other dirver, shellinabox config command can not be validate in the driver __init__ method. The InvalidParameterValue can be looked as a invalid config parameter when the command can not be found, so we do not need the additional exception both in the driver method and the manager method, does this reasonable?","commit_id":"cbf86631fb3fd9cb188e00bb39ef0d0c1c6adedc"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"2ac94c3197ce756d661803f74bbaf039746f78cf","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        :raises: MissingParameterValue when required IPMI credentials or"},{"line_number":572,"context_line":"            the IPMI terminal port are missing"},{"line_number":573,"context_line":"        :raises: InvalidParameterValue when the IPMI terminal port is not"},{"line_number":574,"context_line":"                an integer."},{"line_number":575,"context_line":"        \"\"\""},{"line_number":576,"context_line":"        console_utils.check_shellinabox_ready()"},{"line_number":577,"context_line":"        driver_info \u003d _parse_driver_info(task.node)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a29b11f_ab38cfd3","line":574,"updated":"2015-10-23 07:53:13.000000000","message":"we should cover the new case in raises string - \"or shellinabox command can not find.\"","commit_id":"94475fd3b32600b2d15325d8f19bf2aa1f28f591"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"2a78da54dce8906071b0e4cb9638dd165ba2f93a","unresolved":false,"context_lines":[{"line_number":572,"context_line":"            the IPMI terminal port are missing"},{"line_number":573,"context_line":"        :raises: InvalidParameterValue when the IPMI terminal port is not"},{"line_number":574,"context_line":"            an integer or the terminal parameter in the console section of"},{"line_number":575,"context_line":"            the configuration file is invalid."},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"        \"\"\""},{"line_number":578,"context_line":"        console_utils.check_shellinabox_ready()"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a26ad4f_350608cf","line":575,"updated":"2015-10-29 06:55:45.000000000","message":"thanks for the update","commit_id":"1dc7652ba5b6fb3b3fcd9566b0cc9d4b43291743"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"cff1e38c89e37dd364df1e568933b4e27aa61238","unresolved":false,"context_lines":[{"line_number":563,"context_line":""},{"line_number":564,"context_line":"        Reports log info with given driver_name if it\u0027s not."},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"        :return: Console instance or None"},{"line_number":567,"context_line":"        \"\"\""},{"line_number":568,"context_line":"        if CONF.console.enabled:"},{"line_number":569,"context_line":"            return cls()"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a5de9d1_fe459ab2","line":566,"range":{"start_line":566,"start_character":7,"end_line":566,"end_character":41},"updated":"2016-01-29 02:59:21.000000000","message":"missing:\n    :param cls: ...\n    :param driver_name: ...","commit_id":"fc4e5f1b5980bf2dbd357d72870aeae295831c08"}],"ironic/drivers/modules/ipmitool.py":[{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"2ac94c3197ce756d661803f74bbaf039746f78cf","unresolved":false,"context_lines":[{"line_number":1065,"context_line":""},{"line_number":1066,"context_line":"        :param task: a task from TaskManager."},{"line_number":1067,"context_line":"        :raises: InvalidParameterValue"},{"line_number":1068,"context_line":"        :raises: MissingParameterValue when a required parameter is missing"},{"line_number":1069,"context_line":""},{"line_number":1070,"context_line":"        \"\"\""},{"line_number":1071,"context_line":"        console_utils.check_shellinabox_ready()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a29b11f_4b333bf6","line":1068,"updated":"2015-10-23 07:53:13.000000000","message":"we should cover the new case in raises string - \"or shellinabox command can not find.\"","commit_id":"94475fd3b32600b2d15325d8f19bf2aa1f28f591"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"cff1e38c89e37dd364df1e568933b4e27aa61238","unresolved":false,"context_lines":[{"line_number":1059,"context_line":""},{"line_number":1060,"context_line":"        Reports log info with given driver_name if it\u0027s not."},{"line_number":1061,"context_line":""},{"line_number":1062,"context_line":"        :return: Console instance or None"},{"line_number":1063,"context_line":"        \"\"\""},{"line_number":1064,"context_line":"        if CONF.console.enabled:"},{"line_number":1065,"context_line":"            return cls()"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a5de9d1_fe1cbac2","line":1062,"range":{"start_line":1062,"start_character":8,"end_line":1062,"end_character":41},"updated":"2016-01-29 02:59:21.000000000","message":"missing:\n    :param cls: ...\n    :param driver_name: ...","commit_id":"fc4e5f1b5980bf2dbd357d72870aeae295831c08"}],"ironic/drivers/modules/seamicro.py":[{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"cff1e38c89e37dd364df1e568933b4e27aa61238","unresolved":false,"context_lines":[{"line_number":621,"context_line":""},{"line_number":622,"context_line":"        Reports log info with given driver_name if it\u0027s not."},{"line_number":623,"context_line":""},{"line_number":624,"context_line":"        :return: Console instance or None"},{"line_number":625,"context_line":"        \"\"\""},{"line_number":626,"context_line":"        if CONF.console.enabled:"},{"line_number":627,"context_line":"            return cls()"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a5de9d1_1e6f562c","line":624,"range":{"start_line":624,"start_character":7,"end_line":624,"end_character":41},"updated":"2016-01-29 02:59:21.000000000","message":"missing:\n    :param cls: ...\n    :param driver_name: ...","commit_id":"fc4e5f1b5980bf2dbd357d72870aeae295831c08"}],"ironic/drivers/modules/ssh.py":[{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"cff1e38c89e37dd364df1e568933b4e27aa61238","unresolved":false,"context_lines":[{"line_number":811,"context_line":""},{"line_number":812,"context_line":"        Reports log info with given driver_name if it\u0027s not."},{"line_number":813,"context_line":""},{"line_number":814,"context_line":"        :return: Console instance or None"},{"line_number":815,"context_line":"        \"\"\""},{"line_number":816,"context_line":"        if CONF.console.enabled:"},{"line_number":817,"context_line":"            return cls()"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a5de9d1_be640249","line":814,"range":{"start_line":814,"start_character":7,"end_line":814,"end_character":41},"updated":"2016-01-29 02:59:21.000000000","message":"missing:\n    :param cls: ...\n    :param driver_name: ...","commit_id":"fc4e5f1b5980bf2dbd357d72870aeae295831c08"}],"ironic/tests/unit/drivers/modules/test_console_utils.py":[{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"968498183bfc5cd27bb10db6593cfd86758104dc","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            driver\u003d\u0027fake_ipmitool\u0027,"},{"line_number":52,"context_line":"            driver_info\u003dINFO_DICT)"},{"line_number":53,"context_line":"        self.info \u003d ipmi._parse_driver_info(self.node)"},{"line_number":54,"context_line":"        console_utils.shellinabox_ready \u003d False"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def test__get_console_pid_dir(self):"},{"line_number":57,"context_line":"        pid_dir \u003d \u0027/tmp/pid_dir\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa80f949_f662e6d7","line":54,"updated":"2015-11-04 13:10:34.000000000","message":"Global variables are prime candidates for races, I\u0027m worried that tests in parallel mode fails here","commit_id":"1dc7652ba5b6fb3b3fcd9566b0cc9d4b43291743"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"d188aabbe5e52239f119c6b3bf60b0d49b118255","unresolved":false,"context_lines":[{"line_number":247,"context_line":"    @mock.patch.object(subprocess, \u0027check_call\u0027, autospec\u003dTrue)"},{"line_number":248,"context_line":"    def test_check_shellinabox_not_ready(self, mock_chkcall):"},{"line_number":249,"context_line":"        fake_cmd \u003d \u0027terminal\u0027"},{"line_number":250,"context_line":"        mock_chkcall.side_effect \u003d iter([OSError()])"},{"line_number":251,"context_line":"        self.config(terminal\u003dfake_cmd, group\u003d\u0027console\u0027)"},{"line_number":252,"context_line":"        self.assertRaises(exception.InvalidParameterValue,"},{"line_number":253,"context_line":"                          console_utils.check_shellinabox_ready)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_07f8bce4","line":250,"updated":"2015-11-24 15:49:53.000000000","message":"This could be just OSError() I beleive, as it is on L238, ditto for test in test_ipmitool","commit_id":"e417d5adf5c4b413828b86553321c7361e979a51"}],"ironic/tests/unit/drivers/modules/test_ipmitool.py":[{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"97b23b51abbc9d4e068dda0431909630afcd22f8","unresolved":false,"context_lines":[{"line_number":1433,"context_line":"            self.assertEqual({}, driver_routes)"},{"line_number":1434,"context_line":""},{"line_number":1435,"context_line":"    @mock.patch.object(console_utils, \u0027check_shellinabox_ready\u0027, autospec\u003dTrue)"},{"line_number":1436,"context_line":"    def test_console_validate(self, mock_check):"},{"line_number":1437,"context_line":"        with task_manager.acquire("},{"line_number":1438,"context_line":"                self.context, self.node.uuid, shared\u003dTrue) as task:"},{"line_number":1439,"context_line":"            task.node.driver_info[\u0027ipmi_terminal_port\u0027] \u003d 123"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba8a016a_ad0a0c77","line":1436,"updated":"2015-11-20 07:01:14.000000000","message":"seems you should assert the mock method has been called, add need a test case for mock_check with exception.","commit_id":"ea071289c8f973dfd58c722625a02abc890bb0ed"}]}
