{"action":"created","comment":{"url":"https://api.github.com/repos/juju-solutions/vpe-router/pulls/comments/50713826","id":50713826,"diff_hunk":"@@ -96,6 +96,101 @@ def add_corporation():\n               iface_vlanid)\n \n \n+@when('vpe.delete-corporation')\n+def delete_corporation():\n+\n+    domain_name = action_get('domain-name')\n+\n+    # Remove all tunnels defined for this domain\n+    p = router._run([\n+        'ip',\n+        'netns',\n+        'exec',\n+        'domain_name',\n+        'ip',\n+        'tun',\n+        'show',\n+        '|',\n+        'grep',\n+        'gre',\n+        '|',\n+        'grep',\n+        '-v',\n+        '\"remote any\"',\n+        '|',\n+        'cut -d\":\" -f1'\n+    ])\n+\n+    # `p` should be a tuple of (stdout, stderr)\n+    tunnels = p[0]\n+\n+    for tunnel in tunnels:\n+        router.ip(\n+            'netns',\n+            'exec',\n+            domain_name,\n+            'ip',\n+            'link',\n+            'set',\n+            tunnel,\n+            'down'\n+        )\n+\n+        router.ip(\n+            'netns',\n+            'exec',\n+            domain_name,\n+            'ip',\n+            'tunnel',\n+            'del',\n+            tunnel\n+        )\n+\n+    # Remove all interfaces associated to the domain\n+    p = router._run(","path":"reactive/vpe_router.py","position":55,"original_position":55,"commit_id":"a82ea7ec4338dfa9c4b4ea44d91783a390ccd2e7","original_commit_id":"a82ea7ec4338dfa9c4b4ea44d91783a390ccd2e7","user":{"login":"AdamIsrael","id":125008,"avatar_url":"https://avatars.githubusercontent.com/u/125008?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamIsrael","html_url":"https://github.com/AdamIsrael","followers_url":"https://api.github.com/users/AdamIsrael/followers","following_url":"https://api.github.com/users/AdamIsrael/following{/other_user}","gists_url":"https://api.github.com/users/AdamIsrael/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamIsrael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamIsrael/subscriptions","organizations_url":"https://api.github.com/users/AdamIsrael/orgs","repos_url":"https://api.github.com/users/AdamIsrael/repos","events_url":"https://api.github.com/users/AdamIsrael/events{/privacy}","received_events_url":"https://api.github.com/users/AdamIsrael/received_events","type":"User","site_admin":false},"body":"`router.ip` doesn't have a return, but I could modify it to do so.","created_at":"2016-01-25T16:07:38Z","updated_at":"2016-01-25T16:07:38Z","html_url":"https://github.com/juju-solutions/vpe-router/pull/10#discussion_r50713826","pull_request_url":"https://api.github.com/repos/juju-solutions/vpe-router/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/juju-solutions/vpe-router/pulls/comments/50713826"},"html":{"href":"https://github.com/juju-solutions/vpe-router/pull/10#discussion_r50713826"},"pull_request":{"href":"https://api.github.com/repos/juju-solutions/vpe-router/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/juju-solutions/vpe-router/pulls/10","id":57089077,"html_url":"https://github.com/juju-solutions/vpe-router/pull/10","diff_url":"https://github.com/juju-solutions/vpe-router/pull/10.diff","patch_url":"https://github.com/juju-solutions/vpe-router/pull/10.patch","issue_url":"https://api.github.com/repos/juju-solutions/vpe-router/issues/10","number":10,"state":"closed","locked":false,"title":"Delete Corporation","user":{"login":"AdamIsrael","id":125008,"avatar_url":"https://avatars.githubusercontent.com/u/125008?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamIsrael","html_url":"https://github.com/AdamIsrael","followers_url":"https://api.github.com/users/AdamIsrael/followers","following_url":"https://api.github.com/users/AdamIsrael/following{/other_user}","gists_url":"https://api.github.com/users/AdamIsrael/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamIsrael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamIsrael/subscriptions","organizations_url":"https://api.github.com/users/AdamIsrael/orgs","repos_url":"https://api.github.com/users/AdamIsrael/repos","events_url":"https://api.github.com/users/AdamIsrael/events{/privacy}","received_events_url":"https://api.github.com/users/AdamIsrael/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-25T15:53:03Z","updated_at":"2016-01-25T16:07:38Z","closed_at":"2016-01-25T15:58:10Z","merged_at":"2016-01-25T15:58:10Z","merge_commit_sha":"9776b32e35690511899aba261dba34a3cd0eaa18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/juju-solutions/vpe-router/pulls/10/commits","review_comments_url":"https://api.github.com/repos/juju-solutions/vpe-router/pulls/10/comments","review_comment_url":"https://api.github.com/repos/juju-solutions/vpe-router/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju-solutions/vpe-router/issues/10/comments","statuses_url":"https://api.github.com/repos/juju-solutions/vpe-router/statuses/a82ea7ec4338dfa9c4b4ea44d91783a390ccd2e7","head":{"label":"AdamIsrael:remove_route","ref":"remove_route","sha":"a82ea7ec4338dfa9c4b4ea44d91783a390ccd2e7","user":{"login":"AdamIsrael","id":125008,"avatar_url":"https://avatars.githubusercontent.com/u/125008?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamIsrael","html_url":"https://github.com/AdamIsrael","followers_url":"https://api.github.com/users/AdamIsrael/followers","following_url":"https://api.github.com/users/AdamIsrael/following{/other_user}","gists_url":"https://api.github.com/users/AdamIsrael/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamIsrael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamIsrael/subscriptions","organizations_url":"https://api.github.com/users/AdamIsrael/orgs","repos_url":"https://api.github.com/users/AdamIsrael/repos","events_url":"https://api.github.com/users/AdamIsrael/events{/privacy}","received_events_url":"https://api.github.com/users/AdamIsrael/received_events","type":"User","site_admin":false},"repo":{"id":50045834,"name":"vpe-router","full_name":"AdamIsrael/vpe-router","owner":{"login":"AdamIsrael","id":125008,"avatar_url":"https://avatars.githubusercontent.com/u/125008?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamIsrael","html_url":"https://github.com/AdamIsrael","followers_url":"https://api.github.com/users/AdamIsrael/followers","following_url":"https://api.github.com/users/AdamIsrael/following{/other_user}","gists_url":"https://api.github.com/users/AdamIsrael/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamIsrael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamIsrael/subscriptions","organizations_url":"https://api.github.com/users/AdamIsrael/orgs","repos_url":"https://api.github.com/users/AdamIsrael/repos","events_url":"https://api.github.com/users/AdamIsrael/events{/privacy}","received_events_url":"https://api.github.com/users/AdamIsrael/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AdamIsrael/vpe-router","description":"","fork":true,"url":"https://api.github.com/repos/AdamIsrael/vpe-router","forks_url":"https://api.github.com/repos/AdamIsrael/vpe-router/forks","keys_url":"https://api.github.com/repos/AdamIsrael/vpe-router/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AdamIsrael/vpe-router/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AdamIsrael/vpe-router/teams","hooks_url":"https://api.github.com/repos/AdamIsrael/vpe-router/hooks","issue_events_url":"https://api.github.com/repos/AdamIsrael/vpe-router/issues/events{/number}","events_url":"https://api.github.com/repos/AdamIsrael/vpe-router/events","assignees_url":"https://api.github.com/repos/AdamIsrael/vpe-router/assignees{/user}","branches_url":"https://api.github.com/repos/AdamIsrael/vpe-router/branches{/branch}","tags_url":"https://api.github.com/repos/AdamIsrael/vpe-router/tags","blobs_url":"https://api.github.com/repos/AdamIsrael/vpe-router/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AdamIsrael/vpe-router/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AdamIsrael/vpe-router/git/refs{/sha}","trees_url":"https://api.github.com/repos/AdamIsrael/vpe-router/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AdamIsrael/vpe-router/statuses/{sha}","languages_url":"https://api.github.com/repos/AdamIsrael/vpe-router/languages","stargazers_url":"https://api.github.com/repos/AdamIsrael/vpe-router/stargazers","contributors_url":"https://api.github.com/repos/AdamIsrael/vpe-router/contributors","subscribers_url":"https://api.github.com/repos/AdamIsrael/vpe-router/subscribers","subscription_url":"https://api.github.com/repos/AdamIsrael/vpe-router/subscription","commits_url":"https://api.github.com/repos/AdamIsrael/vpe-router/commits{/sha}","git_commits_url":"https://api.github.com/repos/AdamIsrael/vpe-router/git/commits{/sha}","comments_url":"https://api.github.com/repos/AdamIsrael/vpe-router/comments{/number}","issue_comment_url":"https://api.github.com/repos/AdamIsrael/vpe-router/issues/comments{/number}","contents_url":"https://api.github.com/repos/AdamIsrael/vpe-router/contents/{+path}","compare_url":"https://api.github.com/repos/AdamIsrael/vpe-router/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AdamIsrael/vpe-router/merges","archive_url":"https://api.github.com/repos/AdamIsrael/vpe-router/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AdamIsrael/vpe-router/downloads","issues_url":"https://api.github.com/repos/AdamIsrael/vpe-router/issues{/number}","pulls_url":"https://api.github.com/repos/AdamIsrael/vpe-router/pulls{/number}","milestones_url":"https://api.github.com/repos/AdamIsrael/vpe-router/milestones{/number}","notifications_url":"https://api.github.com/repos/AdamIsrael/vpe-router/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AdamIsrael/vpe-router/labels{/name}","releases_url":"https://api.github.com/repos/AdamIsrael/vpe-router/releases{/id}","deployments_url":"https://api.github.com/repos/AdamIsrael/vpe-router/deployments","created_at":"2016-01-20T17:09:24Z","updated_at":"2016-01-20T17:09:25Z","pushed_at":"2016-01-25T15:56:18Z","git_url":"git://github.com/AdamIsrael/vpe-router.git","ssh_url":"git@github.com:AdamIsrael/vpe-router.git","clone_url":"https://github.com/AdamIsrael/vpe-router.git","svn_url":"https://github.com/AdamIsrael/vpe-router","homepage":null,"size":20,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"juju-solutions:master","ref":"master","sha":"82679115b6cf1c280400a0d1e27e7839b5b736d3","user":{"login":"juju-solutions","id":8684561,"avatar_url":"https://avatars.githubusercontent.com/u/8684561?v=3","gravatar_id":"","url":"https://api.github.com/users/juju-solutions","html_url":"https://github.com/juju-solutions","followers_url":"https://api.github.com/users/juju-solutions/followers","following_url":"https://api.github.com/users/juju-solutions/following{/other_user}","gists_url":"https://api.github.com/users/juju-solutions/gists{/gist_id}","starred_url":"https://api.github.com/users/juju-solutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju-solutions/subscriptions","organizations_url":"https://api.github.com/users/juju-solutions/orgs","repos_url":"https://api.github.com/users/juju-solutions/repos","events_url":"https://api.github.com/users/juju-solutions/events{/privacy}","received_events_url":"https://api.github.com/users/juju-solutions/received_events","type":"Organization","site_admin":false},"repo":{"id":50034908,"name":"vpe-router","full_name":"juju-solutions/vpe-router","owner":{"login":"juju-solutions","id":8684561,"avatar_url":"https://avatars.githubusercontent.com/u/8684561?v=3","gravatar_id":"","url":"https://api.github.com/users/juju-solutions","html_url":"https://github.com/juju-solutions","followers_url":"https://api.github.com/users/juju-solutions/followers","following_url":"https://api.github.com/users/juju-solutions/following{/other_user}","gists_url":"https://api.github.com/users/juju-solutions/gists{/gist_id}","starred_url":"https://api.github.com/users/juju-solutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju-solutions/subscriptions","organizations_url":"https://api.github.com/users/juju-solutions/orgs","repos_url":"https://api.github.com/users/juju-solutions/repos","events_url":"https://api.github.com/users/juju-solutions/events{/privacy}","received_events_url":"https://api.github.com/users/juju-solutions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juju-solutions/vpe-router","description":"","fork":false,"url":"https://api.github.com/repos/juju-solutions/vpe-router","forks_url":"https://api.github.com/repos/juju-solutions/vpe-router/forks","keys_url":"https://api.github.com/repos/juju-solutions/vpe-router/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juju-solutions/vpe-router/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juju-solutions/vpe-router/teams","hooks_url":"https://api.github.com/repos/juju-solutions/vpe-router/hooks","issue_events_url":"https://api.github.com/repos/juju-solutions/vpe-router/issues/events{/number}","events_url":"https://api.github.com/repos/juju-solutions/vpe-router/events","assignees_url":"https://api.github.com/repos/juju-solutions/vpe-router/assignees{/user}","branches_url":"https://api.github.com/repos/juju-solutions/vpe-router/branches{/branch}","tags_url":"https://api.github.com/repos/juju-solutions/vpe-router/tags","blobs_url":"https://api.github.com/repos/juju-solutions/vpe-router/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juju-solutions/vpe-router/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juju-solutions/vpe-router/git/refs{/sha}","trees_url":"https://api.github.com/repos/juju-solutions/vpe-router/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juju-solutions/vpe-router/statuses/{sha}","languages_url":"https://api.github.com/repos/juju-solutions/vpe-router/languages","stargazers_url":"https://api.github.com/repos/juju-solutions/vpe-router/stargazers","contributors_url":"https://api.github.com/repos/juju-solutions/vpe-router/contributors","subscribers_url":"https://api.github.com/repos/juju-solutions/vpe-router/subscribers","subscription_url":"https://api.github.com/repos/juju-solutions/vpe-router/subscription","commits_url":"https://api.github.com/repos/juju-solutions/vpe-router/commits{/sha}","git_commits_url":"https://api.github.com/repos/juju-solutions/vpe-router/git/commits{/sha}","comments_url":"https://api.github.com/repos/juju-solutions/vpe-router/comments{/number}","issue_comment_url":"https://api.github.com/repos/juju-solutions/vpe-router/issues/comments{/number}","contents_url":"https://api.github.com/repos/juju-solutions/vpe-router/contents/{+path}","compare_url":"https://api.github.com/repos/juju-solutions/vpe-router/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juju-solutions/vpe-router/merges","archive_url":"https://api.github.com/repos/juju-solutions/vpe-router/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juju-solutions/vpe-router/downloads","issues_url":"https://api.github.com/repos/juju-solutions/vpe-router/issues{/number}","pulls_url":"https://api.github.com/repos/juju-solutions/vpe-router/pulls{/number}","milestones_url":"https://api.github.com/repos/juju-solutions/vpe-router/milestones{/number}","notifications_url":"https://api.github.com/repos/juju-solutions/vpe-router/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juju-solutions/vpe-router/labels{/name}","releases_url":"https://api.github.com/repos/juju-solutions/vpe-router/releases{/id}","deployments_url":"https://api.github.com/repos/juju-solutions/vpe-router/deployments","created_at":"2016-01-20T14:21:10Z","updated_at":"2016-01-20T20:17:34Z","pushed_at":"2016-01-25T15:58:10Z","git_url":"git://github.com/juju-solutions/vpe-router.git","ssh_url":"git@github.com:juju-solutions/vpe-router.git","clone_url":"https://github.com/juju-solutions/vpe-router.git","svn_url":"https://github.com/juju-solutions/vpe-router","homepage":null,"size":24,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/juju-solutions/vpe-router/pulls/10"},"html":{"href":"https://github.com/juju-solutions/vpe-router/pull/10"},"issue":{"href":"https://api.github.com/repos/juju-solutions/vpe-router/issues/10"},"comments":{"href":"https://api.github.com/repos/juju-solutions/vpe-router/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/juju-solutions/vpe-router/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/juju-solutions/vpe-router/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju-solutions/vpe-router/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/juju-solutions/vpe-router/statuses/a82ea7ec4338dfa9c4b4ea44d91783a390ccd2e7"}}}}