{"action":"created","comment":{"url":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls/comments/63677043","id":63677043,"diff_hunk":"@@ -307,3 +308,41 @@ def _asr_do_remove_floating_ip(self, ri, floating_ip,\n         self._edit_running_config(confstr,\n                                   'REMOVE_STATIC_SRC_TRL_NO_VRF_MATCH')\n         self._asr_do_remove_secondary_ip(ri, floating_ip, ex_gw_port)\n+\n+    def _do_set_snat_pool(self, pool_name, pool_start,\n+                          pool_end, pool_net, is_delete):\n+        try:\n+            if is_delete:\n+                conf_str = asr1k_snippets.DELETE_NAT_POOL % (\n+                    pool_name, pool_start, pool_end, pool_net.netmask)\n+                # TODO(update so that hosting device name is passed down)\n+                self._edit_running_config(conf_str, 'DELETE_NAT_POOL')\n+\n+            else:\n+                conf_str = asr1k_snippets.CREATE_NAT_POOL % (\n+                    pool_name, pool_start, pool_end, pool_net.netmask)\n+                # TODO(update so that hosting device name is passed down)\n+                self._edit_running_config(conf_str, 'CREATE_NAT_POOL')\n+        except Exception as cse:\n+            LOG.error(_LE(\"Temporary disable NAT_POOL exception handling: \"\n+                          \"%s\"), cse)\n+\n+    def _set_snat_pools_from_hosting_info(self, ri, gw_port, is_delete):\n+        # TODO(tbachma ): unique naming for more than one pool\n+        vrf_name = self._get_vrf_name(ri)\n+        for net_id in gw_port['hosting_info'].get('snat_subnet_ids', []):\n+            for subnet in gw_port['extra_subnets']:\n+                if subnet['id'] == net_id:\n+                    net = netaddr.IPNetwork(subnet['cidr'])\n+                    pool_start = str(netaddr.IPAddress(net.first + 2))\n+                    pool_end = str(netaddr.IPAddress(net.last - 1))\n+                    pool_name = \"%s_nat_pool\" % (vrf_name)","path":"networking_cisco/plugins/cisco/cfg_agent/device_drivers/asr1k/aci_asr1k_routing_driver.py","position":51,"original_position":51,"commit_id":"5535dc21f61d04d81cc20ef5099633e07f9ccabf","original_commit_id":"5535dc21f61d04d81cc20ef5099633e07f9ccabf","user":{"login":"tbachman","id":5181955,"avatar_url":"https://avatars.githubusercontent.com/u/5181955?v=3","gravatar_id":"","url":"https://api.github.com/users/tbachman","html_url":"https://github.com/tbachman","followers_url":"https://api.github.com/users/tbachman/followers","following_url":"https://api.github.com/users/tbachman/following{/other_user}","gists_url":"https://api.github.com/users/tbachman/gists{/gist_id}","starred_url":"https://api.github.com/users/tbachman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbachman/subscriptions","organizations_url":"https://api.github.com/users/tbachman/orgs","repos_url":"https://api.github.com/users/tbachman/repos","events_url":"https://api.github.com/users/tbachman/events{/privacy}","received_events_url":"https://api.github.com/users/tbachman/received_events","type":"User","site_admin":false},"body":"Yes -- pool_name should be uniquified. I'll fix that.","created_at":"2016-05-18T10:06:14Z","updated_at":"2016-05-18T10:06:15Z","html_url":"https://github.com/CiscoSystems/networking-cisco/pull/29#discussion_r63677043","pull_request_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls/comments/63677043"},"html":{"href":"https://github.com/CiscoSystems/networking-cisco/pull/29#discussion_r63677043"},"pull_request":{"href":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls/29","id":70415992,"html_url":"https://github.com/CiscoSystems/networking-cisco/pull/29","diff_url":"https://github.com/CiscoSystems/networking-cisco/pull/29.diff","patch_url":"https://github.com/CiscoSystems/networking-cisco/pull/29.patch","issue_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/issues/29","number":29,"state":"open","locked":false,"title":"Add configuration of SNAT pool","user":{"login":"tbachman","id":5181955,"avatar_url":"https://avatars.githubusercontent.com/u/5181955?v=3","gravatar_id":"","url":"https://api.github.com/users/tbachman","html_url":"https://github.com/tbachman","followers_url":"https://api.github.com/users/tbachman/followers","following_url":"https://api.github.com/users/tbachman/following{/other_user}","gists_url":"https://api.github.com/users/tbachman/gists{/gist_id}","starred_url":"https://api.github.com/users/tbachman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbachman/subscriptions","organizations_url":"https://api.github.com/users/tbachman/orgs","repos_url":"https://api.github.com/users/tbachman/repos","events_url":"https://api.github.com/users/tbachman/events{/privacy}","received_events_url":"https://api.github.com/users/tbachman/received_events","type":"User","site_admin":false},"body":"The existing ASR code uses the router gateway IP address\r\nfor SNAT, doing port-based SNAT. For integrations with ACI,\r\nsupport is expanded to use a range/CIDR for the pool.\r\n\r\nSigned-off-by: Thomas Bachman <tbachman@yahoo.com>","created_at":"2016-05-17T19:31:13Z","updated_at":"2016-05-18T10:06:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"843831d989876a95956dcd408979027065ac786c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls/29/commits","review_comments_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls/29/comments","review_comment_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/issues/29/comments","statuses_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/statuses/5535dc21f61d04d81cc20ef5099633e07f9ccabf","head":{"label":"CiscoSystems:dev/gbp-snat","ref":"dev/gbp-snat","sha":"5535dc21f61d04d81cc20ef5099633e07f9ccabf","user":{"login":"CiscoSystems","id":928837,"avatar_url":"https://avatars.githubusercontent.com/u/928837?v=3","gravatar_id":"","url":"https://api.github.com/users/CiscoSystems","html_url":"https://github.com/CiscoSystems","followers_url":"https://api.github.com/users/CiscoSystems/followers","following_url":"https://api.github.com/users/CiscoSystems/following{/other_user}","gists_url":"https://api.github.com/users/CiscoSystems/gists{/gist_id}","starred_url":"https://api.github.com/users/CiscoSystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CiscoSystems/subscriptions","organizations_url":"https://api.github.com/users/CiscoSystems/orgs","repos_url":"https://api.github.com/users/CiscoSystems/repos","events_url":"https://api.github.com/users/CiscoSystems/events{/privacy}","received_events_url":"https://api.github.com/users/CiscoSystems/received_events","type":"Organization","site_admin":false},"repo":{"id":34876459,"name":"networking-cisco","full_name":"CiscoSystems/networking-cisco","owner":{"login":"CiscoSystems","id":928837,"avatar_url":"https://avatars.githubusercontent.com/u/928837?v=3","gravatar_id":"","url":"https://api.github.com/users/CiscoSystems","html_url":"https://github.com/CiscoSystems","followers_url":"https://api.github.com/users/CiscoSystems/followers","following_url":"https://api.github.com/users/CiscoSystems/following{/other_user}","gists_url":"https://api.github.com/users/CiscoSystems/gists{/gist_id}","starred_url":"https://api.github.com/users/CiscoSystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CiscoSystems/subscriptions","organizations_url":"https://api.github.com/users/CiscoSystems/orgs","repos_url":"https://api.github.com/users/CiscoSystems/repos","events_url":"https://api.github.com/users/CiscoSystems/events{/privacy}","received_events_url":"https://api.github.com/users/CiscoSystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CiscoSystems/networking-cisco","description":"Cisco Vendor Code for Neutron","fork":true,"url":"https://api.github.com/repos/CiscoSystems/networking-cisco","forks_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/forks","keys_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/teams","hooks_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/hooks","issue_events_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/issues/events{/number}","events_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/events","assignees_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/assignees{/user}","branches_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/branches{/branch}","tags_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/tags","blobs_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/git/refs{/sha}","trees_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/statuses/{sha}","languages_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/languages","stargazers_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/stargazers","contributors_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/contributors","subscribers_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/subscribers","subscription_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/subscription","commits_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/commits{/sha}","git_commits_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/git/commits{/sha}","comments_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/comments{/number}","issue_comment_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/issues/comments{/number}","contents_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/contents/{+path}","compare_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/merges","archive_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/downloads","issues_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/issues{/number}","pulls_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls{/number}","milestones_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/milestones{/number}","notifications_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/labels{/name}","releases_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/releases{/id}","deployments_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/deployments","created_at":"2015-04-30T20:58:11Z","updated_at":"2016-04-23T12:07:50Z","pushed_at":"2016-05-18T01:47:17Z","git_url":"git://github.com/CiscoSystems/networking-cisco.git","ssh_url":"git@github.com:CiscoSystems/networking-cisco.git","clone_url":"https://github.com/CiscoSystems/networking-cisco.git","svn_url":"https://github.com/CiscoSystems/networking-cisco","homepage":"http://openstack.org","size":3781,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":2,"default_branch":"asr1k_liberty_master_wip"}},"base":{"label":"CiscoSystems:asr1k_stable_kilo_wip2","ref":"asr1k_stable_kilo_wip2","sha":"9fbacca8d451527f7cb166e7fd2fe9dc98220403","user":{"login":"CiscoSystems","id":928837,"avatar_url":"https://avatars.githubusercontent.com/u/928837?v=3","gravatar_id":"","url":"https://api.github.com/users/CiscoSystems","html_url":"https://github.com/CiscoSystems","followers_url":"https://api.github.com/users/CiscoSystems/followers","following_url":"https://api.github.com/users/CiscoSystems/following{/other_user}","gists_url":"https://api.github.com/users/CiscoSystems/gists{/gist_id}","starred_url":"https://api.github.com/users/CiscoSystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CiscoSystems/subscriptions","organizations_url":"https://api.github.com/users/CiscoSystems/orgs","repos_url":"https://api.github.com/users/CiscoSystems/repos","events_url":"https://api.github.com/users/CiscoSystems/events{/privacy}","received_events_url":"https://api.github.com/users/CiscoSystems/received_events","type":"Organization","site_admin":false},"repo":{"id":34876459,"name":"networking-cisco","full_name":"CiscoSystems/networking-cisco","owner":{"login":"CiscoSystems","id":928837,"avatar_url":"https://avatars.githubusercontent.com/u/928837?v=3","gravatar_id":"","url":"https://api.github.com/users/CiscoSystems","html_url":"https://github.com/CiscoSystems","followers_url":"https://api.github.com/users/CiscoSystems/followers","following_url":"https://api.github.com/users/CiscoSystems/following{/other_user}","gists_url":"https://api.github.com/users/CiscoSystems/gists{/gist_id}","starred_url":"https://api.github.com/users/CiscoSystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CiscoSystems/subscriptions","organizations_url":"https://api.github.com/users/CiscoSystems/orgs","repos_url":"https://api.github.com/users/CiscoSystems/repos","events_url":"https://api.github.com/users/CiscoSystems/events{/privacy}","received_events_url":"https://api.github.com/users/CiscoSystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CiscoSystems/networking-cisco","description":"Cisco Vendor Code for Neutron","fork":true,"url":"https://api.github.com/repos/CiscoSystems/networking-cisco","forks_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/forks","keys_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/teams","hooks_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/hooks","issue_events_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/issues/events{/number}","events_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/events","assignees_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/assignees{/user}","branches_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/branches{/branch}","tags_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/tags","blobs_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/git/refs{/sha}","trees_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/statuses/{sha}","languages_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/languages","stargazers_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/stargazers","contributors_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/contributors","subscribers_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/subscribers","subscription_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/subscription","commits_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/commits{/sha}","git_commits_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/git/commits{/sha}","comments_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/comments{/number}","issue_comment_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/issues/comments{/number}","contents_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/contents/{+path}","compare_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/merges","archive_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/downloads","issues_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/issues{/number}","pulls_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls{/number}","milestones_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/milestones{/number}","notifications_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/labels{/name}","releases_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/releases{/id}","deployments_url":"https://api.github.com/repos/CiscoSystems/networking-cisco/deployments","created_at":"2015-04-30T20:58:11Z","updated_at":"2016-04-23T12:07:50Z","pushed_at":"2016-05-18T01:47:17Z","git_url":"git://github.com/CiscoSystems/networking-cisco.git","ssh_url":"git@github.com:CiscoSystems/networking-cisco.git","clone_url":"https://github.com/CiscoSystems/networking-cisco.git","svn_url":"https://github.com/CiscoSystems/networking-cisco","homepage":"http://openstack.org","size":3781,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":2,"default_branch":"asr1k_liberty_master_wip"}},"_links":{"self":{"href":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls/29"},"html":{"href":"https://github.com/CiscoSystems/networking-cisco/pull/29"},"issue":{"href":"https://api.github.com/repos/CiscoSystems/networking-cisco/issues/29"},"comments":{"href":"https://api.github.com/repos/CiscoSystems/networking-cisco/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CiscoSystems/networking-cisco/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/CiscoSystems/networking-cisco/statuses/5535dc21f61d04d81cc20ef5099633e07f9ccabf"}}}}