)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8576,"name":"Yair Fried","email":"yfried@redhat.com","username":"yfried"},"change_message_id":"cc24d979a5ef2abacaf9cb8b411ee8bf764a8e2b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use dynamic method to get \"ip\" path not \"/bin/ip\""},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"SSH only executes commands in \"/bin/\" if we don\u0027t use absolute"},{"line_number":10,"context_line":"path, \"ip\" path is different(not always \"/bin/ip\") in different"},{"line_number":11,"context_line":"Linux distributions, eg. \"/sbin/ip\" in CentOS, \"/usr/sbin/ip\" in"},{"line_number":12,"context_line":"fedora, so we have to get the real \"ip\" path dynamicly by \"whereis\""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9aa7fdbe_05952b86","line":9,"updated":"2014-10-26 06:46:34.000000000","message":"That\u0027s a great explanation. please consider adding it to the actual module","commit_id":"5a0858d6af097c3c386f1de1a540fe4400049e4d"}],"tempest/common/utils/linux/remote_client.py":[{"author":{"_account_id":8576,"name":"Yair Fried","email":"yfried@redhat.com","username":"yfried"},"change_message_id":"54f3ec06a678fc61e3b8d4d98da4d3a1ab53ab39","unresolved":false,"context_lines":[{"line_number":44,"context_line":"                                     ssh_timeout, pkey\u003dpkey,"},{"line_number":45,"context_line":"                                     channel_timeout\u003dssh_channel_timeout)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _get_binary_path(self, name, default\u003d\"/bin/\"):"},{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd)[:-1]"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_1ffa1375","line":47,"updated":"2014-10-23 08:44:14.000000000","message":"nit: could we somehow make this into a decorator?","commit_id":"413334da71191fa5ee51504a4c6e5f53a92591fc"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"a60f94e3b7d2452d523e0a6e350b5b5ce55e3afe","unresolved":false,"context_lines":[{"line_number":44,"context_line":"                                     ssh_timeout, pkey\u003dpkey,"},{"line_number":45,"context_line":"                                     channel_timeout\u003dssh_channel_timeout)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _get_binary_path(self, name, default\u003d\"/bin/\"):"},{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd)[:-1]"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_42d044f6","line":47,"in_reply_to":"9aa7fdbe_1ffa1375","updated":"2014-10-23 09:17:12.000000000","message":"Here we don\u0027t modify an attribute of a function, using decorator may not a good choice, I think so.","commit_id":"413334da71191fa5ee51504a4c6e5f53a92591fc"},{"author":{"_account_id":8576,"name":"Yair Fried","email":"yfried@redhat.com","username":"yfried"},"change_message_id":"54f3ec06a678fc61e3b8d4d98da4d3a1ab53ab39","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _get_binary_path(self, name, default\u003d\"/bin/\"):"},{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd)[:-1]"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_5f53bbe1","line":49,"updated":"2014-10-23 08:44:14.000000000","message":"nit: you should use \"str.strip()\" for that","commit_id":"413334da71191fa5ee51504a4c6e5f53a92591fc"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"a60f94e3b7d2452d523e0a6e350b5b5ce55e3afe","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _get_binary_path(self, name, default\u003d\"/bin/\"):"},{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd)[:-1]"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_6260e8cf","line":49,"in_reply_to":"9aa7fdbe_5f53bbe1","updated":"2014-10-23 09:17:12.000000000","message":"good.","commit_id":"413334da71191fa5ee51504a4c6e5f53a92591fc"},{"author":{"_account_id":8576,"name":"Yair Fried","email":"yfried@redhat.com","username":"yfried"},"change_message_id":"54f3ec06a678fc61e3b8d4d98da4d3a1ab53ab39","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd)[:-1]"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path) \u003e 0:"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"},{"line_number":55,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_1fd3f304","line":52,"updated":"2014-10-23 08:44:14.000000000","message":"nit: \"if len(real_path):\" since this is sure to return an int.\n\nquestion:\nin case of failure whereis returns the \"name\" in stderr. are you sure this won\u0027t cause exec_command to throw and exception or get you a \"false-positive\" in len(real_path)?","commit_id":"413334da71191fa5ee51504a4c6e5f53a92591fc"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"a60f94e3b7d2452d523e0a6e350b5b5ce55e3afe","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd)[:-1]"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path) \u003e 0:"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"},{"line_number":55,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_22742067","line":52,"in_reply_to":"9aa7fdbe_1fd3f304","updated":"2014-10-23 09:17:12.000000000","message":"1. \"if len(real_path):\" is good.\n\n2.  If there is no \"name\" found, \"whereis\" returns \"name:\" string, but \"awk \u0027{print $2}\u0027 \" will process it and return a \"\\n\" string. After strip \"\\n\", len(real_path) is zero.","commit_id":"413334da71191fa5ee51504a4c6e5f53a92591fc"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"38e877d5246c3f0a16ed8514a887282d780427e7","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                                     channel_timeout\u003dssh_channel_timeout)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _get_binary_path(self, name, default\u003d\"/bin/\"):"},{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_b2d7bfec","line":48,"updated":"2014-11-20 03:57:16.000000000","message":"Can we say that whereis exists always under /usr/bin ?","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"a9707b47c7f3840ad0d36d83f13f39089199dfe6","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                                     channel_timeout\u003dssh_channel_timeout)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _get_binary_path(self, name, default\u003d\"/bin/\"):"},{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_e5c89e77","line":48,"in_reply_to":"5a890539_b2d7bfec","updated":"2014-11-20 06:31:59.000000000","message":"AFAIK?it\u0027s yes in Ubuntu, Cirros, CentOS and Fedora.","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"38e877d5246c3f0a16ed8514a887282d780427e7","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path):"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_3203cf74","line":51,"updated":"2014-11-20 03:57:16.000000000","message":"How about executing whereis only if the command doesn\u0027t exist under default path(/bin) like a fallback?","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"894cbad4225e3294e50913da2477830c92b1fbc9","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path):"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_e192f255","line":51,"in_reply_to":"5a890539_00a2a2fc","updated":"2014-11-24 08:42:50.000000000","message":"Raises the exception here will break consistency with the other functions in this module, it\u0027s a good choice to let \"ssh_client\" to process the exception, I think so.","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"abc291e44c3286830e8ff9ca088266c04dc99b1e","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path):"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_4860a735","line":51,"in_reply_to":"5a890539_08adbf88","updated":"2014-11-20 07:00:54.000000000","message":"1. \"ip\" is not under \"/bin\", but in other paths, like \"/usr/bin\"...\n2. \"ip\" is not in the host root FS, we can not find it.\n\nIn situation one, we use \"whereis\" to get it, In situation two, we return(execute \"else\") \"default_path\" to through exception to caller.","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"a9707b47c7f3840ad0d36d83f13f39089199dfe6","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path):"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_a80cab3c","line":51,"in_reply_to":"5a890539_3203cf74","updated":"2014-11-20 06:31:59.000000000","message":"It is a good method from the perspective of execution efficiency, but it\u0027s more complicated, we need to execute the command first, and catch the \"command not found\" exception, and then get the right path, then execute it. we need to do it in every method. \nActually, only in Cirros, the \"ip\" path is \"/bin/ip\"","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"f7660961ff3d7d8758ad9250cd0fcc5cfb604eb8","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path):"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_68bf2361","line":51,"in_reply_to":"5a890539_4860a735","updated":"2014-11-20 07:05:33.000000000","message":"I cannot understand why this method needs to return such *default* value which causes an exception to caller side.","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":8576,"name":"Yair Fried","email":"yfried@redhat.com","username":"yfried"},"change_message_id":"494105467e412681b3511654d3295b4fc9408cb1","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path):"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_00a2a2fc","line":51,"in_reply_to":"5a890539_4be98119","updated":"2014-11-23 10:06:53.000000000","message":"well, maybe raise the exception yourself instead of executing the command?","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"9c106d1922f894cb4695c6014b4d7f9f5de4e3fe","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path):"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_4be98119","line":51,"in_reply_to":"5a890539_68bf2361","updated":"2014-11-20 07:22:25.000000000","message":"It\u0027s a trick, it should raise the exception here, and we need to log the message, and raise exception, but in this module, there is no \"log\" and \"exception\" module, or there is no function to process exception, so I give a default value.\n\nIf we use \"/bin/ip\" directly, and there is no \"ip\" in host, this exception will be processed by upper caller.","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"a4d9916849d1261df458ba2c5e4790d92d79d7a5","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path):"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_e8c87377","line":51,"in_reply_to":"5a890539_886e0fc8","updated":"2014-11-20 06:50:12.000000000","message":"\"else\" will be executed when \"ip\" path is not found, or \"ip\" related packet is not installed, here we return a \"default_path\" which is actually a wrong path, we don\u0027t process this exception, and through it to caller  to simple the call sequence.\n\nFor example, if the host doesn\u0027t contain \"ip\" command, here the caller will call \"/bin/ip\" on host, and will get a \"command not found\" message.","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"cbf56866b18be63fae5937247f68a428bd38e9f6","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path):"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_886e0fc8","line":51,"in_reply_to":"5a890539_a80cab3c","updated":"2014-11-20 06:35:50.000000000","message":"I am not sure current \"else\" code path is really used because I guess whereis would detect /bin/ip also.","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"9791637bd86a415056f925a6ca980cd107e5fc1a","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path):"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_eccacc4d","line":51,"in_reply_to":"5a890539_e192f255","updated":"2014-11-24 23:59:27.000000000","message":"you can use something like collecting all paths: \"PATH\u003d$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:.... ; whereis ip\"","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"b821814df24edc2bf5eea3eff0b3c81cde62d07d","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path):"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_08adbf88","line":51,"in_reply_to":"5a890539_e8c87377","updated":"2014-11-20 06:53:54.000000000","message":"that is the reason of my -1 and my first suggestion.\ncurrent code seems misleading..","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"30e8889f05c85a9f3c42c10493c08f4d2e270205","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        cmd \u003d \"/usr/bin/whereis -b \" + name + \"| awk \u0027{print $2}\u0027\""},{"line_number":49,"context_line":"        # remove \u0027\\n\u0027 character"},{"line_number":50,"context_line":"        real_path \u003d self.exec_command(cmd).strip(\u0027\\n\u0027)"},{"line_number":51,"context_line":"        default_path \u003d default + name"},{"line_number":52,"context_line":"        if len(real_path):"},{"line_number":53,"context_line":"            # Use the real path of different Linux distributions."},{"line_number":54,"context_line":"            return real_path"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_e72587c2","line":51,"in_reply_to":"5a890539_eccacc4d","updated":"2014-11-25 01:59:11.000000000","message":"Thank you for your suggestion, I will clarify it next patch.","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"f95f8f036bba71c2993231c15d47eac5e67cab7c","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        else:"},{"line_number":56,"context_line":"            # If we don\u0027t find a valid binary path, return a default_path,"},{"line_number":57,"context_line":"            # so function exec_command can process the \"command not found\""},{"line_number":58,"context_line":"            # exception uniformly."},{"line_number":59,"context_line":"            return default_path"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def exec_command(self, cmd):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_82883172","line":58,"updated":"2014-11-25 02:40:40.000000000","message":"Hi All, thank you for your comments first, I almost know the confusion, I want to clarify it here.\n\n1. The original logic is: a) give a default path, like \"/bin/ip\"; b)let ssh_client to execute it. If \"/bin/ip\" can not be found in host, the ssh_client will process this exception.\n\n2. The logic of this patch is: a) use \"whereis\" to get correct path; b) If found, execute it, otherwise(\"ip\" can not be found in host), give ssh_client a default value, \"/bin/ip\", then the ssh_client will process this exception, keep consistency with the original logic.","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"36296e066ca56db69d7007328e9093691ae6371d","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        else:"},{"line_number":56,"context_line":"            # If we don\u0027t find a valid binary path, return a default_path,"},{"line_number":57,"context_line":"            # so function exec_command can process the \"command not found\""},{"line_number":58,"context_line":"            # exception uniformly."},{"line_number":59,"context_line":"            return default_path"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def exec_command(self, cmd):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_9a62433c","line":58,"in_reply_to":"3a961159_ef10eb5a","updated":"2014-12-23 08:33:03.000000000","message":"Yes, you are right, here we assume \u0027whereis\u0027 has a same path in different systems, in fact, they are the same in Cirros, centos, fedora and ubuntu. Using predefined  paths is another feasible method.","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":12412,"name":"Shang Yong","email":"yong.shang@me.com","username":"bshang"},"change_message_id":"bccc01cc6958dbdd8bd18d037e7bae05ea3ff0f6","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        else:"},{"line_number":56,"context_line":"            # If we don\u0027t find a valid binary path, return a default_path,"},{"line_number":57,"context_line":"            # so function exec_command can process the \"command not found\""},{"line_number":58,"context_line":"            # exception uniformly."},{"line_number":59,"context_line":"            return default_path"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def exec_command(self, cmd):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_e7fe8237","line":58,"in_reply_to":"5a890539_82883172","updated":"2014-12-03 08:53:01.000000000","message":"Ken\u0027ichi Ohmichi, \"1\" and \"2\" are the same, I really don\u0027t understand why this patch will cause \"bug investigation difficult\", can you point it out? Thank you!","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"},{"author":{"_account_id":4727,"name":"Itzik Brown","email":"itzikb@redhat.com","username":"itzikb1"},"change_message_id":"1917a37c677e7765b3c0ce51db47e5e94700ce08","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        else:"},{"line_number":56,"context_line":"            # If we don\u0027t find a valid binary path, return a default_path,"},{"line_number":57,"context_line":"            # so function exec_command can process the \"command not found\""},{"line_number":58,"context_line":"            # exception uniformly."},{"line_number":59,"context_line":"            return default_path"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def exec_command(self, cmd):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_ef10eb5a","line":58,"in_reply_to":"5a890539_e7fe8237","updated":"2014-12-23 07:37:12.000000000","message":"IMHO whereis command has the same problem as the one you want to solve.\nWhat about Looking whether the ip file is in pre determined directories. If you want one you return it if not you return nothing or raise an exception.","commit_id":"aae2a292f4a88d00688b09fcecdf5e49b919f1f1"}],"tempest/tests/common/utils/linux/test_remote_client.py":[{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"c475408a57be38fa0383d6e0a71e423b937f05de","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def test_get_mac_address(self):"},{"line_number":114,"context_line":"        # The real ip path is \"/sbin/ip\""},{"line_number":115,"context_line":"        ip_path \u003d \"\"\"/sbin/ip"},{"line_number":116,"context_line":"\"\"\""},{"line_number":117,"context_line":"        self.ssh_mock.mock.exec_command.return_value \u003d ip_path"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_63b97978","line":115,"updated":"2014-11-17 14:16:47.000000000","message":"please just explicitly put the \\n into here, using block comments just to add newlines seems overkill.\n\nip_path \u003d \"/sbin/ip\\n\"","commit_id":"5a0858d6af097c3c386f1de1a540fe4400049e4d"},{"author":{"_account_id":8576,"name":"Yair Fried","email":"yfried@redhat.com","username":"yfried"},"change_message_id":"9325d55c654ddc9eeb498d0ba949beaea7abcbb1","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    def test_assign_static_ip(self):"},{"line_number":154,"context_line":"        # The real ip path is \"/sbin/ip\""},{"line_number":155,"context_line":"        ip_path \u003d \"\"\"/usr/bin/ip"},{"line_number":156,"context_line":"\"\"\""},{"line_number":157,"context_line":"        self.ssh_mock.mock.exec_command.return_value \u003d ip_path"},{"line_number":158,"context_line":"        ip \u003d \u002710.0.0.2\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_c305cd14","line":155,"updated":"2014-11-17 14:22:14.000000000","message":"see sdague\u0027s comment","commit_id":"5a0858d6af097c3c386f1de1a540fe4400049e4d"},{"author":{"_account_id":8576,"name":"Yair Fried","email":"yfried@redhat.com","username":"yfried"},"change_message_id":"9325d55c654ddc9eeb498d0ba949beaea7abcbb1","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            \"sudo /usr/bin/ip addr add %s/%s dev %s\" % (ip, \u002728\u0027, nic))"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"        # No valid \"ip\" path found"},{"line_number":166,"context_line":"        ip_path \u003d \"\"\""},{"line_number":167,"context_line":"\"\"\""},{"line_number":168,"context_line":"        self.ssh_mock.mock.exec_command.return_value \u003d ip_path"},{"line_number":169,"context_line":"        ip \u003d \u002710.0.0.2\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_a3028007","line":166,"updated":"2014-11-17 14:22:14.000000000","message":"see sdague\u0027s comment","commit_id":"5a0858d6af097c3c386f1de1a540fe4400049e4d"},{"author":{"_account_id":8576,"name":"Yair Fried","email":"yfried@redhat.com","username":"yfried"},"change_message_id":"9325d55c654ddc9eeb498d0ba949beaea7abcbb1","unresolved":false,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def test_turn_nic_on(self):"},{"line_number":176,"context_line":"        # The real ip path is \"/sbin/ip\""},{"line_number":177,"context_line":"        ip_path \u003d \"\"\"/usr/sbin/ip"},{"line_number":178,"context_line":"\"\"\""},{"line_number":179,"context_line":"        self.ssh_mock.mock.exec_command.return_value \u003d ip_path"},{"line_number":180,"context_line":"        nic \u003d \u0027eth0\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_c305cc11","line":177,"updated":"2014-11-17 14:22:14.000000000","message":"see sdague\u0027s comment","commit_id":"5a0858d6af097c3c386f1de1a540fe4400049e4d"},{"author":{"_account_id":8576,"name":"Yair Fried","email":"yfried@redhat.com","username":"yfried"},"change_message_id":"9325d55c654ddc9eeb498d0ba949beaea7abcbb1","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        self._assert_exec_called_with(\u0027sudo /usr/sbin/ip link set %s up\u0027 % nic)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        # No valid \"ip\" path found"},{"line_number":186,"context_line":"        ip_path \u003d \"\"\""},{"line_number":187,"context_line":"\"\"\""},{"line_number":188,"context_line":"        self.ssh_mock.mock.exec_command.return_value \u003d ip_path"},{"line_number":189,"context_line":"        nic \u003d \u0027eth0\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_2316904c","line":186,"updated":"2014-11-17 14:22:14.000000000","message":"see sdague\u0027s comment","commit_id":"5a0858d6af097c3c386f1de1a540fe4400049e4d"}]}
