{"action":"created","comment":{"url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls/comments/196775753","pull_request_review_id":130392063,"id":196775753,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Njc3NTc1Mw==","diff_hunk":"@@ -0,0 +1,68 @@\n+#!/usr/bin/env python\n+# Copyright 2018 IBM Corp.\n+#\n+# All Rights Reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+from __future__ import nested_scopes, generators, division, absolute_import, \\\n+    with_statement, print_function, unicode_literals\n+\n+import argparse\n+import netaddr\n+import socket\n+from pyroute2 import IPRoute\n+\n+from lib.exception import UserException\n+import lib.logger as logger\n+\n+\n+def ip_route_get_to(host):\n+    \"\"\"Get interface IP that routes to hostname or IP address\n+\n+    Args:\n+        host (str): Hostname or IP address\n+\n+    Returns:\n+        str: Interface IP with route to host\n+\n+    Raises:\n+        UserException: Hostname will not resolve or no route to host\n+    \"\"\"\n+    log = logger.getlogger()\n+\n+    # Check if host is given as IP address\n+    if netaddr.valid_ipv4(host, flags=0):\n+        host_ip = host\n+    else:\n+        try:\n+            host_ip = socket.gethostbyname(host)\n+        except socket.gaierror as exc:\n+            log.debug(\"Unable to resolve host to IP: '{}' exception: '{}'\"\n+                      .format(host, exc))\n+            raise UserException(\"Unable to resolve hostname '{}'!\"","path":"scripts/python/ip_route_get_to.py","position":53,"original_position":53,"commit_id":"d15480ce97375944fc4cb3e32c8bd72b5eccecce","original_commit_id":"d15480ce97375944fc4cb3e32c8bd72b5eccecce","user":{"login":"rayjh","id":22965751,"node_id":"MDQ6VXNlcjIyOTY1NzUx","avatar_url":"https://avatars3.githubusercontent.com/u/22965751?v=4","gravatar_id":"","url":"https://api.github.com/users/rayjh","html_url":"https://github.com/rayjh","followers_url":"https://api.github.com/users/rayjh/followers","following_url":"https://api.github.com/users/rayjh/following{/other_user}","gists_url":"https://api.github.com/users/rayjh/gists{/gist_id}","starred_url":"https://api.github.com/users/rayjh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rayjh/subscriptions","organizations_url":"https://api.github.com/users/rayjh/orgs","repos_url":"https://api.github.com/users/rayjh/repos","events_url":"https://api.github.com/users/rayjh/events{/privacy}","received_events_url":"https://api.github.com/users/rayjh/received_events","type":"User","site_admin":false},"body":"My concern is that we shouldn't stop execution if one of the hosts is not accessible. So I agree it would be better to remove the raise, and maybe change the log level to warning.","created_at":"2018-06-20T13:28:00Z","updated_at":"2018-06-20T13:28:01Z","html_url":"https://github.com/open-power-ref-design-toolkit/power-up/pull/151#discussion_r196775753","pull_request_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls/151","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls/comments/196775753"},"html":{"href":"https://github.com/open-power-ref-design-toolkit/power-up/pull/151#discussion_r196775753"},"pull_request":{"href":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls/151"}},"in_reply_to_id":196408879},"pull_request":{"url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls/151","id":195201236,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MjAxMjM2","html_url":"https://github.com/open-power-ref-design-toolkit/power-up/pull/151","diff_url":"https://github.com/open-power-ref-design-toolkit/power-up/pull/151.diff","patch_url":"https://github.com/open-power-ref-design-toolkit/power-up/pull/151.patch","issue_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/issues/151","number":151,"state":"open","locked":false,"title":"refactor: Move IP route logic to a python script","user":{"login":"jaywcarman","id":1637291,"node_id":"MDQ6VXNlcjE2MzcyOTE=","avatar_url":"https://avatars1.githubusercontent.com/u/1637291?v=4","gravatar_id":"","url":"https://api.github.com/users/jaywcarman","html_url":"https://github.com/jaywcarman","followers_url":"https://api.github.com/users/jaywcarman/followers","following_url":"https://api.github.com/users/jaywcarman/following{/other_user}","gists_url":"https://api.github.com/users/jaywcarman/gists{/gist_id}","starred_url":"https://api.github.com/users/jaywcarman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaywcarman/subscriptions","organizations_url":"https://api.github.com/users/jaywcarman/orgs","repos_url":"https://api.github.com/users/jaywcarman/repos","events_url":"https://api.github.com/users/jaywcarman/events{/privacy}","received_events_url":"https://api.github.com/users/jaywcarman/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-15T14:58:03Z","updated_at":"2018-06-20T13:28:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"570c52f6f467dea14bda1d9fb14f8ceda2d4cd02","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls/151/commits","review_comments_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls/151/comments","review_comment_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/issues/151/comments","statuses_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/statuses/d15480ce97375944fc4cb3e32c8bd72b5eccecce","head":{"label":"jaywcarman:refactor/installer_ip_route","ref":"refactor/installer_ip_route","sha":"d15480ce97375944fc4cb3e32c8bd72b5eccecce","user":{"login":"jaywcarman","id":1637291,"node_id":"MDQ6VXNlcjE2MzcyOTE=","avatar_url":"https://avatars1.githubusercontent.com/u/1637291?v=4","gravatar_id":"","url":"https://api.github.com/users/jaywcarman","html_url":"https://github.com/jaywcarman","followers_url":"https://api.github.com/users/jaywcarman/followers","following_url":"https://api.github.com/users/jaywcarman/following{/other_user}","gists_url":"https://api.github.com/users/jaywcarman/gists{/gist_id}","starred_url":"https://api.github.com/users/jaywcarman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaywcarman/subscriptions","organizations_url":"https://api.github.com/users/jaywcarman/orgs","repos_url":"https://api.github.com/users/jaywcarman/repos","events_url":"https://api.github.com/users/jaywcarman/events{/privacy}","received_events_url":"https://api.github.com/users/jaywcarman/received_events","type":"User","site_admin":false},"repo":{"id":116150306,"node_id":"MDEwOlJlcG9zaXRvcnkxMTYxNTAzMDY=","name":"power-up","full_name":"jaywcarman/power-up","owner":{"login":"jaywcarman","id":1637291,"node_id":"MDQ6VXNlcjE2MzcyOTE=","avatar_url":"https://avatars1.githubusercontent.com/u/1637291?v=4","gravatar_id":"","url":"https://api.github.com/users/jaywcarman","html_url":"https://github.com/jaywcarman","followers_url":"https://api.github.com/users/jaywcarman/followers","following_url":"https://api.github.com/users/jaywcarman/following{/other_user}","gists_url":"https://api.github.com/users/jaywcarman/gists{/gist_id}","starred_url":"https://api.github.com/users/jaywcarman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaywcarman/subscriptions","organizations_url":"https://api.github.com/users/jaywcarman/orgs","repos_url":"https://api.github.com/users/jaywcarman/repos","events_url":"https://api.github.com/users/jaywcarman/events{/privacy}","received_events_url":"https://api.github.com/users/jaywcarman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jaywcarman/power-up","description":"Automated bare metal deployment of OpenPOWER and x86 server clusters","fork":true,"url":"https://api.github.com/repos/jaywcarman/power-up","forks_url":"https://api.github.com/repos/jaywcarman/power-up/forks","keys_url":"https://api.github.com/repos/jaywcarman/power-up/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaywcarman/power-up/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaywcarman/power-up/teams","hooks_url":"https://api.github.com/repos/jaywcarman/power-up/hooks","issue_events_url":"https://api.github.com/repos/jaywcarman/power-up/issues/events{/number}","events_url":"https://api.github.com/repos/jaywcarman/power-up/events","assignees_url":"https://api.github.com/repos/jaywcarman/power-up/assignees{/user}","branches_url":"https://api.github.com/repos/jaywcarman/power-up/branches{/branch}","tags_url":"https://api.github.com/repos/jaywcarman/power-up/tags","blobs_url":"https://api.github.com/repos/jaywcarman/power-up/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaywcarman/power-up/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaywcarman/power-up/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaywcarman/power-up/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaywcarman/power-up/statuses/{sha}","languages_url":"https://api.github.com/repos/jaywcarman/power-up/languages","stargazers_url":"https://api.github.com/repos/jaywcarman/power-up/stargazers","contributors_url":"https://api.github.com/repos/jaywcarman/power-up/contributors","subscribers_url":"https://api.github.com/repos/jaywcarman/power-up/subscribers","subscription_url":"https://api.github.com/repos/jaywcarman/power-up/subscription","commits_url":"https://api.github.com/repos/jaywcarman/power-up/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaywcarman/power-up/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaywcarman/power-up/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaywcarman/power-up/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaywcarman/power-up/contents/{+path}","compare_url":"https://api.github.com/repos/jaywcarman/power-up/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaywcarman/power-up/merges","archive_url":"https://api.github.com/repos/jaywcarman/power-up/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaywcarman/power-up/downloads","issues_url":"https://api.github.com/repos/jaywcarman/power-up/issues{/number}","pulls_url":"https://api.github.com/repos/jaywcarman/power-up/pulls{/number}","milestones_url":"https://api.github.com/repos/jaywcarman/power-up/milestones{/number}","notifications_url":"https://api.github.com/repos/jaywcarman/power-up/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaywcarman/power-up/labels{/name}","releases_url":"https://api.github.com/repos/jaywcarman/power-up/releases{/id}","deployments_url":"https://api.github.com/repos/jaywcarman/power-up/deployments","created_at":"2018-01-03T15:08:43Z","updated_at":"2018-05-10T14:34:24Z","pushed_at":"2018-06-20T12:19:22Z","git_url":"git://github.com/jaywcarman/power-up.git","ssh_url":"git@github.com:jaywcarman/power-up.git","clone_url":"https://github.com/jaywcarman/power-up.git","svn_url":"https://github.com/jaywcarman/power-up","homepage":"","size":3331,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"open-power-ref-design-toolkit:dev-software-install","ref":"dev-software-install","sha":"4f6974336dd2fd2f748616f8f2574567d5298a90","user":{"login":"open-power-ref-design-toolkit","id":25939171,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1OTM5MTcx","avatar_url":"https://avatars1.githubusercontent.com/u/25939171?v=4","gravatar_id":"","url":"https://api.github.com/users/open-power-ref-design-toolkit","html_url":"https://github.com/open-power-ref-design-toolkit","followers_url":"https://api.github.com/users/open-power-ref-design-toolkit/followers","following_url":"https://api.github.com/users/open-power-ref-design-toolkit/following{/other_user}","gists_url":"https://api.github.com/users/open-power-ref-design-toolkit/gists{/gist_id}","starred_url":"https://api.github.com/users/open-power-ref-design-toolkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-power-ref-design-toolkit/subscriptions","organizations_url":"https://api.github.com/users/open-power-ref-design-toolkit/orgs","repos_url":"https://api.github.com/users/open-power-ref-design-toolkit/repos","events_url":"https://api.github.com/users/open-power-ref-design-toolkit/events{/privacy}","received_events_url":"https://api.github.com/users/open-power-ref-design-toolkit/received_events","type":"Organization","site_admin":false},"repo":{"id":71661431,"node_id":"MDEwOlJlcG9zaXRvcnk3MTY2MTQzMQ==","name":"power-up","full_name":"open-power-ref-design-toolkit/power-up","owner":{"login":"open-power-ref-design-toolkit","id":25939171,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1OTM5MTcx","avatar_url":"https://avatars1.githubusercontent.com/u/25939171?v=4","gravatar_id":"","url":"https://api.github.com/users/open-power-ref-design-toolkit","html_url":"https://github.com/open-power-ref-design-toolkit","followers_url":"https://api.github.com/users/open-power-ref-design-toolkit/followers","following_url":"https://api.github.com/users/open-power-ref-design-toolkit/following{/other_user}","gists_url":"https://api.github.com/users/open-power-ref-design-toolkit/gists{/gist_id}","starred_url":"https://api.github.com/users/open-power-ref-design-toolkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-power-ref-design-toolkit/subscriptions","organizations_url":"https://api.github.com/users/open-power-ref-design-toolkit/orgs","repos_url":"https://api.github.com/users/open-power-ref-design-toolkit/repos","events_url":"https://api.github.com/users/open-power-ref-design-toolkit/events{/privacy}","received_events_url":"https://api.github.com/users/open-power-ref-design-toolkit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-power-ref-design-toolkit/power-up","description":"Automated bare metal deployment of OpenPOWER and x86 server clusters","fork":false,"url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up","forks_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/forks","keys_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/teams","hooks_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/hooks","issue_events_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/issues/events{/number}","events_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/events","assignees_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/assignees{/user}","branches_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/branches{/branch}","tags_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/tags","blobs_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/statuses/{sha}","languages_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/languages","stargazers_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/stargazers","contributors_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/contributors","subscribers_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/subscribers","subscription_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/subscription","commits_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/contents/{+path}","compare_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/merges","archive_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/downloads","issues_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/issues{/number}","pulls_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls{/number}","milestones_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/milestones{/number}","notifications_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/labels{/name}","releases_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/releases{/id}","deployments_url":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/deployments","created_at":"2016-10-22T19:38:22Z","updated_at":"2018-06-15T13:07:35Z","pushed_at":"2018-06-19T19:26:58Z","git_url":"git://github.com/open-power-ref-design-toolkit/power-up.git","ssh_url":"git@github.com:open-power-ref-design-toolkit/power-up.git","clone_url":"https://github.com/open-power-ref-design-toolkit/power-up.git","svn_url":"https://github.com/open-power-ref-design-toolkit/power-up","homepage":"","size":3322,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":4,"open_issues":8,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls/151"},"html":{"href":"https://github.com/open-power-ref-design-toolkit/power-up/pull/151"},"issue":{"href":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/issues/151"},"comments":{"href":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/issues/151/comments"},"review_comments":{"href":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls/151/comments"},"review_comment":{"href":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/pulls/151/commits"},"statuses":{"href":"https://api.github.com/repos/open-power-ref-design-toolkit/power-up/statuses/d15480ce97375944fc4cb3e32c8bd72b5eccecce"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"rayjh"}}