{"action":"created","comment":{"url":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls/comments/39069003","id":39069003,"diff_hunk":"@@ -2311,64 +2310,59 @@ def _configure(self):\n         raise NotImplementedError(\"_Configure not implemented for LRMS type: %s.\" % self.name)\n \n \n-    # --------------------------------------------------------------------------\n-    #\n-    @staticmethod\n-    def hostname(logger=None):\n-\n-        hostname = socket.getfqdn()\n-\n-        if not hostname:\n-            hostname = os.uname()[1]\n-\n-        if not hostname:\n-            if logger:\n-                logger.error(\"could not detect hostname\")\n-            raise RuntimeError(\"could not detect hostname\")\n-\n-        return hostname\n-\n \n     # --------------------------------------------------------------------------\n     #\n     @staticmethod\n-    def hostip(host=None, logger=None):\n+    def hostip(req=None, logger=None):\n         \"\"\"\n-        look up the ip number for a given host name.  If hostname is not given,\n-        look up IP for localhost.\n+        Look up the ip number for a given requested interface name.\n+        If interface is not given, do some magic.\n         \"\"\"\n \n-        if not host:\n+        # List of interfaces that we probably dont want to bind to\n+        black_list = ['lo', 'sit0']\n \n-            # try the simple and safe detection first -- which will fail though\n-            # if we don't have any connectivity\n-            try:\n-                s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\n-                s.setblocking(False)\n-                s.settimeout(1.0)\n-                s.connect(('8.8.8.8', 53))\n-                return s.getsockname()[0]\n-            except Exception as e:\n-                if logger:\n-                    logger.exception(\"use fallback IP detection (%s)\" % e)\n+        # Known intefaces in preferred order\n+        sorted_preferred = ['ipogif0', 'eth0']","path":"src/radical/pilot/agent/radical-pilot-agent-multicore.py","position":67,"original_position":67,"commit_id":"ae4eee036f067d0380b8a2ba0b1f28f3df62a570","original_commit_id":"ae4eee036f067d0380b8a2ba0b1f28f3df62a570","user":{"login":"andre-merzky","id":1319674,"avatar_url":"https://avatars.githubusercontent.com/u/1319674?v=3","gravatar_id":"","url":"https://api.github.com/users/andre-merzky","html_url":"https://github.com/andre-merzky","followers_url":"https://api.github.com/users/andre-merzky/followers","following_url":"https://api.github.com/users/andre-merzky/following{/other_user}","gists_url":"https://api.github.com/users/andre-merzky/gists{/gist_id}","starred_url":"https://api.github.com/users/andre-merzky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andre-merzky/subscriptions","organizations_url":"https://api.github.com/users/andre-merzky/orgs","repos_url":"https://api.github.com/users/andre-merzky/repos","events_url":"https://api.github.com/users/andre-merzky/events{/privacy}","received_events_url":"https://api.github.com/users/andre-merzky/received_events","type":"User","site_admin":false},"body":"this is quite some magic right here... :P ","created_at":"2015-09-09T17:03:41Z","updated_at":"2015-09-09T17:03:41Z","html_url":"https://github.com/radical-cybertools/radical.pilot/pull/712#discussion_r39069003","pull_request_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls/712","_links":{"self":{"href":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls/comments/39069003"},"html":{"href":"https://github.com/radical-cybertools/radical.pilot/pull/712#discussion_r39069003"},"pull_request":{"href":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls/712"}}},"pull_request":{"url":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls/712","id":44573113,"html_url":"https://github.com/radical-cybertools/radical.pilot/pull/712","diff_url":"https://github.com/radical-cybertools/radical.pilot/pull/712.diff","patch_url":"https://github.com/radical-cybertools/radical.pilot/pull/712.patch","issue_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/issues/712","number":712,"state":"open","locked":false,"title":"Feature/netifaces","user":{"login":"marksantcroos","id":383387,"avatar_url":"https://avatars.githubusercontent.com/u/383387?v=3","gravatar_id":"","url":"https://api.github.com/users/marksantcroos","html_url":"https://github.com/marksantcroos","followers_url":"https://api.github.com/users/marksantcroos/followers","following_url":"https://api.github.com/users/marksantcroos/following{/other_user}","gists_url":"https://api.github.com/users/marksantcroos/gists{/gist_id}","starred_url":"https://api.github.com/users/marksantcroos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marksantcroos/subscriptions","organizations_url":"https://api.github.com/users/marksantcroos/orgs","repos_url":"https://api.github.com/users/marksantcroos/repos","events_url":"https://api.github.com/users/marksantcroos/events{/privacy}","received_events_url":"https://api.github.com/users/marksantcroos/received_events","type":"User","site_admin":false},"body":"This tries to tackle the ip/hostname troubles.\r\nHopefully the comments are self-explanatory.","created_at":"2015-09-09T16:42:12Z","updated_at":"2015-09-09T17:03:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"844589fc49bd556736789ab1a4893d1789d36c74","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls/712/commits","review_comments_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls/712/comments","review_comment_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/issues/712/comments","statuses_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/statuses/ae4eee036f067d0380b8a2ba0b1f28f3df62a570","head":{"label":"radical-cybertools:feature/netifaces","ref":"feature/netifaces","sha":"ae4eee036f067d0380b8a2ba0b1f28f3df62a570","user":{"login":"radical-cybertools","id":5244521,"avatar_url":"https://avatars.githubusercontent.com/u/5244521?v=3","gravatar_id":"","url":"https://api.github.com/users/radical-cybertools","html_url":"https://github.com/radical-cybertools","followers_url":"https://api.github.com/users/radical-cybertools/followers","following_url":"https://api.github.com/users/radical-cybertools/following{/other_user}","gists_url":"https://api.github.com/users/radical-cybertools/gists{/gist_id}","starred_url":"https://api.github.com/users/radical-cybertools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radical-cybertools/subscriptions","organizations_url":"https://api.github.com/users/radical-cybertools/orgs","repos_url":"https://api.github.com/users/radical-cybertools/repos","events_url":"https://api.github.com/users/radical-cybertools/events{/privacy}","received_events_url":"https://api.github.com/users/radical-cybertools/received_events","type":"Organization","site_admin":false},"repo":{"id":11224542,"name":"radical.pilot","full_name":"radical-cybertools/radical.pilot","owner":{"login":"radical-cybertools","id":5244521,"avatar_url":"https://avatars.githubusercontent.com/u/5244521?v=3","gravatar_id":"","url":"https://api.github.com/users/radical-cybertools","html_url":"https://github.com/radical-cybertools","followers_url":"https://api.github.com/users/radical-cybertools/followers","following_url":"https://api.github.com/users/radical-cybertools/following{/other_user}","gists_url":"https://api.github.com/users/radical-cybertools/gists{/gist_id}","starred_url":"https://api.github.com/users/radical-cybertools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radical-cybertools/subscriptions","organizations_url":"https://api.github.com/users/radical-cybertools/orgs","repos_url":"https://api.github.com/users/radical-cybertools/repos","events_url":"https://api.github.com/users/radical-cybertools/events{/privacy}","received_events_url":"https://api.github.com/users/radical-cybertools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/radical-cybertools/radical.pilot","description":"RADICAL-Pilot","fork":false,"url":"https://api.github.com/repos/radical-cybertools/radical.pilot","forks_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/forks","keys_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/teams","hooks_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/hooks","issue_events_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/issues/events{/number}","events_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/events","assignees_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/assignees{/user}","branches_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/branches{/branch}","tags_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/tags","blobs_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/git/refs{/sha}","trees_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/statuses/{sha}","languages_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/languages","stargazers_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/stargazers","contributors_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/contributors","subscribers_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/subscribers","subscription_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/subscription","commits_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/commits{/sha}","git_commits_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/git/commits{/sha}","comments_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/comments{/number}","issue_comment_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/issues/comments{/number}","contents_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/contents/{+path}","compare_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/merges","archive_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/downloads","issues_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/issues{/number}","pulls_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls{/number}","milestones_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/milestones{/number}","notifications_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/labels{/name}","releases_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/releases{/id}","created_at":"2013-07-06T21:14:41Z","updated_at":"2015-08-11T15:36:17Z","pushed_at":"2015-09-09T16:42:12Z","git_url":"git://github.com/radical-cybertools/radical.pilot.git","ssh_url":"git@github.com:radical-cybertools/radical.pilot.git","clone_url":"https://github.com/radical-cybertools/radical.pilot.git","svn_url":"https://github.com/radical-cybertools/radical.pilot","homepage":"http://radical-cybertools.github.io/radical-pilot/index.html","size":122733,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":170,"forks":3,"open_issues":170,"watchers":8,"default_branch":"devel"}},"base":{"label":"radical-cybertools:devel","ref":"devel","sha":"80ed676baa4f643b7e2a2f832160d53d6cdfcb59","user":{"login":"radical-cybertools","id":5244521,"avatar_url":"https://avatars.githubusercontent.com/u/5244521?v=3","gravatar_id":"","url":"https://api.github.com/users/radical-cybertools","html_url":"https://github.com/radical-cybertools","followers_url":"https://api.github.com/users/radical-cybertools/followers","following_url":"https://api.github.com/users/radical-cybertools/following{/other_user}","gists_url":"https://api.github.com/users/radical-cybertools/gists{/gist_id}","starred_url":"https://api.github.com/users/radical-cybertools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radical-cybertools/subscriptions","organizations_url":"https://api.github.com/users/radical-cybertools/orgs","repos_url":"https://api.github.com/users/radical-cybertools/repos","events_url":"https://api.github.com/users/radical-cybertools/events{/privacy}","received_events_url":"https://api.github.com/users/radical-cybertools/received_events","type":"Organization","site_admin":false},"repo":{"id":11224542,"name":"radical.pilot","full_name":"radical-cybertools/radical.pilot","owner":{"login":"radical-cybertools","id":5244521,"avatar_url":"https://avatars.githubusercontent.com/u/5244521?v=3","gravatar_id":"","url":"https://api.github.com/users/radical-cybertools","html_url":"https://github.com/radical-cybertools","followers_url":"https://api.github.com/users/radical-cybertools/followers","following_url":"https://api.github.com/users/radical-cybertools/following{/other_user}","gists_url":"https://api.github.com/users/radical-cybertools/gists{/gist_id}","starred_url":"https://api.github.com/users/radical-cybertools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radical-cybertools/subscriptions","organizations_url":"https://api.github.com/users/radical-cybertools/orgs","repos_url":"https://api.github.com/users/radical-cybertools/repos","events_url":"https://api.github.com/users/radical-cybertools/events{/privacy}","received_events_url":"https://api.github.com/users/radical-cybertools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/radical-cybertools/radical.pilot","description":"RADICAL-Pilot","fork":false,"url":"https://api.github.com/repos/radical-cybertools/radical.pilot","forks_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/forks","keys_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/teams","hooks_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/hooks","issue_events_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/issues/events{/number}","events_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/events","assignees_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/assignees{/user}","branches_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/branches{/branch}","tags_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/tags","blobs_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/git/refs{/sha}","trees_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/statuses/{sha}","languages_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/languages","stargazers_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/stargazers","contributors_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/contributors","subscribers_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/subscribers","subscription_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/subscription","commits_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/commits{/sha}","git_commits_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/git/commits{/sha}","comments_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/comments{/number}","issue_comment_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/issues/comments{/number}","contents_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/contents/{+path}","compare_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/merges","archive_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/downloads","issues_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/issues{/number}","pulls_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls{/number}","milestones_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/milestones{/number}","notifications_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/labels{/name}","releases_url":"https://api.github.com/repos/radical-cybertools/radical.pilot/releases{/id}","created_at":"2013-07-06T21:14:41Z","updated_at":"2015-08-11T15:36:17Z","pushed_at":"2015-09-09T16:42:12Z","git_url":"git://github.com/radical-cybertools/radical.pilot.git","ssh_url":"git@github.com:radical-cybertools/radical.pilot.git","clone_url":"https://github.com/radical-cybertools/radical.pilot.git","svn_url":"https://github.com/radical-cybertools/radical.pilot","homepage":"http://radical-cybertools.github.io/radical-pilot/index.html","size":122733,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":170,"forks":3,"open_issues":170,"watchers":8,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls/712"},"html":{"href":"https://github.com/radical-cybertools/radical.pilot/pull/712"},"issue":{"href":"https://api.github.com/repos/radical-cybertools/radical.pilot/issues/712"},"comments":{"href":"https://api.github.com/repos/radical-cybertools/radical.pilot/issues/712/comments"},"review_comments":{"href":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls/712/comments"},"review_comment":{"href":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/radical-cybertools/radical.pilot/pulls/712/commits"},"statuses":{"href":"https://api.github.com/repos/radical-cybertools/radical.pilot/statuses/ae4eee036f067d0380b8a2ba0b1f28f3df62a570"}}}}