)]}'
{"ironic/conf/ssh.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"e429c78fb49540aa60c9dbdc45d9cc0daa225a7c","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                      \"node\u0027s MAC address.\")),"},{"line_number":34,"context_line":"    cfg.IntOpt(\u0027num_retries\u0027,"},{"line_number":35,"context_line":"               default\u003d0,"},{"line_number":36,"context_line":"               help\u003d_(\u0027Number of retries when connecting to created VM \u0027))"},{"line_number":37,"context_line":"]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a629dbe_7d94b436","line":36,"range":{"start_line":36,"start_character":60,"end_line":36,"end_character":67},"updated":"2016-11-08 11:50:51.000000000","message":"Not only for just created, for any execute.","commit_id":"700a51b47ae7c617152b5c42cf3263d087df0c99"},{"author":{"_account_id":22724,"name":"Galyna Zholtkevych","email":"galynazholtkevych1991@gmail.com","username":"gzholtkevych"},"change_message_id":"0cc5266f217c93ff7b50ff9a334d1bbe9a7d4c81","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                      \"node\u0027s MAC address.\")),"},{"line_number":34,"context_line":"    cfg.IntOpt(\u0027num_retries\u0027,"},{"line_number":35,"context_line":"               default\u003d0,"},{"line_number":36,"context_line":"               help\u003d_(\u0027Number of retries when connecting to created VM \u0027))"},{"line_number":37,"context_line":"]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a629dbe_5d2b70eb","line":36,"range":{"start_line":36,"start_character":60,"end_line":36,"end_character":67},"in_reply_to":"9a629dbe_7d94b436","updated":"2016-11-08 14:31:49.000000000","message":"Done","commit_id":"700a51b47ae7c617152b5c42cf3263d087df0c99"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"2266c4da11bba68c4d283f2010f70d68d5a6fca0","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                      \"node\u0027s MAC address.\")),"},{"line_number":34,"context_line":"    cfg.IntOpt(\u0027num_retries\u0027,"},{"line_number":35,"context_line":"               default\u003d0,"},{"line_number":36,"context_line":"               help\u003d_(\u0027Number of retries when connecting to VM \u0027))"},{"line_number":37,"context_line":"]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a629dbe_2dea8eac","line":36,"updated":"2016-11-10 17:21:58.000000000","message":"We already have retries get_vm_name_attempts L25 for getting VM names, it also executes _ssh_execute() [0] so new parameter conflicts with that.\n\nnit: period missed at the end.\n\n[0] https://github.com/openstack/ironic/blob/95de92c63798830cc3f387909491eec635d116e0/ironic/drivers/modules/ssh.py#L503","commit_id":"ae3e6d7222614fe8b6d1009550041cd701d61137"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"5ea96bcfb716ffb963ea652ef0b0300b703981e1","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                      \"node\u0027s MAC address.\")),"},{"line_number":34,"context_line":"    cfg.IntOpt(\u0027num_retries\u0027,"},{"line_number":35,"context_line":"               default\u003d0,"},{"line_number":36,"context_line":"               help\u003d_(\u0027Number of retries when connecting to VM \u0027))"},{"line_number":37,"context_line":"]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a629dbe_ad6f62fa","line":36,"in_reply_to":"9a629dbe_2dea8eac","updated":"2016-11-11 10:54:11.000000000","message":"Great catch. I wonder if we should deprecate the get_vm_name_[attempts/retry_interval] configurations and instead use a more global one to retry on all _ssh_execute() as this patch is proposing. e.g:\n\ncfg.IntOpt(\u0027num_retries\u0027, deprecated_name\u003d\u0027get_vm_name_attempts\u0027, ...)\n\nWhat do you think ?","commit_id":"ae3e6d7222614fe8b6d1009550041cd701d61137"},{"author":{"_account_id":22724,"name":"Galyna Zholtkevych","email":"galynazholtkevych1991@gmail.com","username":"gzholtkevych"},"change_message_id":"04b2e028786ee12622d3835388eeed92246cc257","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                      \"node\u0027s MAC address.\")),"},{"line_number":34,"context_line":"    cfg.IntOpt(\u0027num_retries\u0027,"},{"line_number":35,"context_line":"               default\u003d0,"},{"line_number":36,"context_line":"               help\u003d_(\u0027Number of retries when connecting to VM \u0027))"},{"line_number":37,"context_line":"]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a629dbe_c04e1d3a","line":36,"in_reply_to":"9a629dbe_ad6f62fa","updated":"2016-11-11 11:06:22.000000000","message":"I think that would be the best option. Because for now I just put some hacks and I wonder if it is allowed in our case to use just one option","commit_id":"ae3e6d7222614fe8b6d1009550041cd701d61137"},{"author":{"_account_id":14675,"name":"Hugo Nicodemos","email":"hugo.brito@windriver.com","username":"nicodemos"},"change_message_id":"9ebaf214ba45fc9c6c12287679fd08dcbde7dc7e","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                      \"node\u0027s MAC address.\")),"},{"line_number":34,"context_line":"    cfg.IntOpt(\u0027num_retries\u0027,"},{"line_number":35,"context_line":"               default\u003d0,"},{"line_number":36,"context_line":"               help\u003d_(\u0027Number of retries when connecting to VM \u0027))"},{"line_number":37,"context_line":"]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a629dbe_d1450843","line":36,"updated":"2016-11-11 14:43:44.000000000","message":"nit: missing the dot.","commit_id":"723bb085d2e068f7d6ea02843dc39429f3759402"},{"author":{"_account_id":22724,"name":"Galyna Zholtkevych","email":"galynazholtkevych1991@gmail.com","username":"gzholtkevych"},"change_message_id":"8cc07fa3ce3ded00c8b4bea384fd63897c7fb9cb","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                      \"node\u0027s MAC address.\")),"},{"line_number":34,"context_line":"    cfg.IntOpt(\u0027num_retries\u0027,"},{"line_number":35,"context_line":"               default\u003d0,"},{"line_number":36,"context_line":"               help\u003d_(\u0027Number of retries when connecting to VM \u0027))"},{"line_number":37,"context_line":"]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a629dbe_f2a65752","line":36,"in_reply_to":"9a629dbe_d1450843","updated":"2016-11-14 11:55:48.000000000","message":"Done","commit_id":"723bb085d2e068f7d6ea02843dc39429f3759402"}],"ironic/drivers/modules/ssh.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"0c2e72ae84e67411dfb0778c579db08426154929","unresolved":false,"context_lines":[{"line_number":345,"context_line":"            output_list \u003d processutils.ssh_execute(ssh_obj,"},{"line_number":346,"context_line":"                                                   cmd_to_exec)[0].split(\u0027\\n\u0027)"},{"line_number":347,"context_line":"            return output_list"},{"line_number":348,"context_line":"        except Exception as e:"},{"line_number":349,"context_line":"            LOG.error(_LE(\"Cannot execute SSH cmd %(cmd)s. Reason: %(err)s.\"),"},{"line_number":350,"context_line":"                      {\u0027cmd\u0027: cmd_to_exec, \u0027err\u0027: e})"},{"line_number":351,"context_line":"    raise exception.SSHCommandFailed(cmd\u003dcmd_to_exec)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a629dbe_97710047","line":348,"updated":"2016-11-10 10:01:38.000000000","message":"Does it raise a more specific exception for us to retry based on it ?","commit_id":"80507ae2aa89664b7c77428785ef5eca56a30cc0"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"0c2e72ae84e67411dfb0778c579db08426154929","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            return output_list"},{"line_number":348,"context_line":"        except Exception as e:"},{"line_number":349,"context_line":"            LOG.error(_LE(\"Cannot execute SSH cmd %(cmd)s. Reason: %(err)s.\"),"},{"line_number":350,"context_line":"                      {\u0027cmd\u0027: cmd_to_exec, \u0027err\u0027: e})"},{"line_number":351,"context_line":"    raise exception.SSHCommandFailed(cmd\u003dcmd_to_exec)"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a629dbe_1701706a","line":350,"updated":"2016-11-10 10:01:38.000000000","message":"This error could be logged multiple times now. Perhaps we should log a warning and indicate that we will retry the command ?\n\nE.g\n\n try:\n     ...\n     return \n except Exception as e:\n     LOG.warning(_LW(\"Command ... failed... Retrying, \"\n                     \"attempt %(attempt)d times of %(max_attempts)s\")\n \n LOG.error(_LE(\u0027Cannot execute SSH command...\u0027)\n raise exception.SSHCommandFailed(...)","commit_id":"80507ae2aa89664b7c77428785ef5eca56a30cc0"},{"author":{"_account_id":22724,"name":"Galyna Zholtkevych","email":"galynazholtkevych1991@gmail.com","username":"gzholtkevych"},"change_message_id":"9ed0a1f866886ed4d9e092dddf831bf7cfa6e200","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            return output_list"},{"line_number":348,"context_line":"        except Exception as e:"},{"line_number":349,"context_line":"            LOG.error(_LE(\"Cannot execute SSH cmd %(cmd)s. Reason: %(err)s.\"),"},{"line_number":350,"context_line":"                      {\u0027cmd\u0027: cmd_to_exec, \u0027err\u0027: e})"},{"line_number":351,"context_line":"    raise exception.SSHCommandFailed(cmd\u003dcmd_to_exec)"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a629dbe_3bb2d106","line":350,"in_reply_to":"9a629dbe_1701706a","updated":"2016-11-10 14:49:58.000000000","message":"Ah yes, I didn\u0027t notice that, thank you :)","commit_id":"80507ae2aa89664b7c77428785ef5eca56a30cc0"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"0c2e72ae84e67411dfb0778c579db08426154929","unresolved":false,"context_lines":[{"line_number":349,"context_line":"            LOG.error(_LE(\"Cannot execute SSH cmd %(cmd)s. Reason: %(err)s.\"),"},{"line_number":350,"context_line":"                      {\u0027cmd\u0027: cmd_to_exec, \u0027err\u0027: e})"},{"line_number":351,"context_line":"    raise exception.SSHCommandFailed(cmd\u003dcmd_to_exec)"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"def _parse_driver_info(node):"},{"line_number":355,"context_line":"    \"\"\"Gets the information needed for accessing the node."}],"source_content_type":"text/x-python","patch_set":2,"id":"9a629dbe_576cc834","line":352,"updated":"2016-11-10 10:01:38.000000000","message":"Also, the RFE this patch is fixing is talking about power commands. Changing this method we are adding retry for all actions in the SSH driver. I think it\u0027s better but we probably should update that RFE.\n\n...\n\n\nAs a side note, the SSH drive is basically marked as unsupported, so I also wonder whether we should keep on improving it.","commit_id":"80507ae2aa89664b7c77428785ef5eca56a30cc0"},{"author":{"_account_id":22724,"name":"Galyna Zholtkevych","email":"galynazholtkevych1991@gmail.com","username":"gzholtkevych"},"change_message_id":"9ed0a1f866886ed4d9e092dddf831bf7cfa6e200","unresolved":false,"context_lines":[{"line_number":349,"context_line":"            LOG.error(_LE(\"Cannot execute SSH cmd %(cmd)s. Reason: %(err)s.\"),"},{"line_number":350,"context_line":"                      {\u0027cmd\u0027: cmd_to_exec, \u0027err\u0027: e})"},{"line_number":351,"context_line":"    raise exception.SSHCommandFailed(cmd\u003dcmd_to_exec)"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"def _parse_driver_info(node):"},{"line_number":355,"context_line":"    \"\"\"Gets the information needed for accessing the node."}],"source_content_type":"text/x-python","patch_set":2,"id":"9a629dbe_5ecdb3b5","line":352,"in_reply_to":"9a629dbe_576cc834","updated":"2016-11-10 14:49:58.000000000","message":"Commented on related RFE bug\n\n__\n\n\nWas also thinking about that, but decided that if the bug is new, I would rather upload the patch just in case","commit_id":"80507ae2aa89664b7c77428785ef5eca56a30cc0"},{"author":{"_account_id":14675,"name":"Hugo Nicodemos","email":"hugo.brito@windriver.com","username":"nicodemos"},"change_message_id":"9ebaf214ba45fc9c6c12287679fd08dcbde7dc7e","unresolved":false,"context_lines":[{"line_number":334,"context_line":"    output from the command."},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"    :param ssh_obj: paramiko.SSHClient, an active ssh connection."},{"line_number":337,"context_line":"    :param cmd_to_exec: command to execute."},{"line_number":338,"context_line":"    :returns: list of the lines of output from the command."},{"line_number":339,"context_line":"    :raises: SSHCommandFailed on an error from ssh."},{"line_number":340,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a629dbe_51a7380a","line":337,"updated":"2016-11-11 14:43:44.000000000","message":"add param num_retries: ...","commit_id":"723bb085d2e068f7d6ea02843dc39429f3759402"},{"author":{"_account_id":22724,"name":"Galyna Zholtkevych","email":"galynazholtkevych1991@gmail.com","username":"gzholtkevych"},"change_message_id":"8cc07fa3ce3ded00c8b4bea384fd63897c7fb9cb","unresolved":false,"context_lines":[{"line_number":334,"context_line":"    output from the command."},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"    :param ssh_obj: paramiko.SSHClient, an active ssh connection."},{"line_number":337,"context_line":"    :param cmd_to_exec: command to execute."},{"line_number":338,"context_line":"    :returns: list of the lines of output from the command."},{"line_number":339,"context_line":"    :raises: SSHCommandFailed on an error from ssh."},{"line_number":340,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a629dbe_3267ef26","line":337,"in_reply_to":"9a629dbe_51a7380a","updated":"2016-11-14 11:55:48.000000000","message":"Done","commit_id":"723bb085d2e068f7d6ea02843dc39429f3759402"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"6750dadc3baa9091f403e3d42be81fa6477ebc4d","unresolved":false,"context_lines":[{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    \"\"\""},{"line_number":343,"context_line":"    attempts \u003d 1 + (num_retries or CONF.ssh.num_retries)"},{"line_number":344,"context_line":"    for attempt in range(0, attempts):"},{"line_number":345,"context_line":"        try:"},{"line_number":346,"context_line":"            output_list \u003d processutils.ssh_execute(ssh_obj,"},{"line_number":347,"context_line":"                                                   cmd_to_exec)[0].split(\u0027\\n\u0027)"},{"line_number":348,"context_line":"            return output_list"},{"line_number":349,"context_line":"        except Exception as e:"},{"line_number":350,"context_line":"            error \u003d (\u0027%(cmd)s. Reason: %(err)s. Retrying %(attempt)s\u0027"},{"line_number":351,"context_line":"                     \u0027time\u0027).format({\u0027cmd\u0027: cmd_to_exec, \u0027err\u0027: e,"},{"line_number":352,"context_line":"                                     \u0027attempt\u0027: attempt})"},{"line_number":353,"context_line":"            LOG.warning(_LW(\u0027Cannot execute SSH cmd %s\u0027), error)"},{"line_number":354,"context_line":"    LOG.error(\u0027Cannot execute SSH cmd %s\u0027, error)"},{"line_number":355,"context_line":"    raise exception.SSHCommandFailed(cmd\u003dcmd_to_exec)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":""},{"line_number":358,"context_line":"def _parse_driver_info(node):"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a77a97e_edd2c933","line":355,"range":{"start_line":344,"start_character":4,"end_line":355,"end_character":53},"updated":"2016-11-22 13:35:41.000000000","message":"I am a bit cautious for returning from try clause, so I would suggest rewriting it roughly in the following way:\n\n  for attempt in attempts:\n      try:\n          out \u003d ...\n      except Exception:\n          LOG.warning(...)\n      else:\n          break\n  else:  # this is executed only when for loop has run whole w/o breaks\n      LOG.error(...)\n      raise ...\n  return out\n\nbut that may be just my taste","commit_id":"c70d66336b1ccde0c5208826c0c67beb5cbd2781"}]}
