{"action":"created","comment":{"url":"https://api.github.com/repos/PCManticore/argus-ci/pulls/comments/29750503","id":29750503,"diff_hunk":"@@ -144,33 +159,42 @@ def get_network_interfaces(self):\n         guest_nics = []\r\n         for network in self._networks or []:\r\n             network_id = network[\"uuid\"]\r\n-            details = net_client.show_network(network_id)[\"network\"]\r\n-            subnet_id = details[\"subnets\"][0]\r\n-            details = net_client.show_subnet(subnet_id)[\"subnet\"]\r\n-\r\n-            # The network interface should follow the format found under\r\n-            # `windows.InstanceIntrospection.get_network_interfaces` method.\r\n-            nic = {}\r\n-            nic[\"dhcp\"] = details[\"enable_dhcp\"]\r\n-            nic[\"dns\"] = details[\"dns_nameservers\"]\r\n-            nic[\"gateway\"] = details[\"gateway_ip\"]\r\n-            nic[\"netmask\"] = util.cidr2netmask(details[\"cidr\"])\r\n-\r\n-            # Find rest of the details under the ports using this subnet.\r\n-            # There should be no conflicts because on the current architecture\r\n-            # every instance is using its own router, subnet and network\r\n-            # accessible only to it.\r\n-            ports = net_client.list_ports()[\"ports\"]\r\n-            for port in ports:\r\n-                # Select instance related ports only, with the\r\n-                # corresponding subnet ID.\r\n-                if (\"compute\" not in port[\"device_owner\"] or\r\n-                        port[\"fixed_ips\"][0][\"subnet_id\"] != subnet_id):\r\n-                    continue\r\n-\r\n-                nic[\"mac\"] = port[\"mac_address\"].upper()\r\n-                nic[\"address\"] = port[\"fixed_ips\"][0][\"ip_address\"]\r\n-                break\r\n+            net_details = net_client.show_network(network_id)[\"network\"]\r\n+            nic = dict.fromkeys(util.NETWORK_KEYS)\r\n+            for subnet_id in net_details[\"subnets\"]:\r\n+                details = net_client.show_subnet(subnet_id)[\"subnet\"]\r\n+\r\n+                # The network interface should follow the format found under\r\n+                # `windows.InstanceIntrospection.get_network_interfaces`\r\n+                # method or `argus.util.NETWORK_KEYS` model.\r\n+                v6switch = details[\"ip_version\"] == 6\r\n+                v6suffix = lambda: \"6\" if v6switch else \"\"\r","path":"argus/scenarios/cloud.py","position":69,"original_position":69,"commit_id":"ab04bdf2eca59a875815ebb2fb98a6adbd0a9f85","original_commit_id":"ab04bdf2eca59a875815ebb2fb98a6adbd0a9f85","user":{"login":"PCManticore","id":448166,"avatar_url":"https://avatars.githubusercontent.com/u/448166?v=3","gravatar_id":"","url":"https://api.github.com/users/PCManticore","html_url":"https://github.com/PCManticore","followers_url":"https://api.github.com/users/PCManticore/followers","following_url":"https://api.github.com/users/PCManticore/following{/other_user}","gists_url":"https://api.github.com/users/PCManticore/gists{/gist_id}","starred_url":"https://api.github.com/users/PCManticore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PCManticore/subscriptions","organizations_url":"https://api.github.com/users/PCManticore/orgs","repos_url":"https://api.github.com/users/PCManticore/repos","events_url":"https://api.github.com/users/PCManticore/events{/privacy}","received_events_url":"https://api.github.com/users/PCManticore/received_events","type":"User","site_admin":false},"body":"Isn't ``v6suffis = \"6\" if v6switch else \"\"`` enough? Why does it have to be a callable?","created_at":"2015-05-06T11:17:37Z","updated_at":"2015-05-06T11:17:37Z","html_url":"https://github.com/PCManticore/argus-ci/pull/68#discussion_r29750503","pull_request_url":"https://api.github.com/repos/PCManticore/argus-ci/pulls/68","_links":{"self":{"href":"https://api.github.com/repos/PCManticore/argus-ci/pulls/comments/29750503"},"html":{"href":"https://github.com/PCManticore/argus-ci/pull/68#discussion_r29750503"},"pull_request":{"href":"https://api.github.com/repos/PCManticore/argus-ci/pulls/68"}}},"pull_request":{"url":"https://api.github.com/repos/PCManticore/argus-ci/pulls/68","id":34778290,"html_url":"https://github.com/PCManticore/argus-ci/pull/68","diff_url":"https://github.com/PCManticore/argus-ci/pull/68.diff","patch_url":"https://github.com/PCManticore/argus-ci/pull/68.patch","issue_url":"https://api.github.com/repos/PCManticore/argus-ci/issues/68","number":68,"state":"open","locked":false,"title":"v6 support","user":{"login":"cmin764","id":709053,"avatar_url":"https://avatars.githubusercontent.com/u/709053?v=3","gravatar_id":"","url":"https://api.github.com/users/cmin764","html_url":"https://github.com/cmin764","followers_url":"https://api.github.com/users/cmin764/followers","following_url":"https://api.github.com/users/cmin764/following{/other_user}","gists_url":"https://api.github.com/users/cmin764/gists{/gist_id}","starred_url":"https://api.github.com/users/cmin764/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmin764/subscriptions","organizations_url":"https://api.github.com/users/cmin764/orgs","repos_url":"https://api.github.com/users/cmin764/repos","events_url":"https://api.github.com/users/cmin764/events{/privacy}","received_events_url":"https://api.github.com/users/cmin764/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-05T23:40:12Z","updated_at":"2015-05-06T11:17:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2755796cdbaecb93523cbca2460796658c6b0f95","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PCManticore/argus-ci/pulls/68/commits","review_comments_url":"https://api.github.com/repos/PCManticore/argus-ci/pulls/68/comments","review_comment_url":"https://api.github.com/repos/PCManticore/argus-ci/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PCManticore/argus-ci/issues/68/comments","statuses_url":"https://api.github.com/repos/PCManticore/argus-ci/statuses/ab04bdf2eca59a875815ebb2fb98a6adbd0a9f85","head":{"label":"cmin764:feature/nic","ref":"feature/nic","sha":"ab04bdf2eca59a875815ebb2fb98a6adbd0a9f85","user":{"login":"cmin764","id":709053,"avatar_url":"https://avatars.githubusercontent.com/u/709053?v=3","gravatar_id":"","url":"https://api.github.com/users/cmin764","html_url":"https://github.com/cmin764","followers_url":"https://api.github.com/users/cmin764/followers","following_url":"https://api.github.com/users/cmin764/following{/other_user}","gists_url":"https://api.github.com/users/cmin764/gists{/gist_id}","starred_url":"https://api.github.com/users/cmin764/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmin764/subscriptions","organizations_url":"https://api.github.com/users/cmin764/orgs","repos_url":"https://api.github.com/users/cmin764/repos","events_url":"https://api.github.com/users/cmin764/events{/privacy}","received_events_url":"https://api.github.com/users/cmin764/received_events","type":"User","site_admin":false},"repo":{"id":29467776,"name":"argus-ci","full_name":"cmin764/argus-ci","owner":{"login":"cmin764","id":709053,"avatar_url":"https://avatars.githubusercontent.com/u/709053?v=3","gravatar_id":"","url":"https://api.github.com/users/cmin764","html_url":"https://github.com/cmin764","followers_url":"https://api.github.com/users/cmin764/followers","following_url":"https://api.github.com/users/cmin764/following{/other_user}","gists_url":"https://api.github.com/users/cmin764/gists{/gist_id}","starred_url":"https://api.github.com/users/cmin764/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmin764/subscriptions","organizations_url":"https://api.github.com/users/cmin764/orgs","repos_url":"https://api.github.com/users/cmin764/repos","events_url":"https://api.github.com/users/cmin764/events{/privacy}","received_events_url":"https://api.github.com/users/cmin764/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cmin764/argus-ci","description":"Tempest integration gate for CloudbaseInit","fork":true,"url":"https://api.github.com/repos/cmin764/argus-ci","forks_url":"https://api.github.com/repos/cmin764/argus-ci/forks","keys_url":"https://api.github.com/repos/cmin764/argus-ci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cmin764/argus-ci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cmin764/argus-ci/teams","hooks_url":"https://api.github.com/repos/cmin764/argus-ci/hooks","issue_events_url":"https://api.github.com/repos/cmin764/argus-ci/issues/events{/number}","events_url":"https://api.github.com/repos/cmin764/argus-ci/events","assignees_url":"https://api.github.com/repos/cmin764/argus-ci/assignees{/user}","branches_url":"https://api.github.com/repos/cmin764/argus-ci/branches{/branch}","tags_url":"https://api.github.com/repos/cmin764/argus-ci/tags","blobs_url":"https://api.github.com/repos/cmin764/argus-ci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cmin764/argus-ci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cmin764/argus-ci/git/refs{/sha}","trees_url":"https://api.github.com/repos/cmin764/argus-ci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cmin764/argus-ci/statuses/{sha}","languages_url":"https://api.github.com/repos/cmin764/argus-ci/languages","stargazers_url":"https://api.github.com/repos/cmin764/argus-ci/stargazers","contributors_url":"https://api.github.com/repos/cmin764/argus-ci/contributors","subscribers_url":"https://api.github.com/repos/cmin764/argus-ci/subscribers","subscription_url":"https://api.github.com/repos/cmin764/argus-ci/subscription","commits_url":"https://api.github.com/repos/cmin764/argus-ci/commits{/sha}","git_commits_url":"https://api.github.com/repos/cmin764/argus-ci/git/commits{/sha}","comments_url":"https://api.github.com/repos/cmin764/argus-ci/comments{/number}","issue_comment_url":"https://api.github.com/repos/cmin764/argus-ci/issues/comments{/number}","contents_url":"https://api.github.com/repos/cmin764/argus-ci/contents/{+path}","compare_url":"https://api.github.com/repos/cmin764/argus-ci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cmin764/argus-ci/merges","archive_url":"https://api.github.com/repos/cmin764/argus-ci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cmin764/argus-ci/downloads","issues_url":"https://api.github.com/repos/cmin764/argus-ci/issues{/number}","pulls_url":"https://api.github.com/repos/cmin764/argus-ci/pulls{/number}","milestones_url":"https://api.github.com/repos/cmin764/argus-ci/milestones{/number}","notifications_url":"https://api.github.com/repos/cmin764/argus-ci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cmin764/argus-ci/labels{/name}","releases_url":"https://api.github.com/repos/cmin764/argus-ci/releases{/id}","created_at":"2015-01-19T11:30:48Z","updated_at":"2015-03-11T11:09:01Z","pushed_at":"2015-05-06T11:02:14Z","git_url":"git://github.com/cmin764/argus-ci.git","ssh_url":"git@github.com:cmin764/argus-ci.git","clone_url":"https://github.com/cmin764/argus-ci.git","svn_url":"https://github.com/cmin764/argus-ci","homepage":null,"size":2023,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"PCManticore:develop","ref":"develop","sha":"ada2606e3d9ae854b406dcc74f1c6141b0b316b9","user":{"login":"PCManticore","id":448166,"avatar_url":"https://avatars.githubusercontent.com/u/448166?v=3","gravatar_id":"","url":"https://api.github.com/users/PCManticore","html_url":"https://github.com/PCManticore","followers_url":"https://api.github.com/users/PCManticore/followers","following_url":"https://api.github.com/users/PCManticore/following{/other_user}","gists_url":"https://api.github.com/users/PCManticore/gists{/gist_id}","starred_url":"https://api.github.com/users/PCManticore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PCManticore/subscriptions","organizations_url":"https://api.github.com/users/PCManticore/orgs","repos_url":"https://api.github.com/users/PCManticore/repos","events_url":"https://api.github.com/users/PCManticore/events{/privacy}","received_events_url":"https://api.github.com/users/PCManticore/received_events","type":"User","site_admin":false},"repo":{"id":27723379,"name":"argus-ci","full_name":"PCManticore/argus-ci","owner":{"login":"PCManticore","id":448166,"avatar_url":"https://avatars.githubusercontent.com/u/448166?v=3","gravatar_id":"","url":"https://api.github.com/users/PCManticore","html_url":"https://github.com/PCManticore","followers_url":"https://api.github.com/users/PCManticore/followers","following_url":"https://api.github.com/users/PCManticore/following{/other_user}","gists_url":"https://api.github.com/users/PCManticore/gists{/gist_id}","starred_url":"https://api.github.com/users/PCManticore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PCManticore/subscriptions","organizations_url":"https://api.github.com/users/PCManticore/orgs","repos_url":"https://api.github.com/users/PCManticore/repos","events_url":"https://api.github.com/users/PCManticore/events{/privacy}","received_events_url":"https://api.github.com/users/PCManticore/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PCManticore/argus-ci","description":"Tempest integration gate for CloudbaseInit","fork":false,"url":"https://api.github.com/repos/PCManticore/argus-ci","forks_url":"https://api.github.com/repos/PCManticore/argus-ci/forks","keys_url":"https://api.github.com/repos/PCManticore/argus-ci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PCManticore/argus-ci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PCManticore/argus-ci/teams","hooks_url":"https://api.github.com/repos/PCManticore/argus-ci/hooks","issue_events_url":"https://api.github.com/repos/PCManticore/argus-ci/issues/events{/number}","events_url":"https://api.github.com/repos/PCManticore/argus-ci/events","assignees_url":"https://api.github.com/repos/PCManticore/argus-ci/assignees{/user}","branches_url":"https://api.github.com/repos/PCManticore/argus-ci/branches{/branch}","tags_url":"https://api.github.com/repos/PCManticore/argus-ci/tags","blobs_url":"https://api.github.com/repos/PCManticore/argus-ci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PCManticore/argus-ci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PCManticore/argus-ci/git/refs{/sha}","trees_url":"https://api.github.com/repos/PCManticore/argus-ci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PCManticore/argus-ci/statuses/{sha}","languages_url":"https://api.github.com/repos/PCManticore/argus-ci/languages","stargazers_url":"https://api.github.com/repos/PCManticore/argus-ci/stargazers","contributors_url":"https://api.github.com/repos/PCManticore/argus-ci/contributors","subscribers_url":"https://api.github.com/repos/PCManticore/argus-ci/subscribers","subscription_url":"https://api.github.com/repos/PCManticore/argus-ci/subscription","commits_url":"https://api.github.com/repos/PCManticore/argus-ci/commits{/sha}","git_commits_url":"https://api.github.com/repos/PCManticore/argus-ci/git/commits{/sha}","comments_url":"https://api.github.com/repos/PCManticore/argus-ci/comments{/number}","issue_comment_url":"https://api.github.com/repos/PCManticore/argus-ci/issues/comments{/number}","contents_url":"https://api.github.com/repos/PCManticore/argus-ci/contents/{+path}","compare_url":"https://api.github.com/repos/PCManticore/argus-ci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PCManticore/argus-ci/merges","archive_url":"https://api.github.com/repos/PCManticore/argus-ci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PCManticore/argus-ci/downloads","issues_url":"https://api.github.com/repos/PCManticore/argus-ci/issues{/number}","pulls_url":"https://api.github.com/repos/PCManticore/argus-ci/pulls{/number}","milestones_url":"https://api.github.com/repos/PCManticore/argus-ci/milestones{/number}","notifications_url":"https://api.github.com/repos/PCManticore/argus-ci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PCManticore/argus-ci/labels{/name}","releases_url":"https://api.github.com/repos/PCManticore/argus-ci/releases{/id}","created_at":"2014-12-08T16:19:03Z","updated_at":"2015-03-10T13:16:03Z","pushed_at":"2015-05-06T11:02:10Z","git_url":"git://github.com/PCManticore/argus-ci.git","ssh_url":"git@github.com:PCManticore/argus-ci.git","clone_url":"https://github.com/PCManticore/argus-ci.git","svn_url":"https://github.com/PCManticore/argus-ci","homepage":null,"size":2784,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PCManticore/argus-ci/pulls/68"},"html":{"href":"https://github.com/PCManticore/argus-ci/pull/68"},"issue":{"href":"https://api.github.com/repos/PCManticore/argus-ci/issues/68"},"comments":{"href":"https://api.github.com/repos/PCManticore/argus-ci/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/PCManticore/argus-ci/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/PCManticore/argus-ci/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PCManticore/argus-ci/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/PCManticore/argus-ci/statuses/ab04bdf2eca59a875815ebb2fb98a6adbd0a9f85"}}}}