{"action":"created","comment":{"url":"https://api.github.com/repos/ansible/ansible/pulls/comments/95466597","pull_request_review_id":16022257,"id":95466597,"diff_hunk":"@@ -883,34 +888,44 @@ def configure_network(self, vm_obj):\n             return\n \n         network_devices = list()\n-        for network in self.params['networks']:\n-            if network:\n-                if 'ip' in self.params['networks'][network]:\n-                    ip = self.params['networks'][network]['ip']\n-                    if ip not in IPNetwork(network):\n-                        self.module.fail_json(msg=\"ip '%s' not in network %s\" % (ip, network))\n-\n-                    ipnet = IPNetwork(network)\n-                    self.params['networks'][network]['subnet_mask'] = str(ipnet.netmask)\n-\n-                if 'network' in self.params['networks'][network]:\n-                    if get_obj(self.content, [vim.Network], self.params['networks'][network]['network']) is None:\n-                        self.module.fail_json(msg=\"Network %s doesn't exists\" % network)\n-                elif 'vlan' in self.params['networks'][network]:\n-                    network_name = None\n-                    dvps = get_all_objs(self.content, [vim.dvs.DistributedVirtualPortgroup])\n-                    for dvp in dvps:\n-                        if dvp.config.defaultPortConfig.vlan.vlanId == self.params['networks'][network]['vlan']:\n-                            network_name = dvp.config.name\n-                            break\n-                    if network_name:\n-                        self.params['networks'][network]['network'] = network_name\n-                    else:\n-                        self.module.fail_json(msg=\"VLAN %(vlan)s doesn't exists\" % self.params['networks'][network])\n+        for network in self.params.get('networks', list()):\n+            if 'ip' in network:\n+\n+                if 'netmask' in network:\n+                    pass\n+\n+                # TODO: What if netmask and network are provided but conflict ?","path":"lib/ansible/modules/cloud/vmware/vmware_guest.py","position":83,"original_position":86,"commit_id":"66453d989f46a643709e950af3d74d8a9d2dfa7a","original_commit_id":"f7fef00848d980400570a4060646b64e1856bca6","user":{"login":"dagwieers","id":388198,"avatar_url":"https://avatars.githubusercontent.com/u/388198?v=3","gravatar_id":"","url":"https://api.github.com/users/dagwieers","html_url":"https://github.com/dagwieers","followers_url":"https://api.github.com/users/dagwieers/followers","following_url":"https://api.github.com/users/dagwieers/following{/other_user}","gists_url":"https://api.github.com/users/dagwieers/gists{/gist_id}","starred_url":"https://api.github.com/users/dagwieers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagwieers/subscriptions","organizations_url":"https://api.github.com/users/dagwieers/orgs","repos_url":"https://api.github.com/users/dagwieers/repos","events_url":"https://api.github.com/users/dagwieers/events{/privacy}","received_events_url":"https://api.github.com/users/dagwieers/received_events","type":"User","site_admin":false},"body":"Well, I would rather make the interface more simple and not give the choice.\r\nI think @nerzhul suggested this earlier as well, we both prefer a CIDR over a netmask.","created_at":"2017-01-10T21:55:29Z","updated_at":"2017-01-10T21:55:29Z","html_url":"https://github.com/ansible/ansible/pull/19857#discussion_r95466597","pull_request_url":"https://api.github.com/repos/ansible/ansible/pulls/19857","_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/95466597"},"html":{"href":"https://github.com/ansible/ansible/pull/19857#discussion_r95466597"},"pull_request":{"href":"https://api.github.com/repos/ansible/ansible/pulls/19857"}}},"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/19857","id":100101355,"html_url":"https://github.com/ansible/ansible/pull/19857","diff_url":"https://github.com/ansible/ansible/pull/19857.diff","patch_url":"https://github.com/ansible/ansible/pull/19857.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/19857","number":19857,"state":"open","locked":false,"title":"vmware_guest: networks definition as a list","user":{"login":"dagwieers","id":388198,"avatar_url":"https://avatars.githubusercontent.com/u/388198?v=3","gravatar_id":"","url":"https://api.github.com/users/dagwieers","html_url":"https://github.com/dagwieers","followers_url":"https://api.github.com/users/dagwieers/followers","following_url":"https://api.github.com/users/dagwieers/following{/other_user}","gists_url":"https://api.github.com/users/dagwieers/gists{/gist_id}","starred_url":"https://api.github.com/users/dagwieers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagwieers/subscriptions","organizations_url":"https://api.github.com/users/dagwieers/orgs","repos_url":"https://api.github.com/users/dagwieers/repos","events_url":"https://api.github.com/users/dagwieers/events{/privacy}","received_events_url":"https://api.github.com/users/dagwieers/received_events","type":"User","site_admin":false},"body":"##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bugfix Pull Request\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the module/plugin/module/task -->\r\nvmware_guest\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\nv2.3\r\n\r\n##### SUMMARY\r\n<!--- Describe the change, including rationale and design decisions -->\r\n\r\n<!---\r\nIf you are fixing an existing issue, please include \"Fixes #nnn\" in your\r\ncommit message and your description; but you should still explain what\r\nthe change does.\r\n-->\r\n\r\n<!-- Paste verbatim command output below, e.g. before and after your change -->\r\nCurrently the networks definition is a dict, with the network range as\r\nkey. This is problematic if the network information is coming from other\r\nsources.\r\n\r\nThis patch turns the networks definition into a list.\r\n\r\nThis fixes #19222.","created_at":"2017-01-04T11:36:27Z","updated_at":"2017-01-10T21:55:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8e4184b63640cb3a74b113a40e162d9c7fbdd54","assignee":{"login":"jctanner","id":1869705,"avatar_url":"https://avatars.githubusercontent.com/u/1869705?v=3","gravatar_id":"","url":"https://api.github.com/users/jctanner","html_url":"https://github.com/jctanner","followers_url":"https://api.github.com/users/jctanner/followers","following_url":"https://api.github.com/users/jctanner/following{/other_user}","gists_url":"https://api.github.com/users/jctanner/gists{/gist_id}","starred_url":"https://api.github.com/users/jctanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jctanner/subscriptions","organizations_url":"https://api.github.com/users/jctanner/orgs","repos_url":"https://api.github.com/users/jctanner/repos","events_url":"https://api.github.com/users/jctanner/events{/privacy}","received_events_url":"https://api.github.com/users/jctanner/received_events","type":"User","site_admin":false},"assignees":[{"login":"jctanner","id":1869705,"avatar_url":"https://avatars.githubusercontent.com/u/1869705?v=3","gravatar_id":"","url":"https://api.github.com/users/jctanner","html_url":"https://github.com/jctanner","followers_url":"https://api.github.com/users/jctanner/followers","following_url":"https://api.github.com/users/jctanner/following{/other_user}","gists_url":"https://api.github.com/users/jctanner/gists{/gist_id}","starred_url":"https://api.github.com/users/jctanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jctanner/subscriptions","organizations_url":"https://api.github.com/users/jctanner/orgs","repos_url":"https://api.github.com/users/jctanner/repos","events_url":"https://api.github.com/users/jctanner/events{/privacy}","received_events_url":"https://api.github.com/users/jctanner/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/19857/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/19857/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/19857/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/66453d989f46a643709e950af3d74d8a9d2dfa7a","head":{"label":"dagwieers:vmware_guest-networks","ref":"vmware_guest-networks","sha":"66453d989f46a643709e950af3d74d8a9d2dfa7a","user":{"login":"dagwieers","id":388198,"avatar_url":"https://avatars.githubusercontent.com/u/388198?v=3","gravatar_id":"","url":"https://api.github.com/users/dagwieers","html_url":"https://github.com/dagwieers","followers_url":"https://api.github.com/users/dagwieers/followers","following_url":"https://api.github.com/users/dagwieers/following{/other_user}","gists_url":"https://api.github.com/users/dagwieers/gists{/gist_id}","starred_url":"https://api.github.com/users/dagwieers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagwieers/subscriptions","organizations_url":"https://api.github.com/users/dagwieers/orgs","repos_url":"https://api.github.com/users/dagwieers/repos","events_url":"https://api.github.com/users/dagwieers/events{/privacy}","received_events_url":"https://api.github.com/users/dagwieers/received_events","type":"User","site_admin":false},"repo":{"id":3764960,"name":"ansible","full_name":"dagwieers/ansible","owner":{"login":"dagwieers","id":388198,"avatar_url":"https://avatars.githubusercontent.com/u/388198?v=3","gravatar_id":"","url":"https://api.github.com/users/dagwieers","html_url":"https://github.com/dagwieers","followers_url":"https://api.github.com/users/dagwieers/followers","following_url":"https://api.github.com/users/dagwieers/following{/other_user}","gists_url":"https://api.github.com/users/dagwieers/gists{/gist_id}","starred_url":"https://api.github.com/users/dagwieers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagwieers/subscriptions","organizations_url":"https://api.github.com/users/dagwieers/orgs","repos_url":"https://api.github.com/users/dagwieers/repos","events_url":"https://api.github.com/users/dagwieers/events{/privacy}","received_events_url":"https://api.github.com/users/dagwieers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dagwieers/ansible","description":"Model-driven configuration management, multi-node deployment, and remote task execution system. Uses SSH by default, so there is no special software has to be installed on the nodes you manage. Ansible can be extended in any language. Note: The default branch is the development branch, if you need a stable version, see the release-XX branches, tags, or downloads.","fork":true,"url":"https://api.github.com/repos/dagwieers/ansible","forks_url":"https://api.github.com/repos/dagwieers/ansible/forks","keys_url":"https://api.github.com/repos/dagwieers/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dagwieers/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dagwieers/ansible/teams","hooks_url":"https://api.github.com/repos/dagwieers/ansible/hooks","issue_events_url":"https://api.github.com/repos/dagwieers/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/dagwieers/ansible/events","assignees_url":"https://api.github.com/repos/dagwieers/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/dagwieers/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/dagwieers/ansible/tags","blobs_url":"https://api.github.com/repos/dagwieers/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dagwieers/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dagwieers/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/dagwieers/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dagwieers/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/dagwieers/ansible/languages","stargazers_url":"https://api.github.com/repos/dagwieers/ansible/stargazers","contributors_url":"https://api.github.com/repos/dagwieers/ansible/contributors","subscribers_url":"https://api.github.com/repos/dagwieers/ansible/subscribers","subscription_url":"https://api.github.com/repos/dagwieers/ansible/subscription","commits_url":"https://api.github.com/repos/dagwieers/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/dagwieers/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/dagwieers/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/dagwieers/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/dagwieers/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/dagwieers/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dagwieers/ansible/merges","archive_url":"https://api.github.com/repos/dagwieers/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dagwieers/ansible/downloads","issues_url":"https://api.github.com/repos/dagwieers/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/dagwieers/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/dagwieers/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/dagwieers/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dagwieers/ansible/labels{/name}","releases_url":"https://api.github.com/repos/dagwieers/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/dagwieers/ansible/deployments","created_at":"2012-03-19T15:04:07Z","updated_at":"2016-12-12T13:59:41Z","pushed_at":"2017-01-10T21:48:46Z","git_url":"git://github.com/dagwieers/ansible.git","ssh_url":"git@github.com:dagwieers/ansible.git","clone_url":"https://github.com/dagwieers/ansible.git","svn_url":"https://github.com/dagwieers/ansible","homepage":"http://ansible.cc","size":53479,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"f928696b5d8c1083b5653edf3d350d99a8a01f59","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"repo":{"id":3638964,"name":"ansible","full_name":"ansible/ansible","owner":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ansible/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":false,"url":"https://api.github.com/repos/ansible/ansible","forks_url":"https://api.github.com/repos/ansible/ansible/forks","keys_url":"https://api.github.com/repos/ansible/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/ansible/teams","hooks_url":"https://api.github.com/repos/ansible/ansible/hooks","issue_events_url":"https://api.github.com/repos/ansible/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/ansible/events","assignees_url":"https://api.github.com/repos/ansible/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/ansible/tags","blobs_url":"https://api.github.com/repos/ansible/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/ansible/languages","stargazers_url":"https://api.github.com/repos/ansible/ansible/stargazers","contributors_url":"https://api.github.com/repos/ansible/ansible/contributors","subscribers_url":"https://api.github.com/repos/ansible/ansible/subscribers","subscription_url":"https://api.github.com/repos/ansible/ansible/subscription","commits_url":"https://api.github.com/repos/ansible/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ansible/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/ansible/merges","archive_url":"https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/ansible/downloads","issues_url":"https://api.github.com/repos/ansible/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/ansible/labels{/name}","releases_url":"https://api.github.com/repos/ansible/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/ansible/ansible/deployments","created_at":"2012-03-06T14:58:02Z","updated_at":"2017-01-10T20:46:15Z","pushed_at":"2017-01-10T21:49:54Z","git_url":"git://github.com/ansible/ansible.git","ssh_url":"git@github.com:ansible/ansible.git","clone_url":"https://github.com/ansible/ansible.git","svn_url":"https://github.com/ansible/ansible","homepage":"http://ansible.com/","size":63270,"stargazers_count":20724,"watchers_count":20724,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6500,"mirror_url":null,"open_issues_count":2115,"forks":6500,"open_issues":2115,"watchers":20724,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/19857"},"html":{"href":"https://github.com/ansible/ansible/pull/19857"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/19857"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/19857/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/19857/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/19857/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/66453d989f46a643709e950af3d74d8a9d2dfa7a"}}}}
{"actor":{"display_login":"dagwieers"}}