{"action":"opened","number":537,"pull_request":{"url":"https://api.github.com/repos/axsh/openvnet/pulls/537","id":116502352,"html_url":"https://github.com/axsh/openvnet/pull/537","diff_url":"https://github.com/axsh/openvnet/pull/537.diff","patch_url":"https://github.com/axsh/openvnet/pull/537.patch","issue_url":"https://api.github.com/repos/axsh/openvnet/issues/537","number":537,"state":"open","locked":false,"title":"Fix network ip lease deletion","user":{"login":"Metallion","id":629110,"avatar_url":"https://avatars3.githubusercontent.com/u/629110?v=3","gravatar_id":"","url":"https://api.github.com/users/Metallion","html_url":"https://github.com/Metallion","followers_url":"https://api.github.com/users/Metallion/followers","following_url":"https://api.github.com/users/Metallion/following{/other_user}","gists_url":"https://api.github.com/users/Metallion/gists{/gist_id}","starred_url":"https://api.github.com/users/Metallion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metallion/subscriptions","organizations_url":"https://api.github.com/users/Metallion/orgs","repos_url":"https://api.github.com/users/Metallion/repos","events_url":"https://api.github.com/users/Metallion/events{/privacy}","received_events_url":"https://api.github.com/users/Metallion/received_events","type":"User","site_admin":false},"body":"Fixed the following bug:\r\n\r\n* Imagine we have interface `if-aaa` in network `nw-bbb` with ip address `x.x.x.x`.\r\n* Next we delete network `nw-bbb`.\r\n* Now in the database the `ip_address` for x.x.x.x got destroyed but the `ip_lease` remained.\r\n* Next time we did `vnctl show if-aaa` the webapi crashed because it sees if-aaa has an `ip_lease` and tries to display the `network` and `ip_address` associated with it, neither of which exists any more.\r\n\r\nIt resulted in the follow error in the log:\r\n\r\n```\r\nApr 18 07:10:36 ci vnet-webapi[1047]: 172.16.3.11 - - [18/Apr/2017:07:10:36 +0000] \"GET /api/interfaces/if-aaa HTTP/1.1\" 200 617 0.0245\r\nApr 18 07:10:36 ci vnet-webapi[1047]: 2017-04-18 07:10:36 - NoMethodError - undefined method `network' for nil:NilClass:\r\nApr 18 07:10:36 ci vnet-webapi[1047]: /opt/axsh/openvnet/vnet/lib/vnet/endpoints/1.0/responses/interface.rb:13:in `block in generate'\r\nApr 18 07:10:36 ci vnet-webapi[1047]: /opt/axsh/openvnet/vnet/lib/vnet/endpoints/1.0/responses/interface.rb:11:in `map'\r\nApr 18 07:10:36 ci vnet-webapi[1047]: /opt/axsh/openvnet/vnet/lib/vnet/endpoints/1.0/responses/interface.rb:11:in `generate'\r\n```\r\n\r\nI fixed it by making networks destroy their ip_leases which in turn destroy the ip_addresses.","created_at":"2017-04-19T09:16:19Z","updated_at":"2017-04-19T09:16:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/axsh/openvnet/pulls/537/commits","review_comments_url":"https://api.github.com/repos/axsh/openvnet/pulls/537/comments","review_comment_url":"https://api.github.com/repos/axsh/openvnet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/axsh/openvnet/issues/537/comments","statuses_url":"https://api.github.com/repos/axsh/openvnet/statuses/6c7e52a0e490434255ae62190076fe56b0b6f7d1","head":{"label":"axsh:fix-ip-lease-deletion","ref":"fix-ip-lease-deletion","sha":"6c7e52a0e490434255ae62190076fe56b0b6f7d1","user":{"login":"axsh","id":95230,"avatar_url":"https://avatars1.githubusercontent.com/u/95230?v=3","gravatar_id":"","url":"https://api.github.com/users/axsh","html_url":"https://github.com/axsh","followers_url":"https://api.github.com/users/axsh/followers","following_url":"https://api.github.com/users/axsh/following{/other_user}","gists_url":"https://api.github.com/users/axsh/gists{/gist_id}","starred_url":"https://api.github.com/users/axsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axsh/subscriptions","organizations_url":"https://api.github.com/users/axsh/orgs","repos_url":"https://api.github.com/users/axsh/repos","events_url":"https://api.github.com/users/axsh/events{/privacy}","received_events_url":"https://api.github.com/users/axsh/received_events","type":"Organization","site_admin":false},"repo":{"id":9443209,"name":"openvnet","full_name":"axsh/openvnet","owner":{"login":"axsh","id":95230,"avatar_url":"https://avatars1.githubusercontent.com/u/95230?v=3","gravatar_id":"","url":"https://api.github.com/users/axsh","html_url":"https://github.com/axsh","followers_url":"https://api.github.com/users/axsh/followers","following_url":"https://api.github.com/users/axsh/following{/other_user}","gists_url":"https://api.github.com/users/axsh/gists{/gist_id}","starred_url":"https://api.github.com/users/axsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axsh/subscriptions","organizations_url":"https://api.github.com/users/axsh/orgs","repos_url":"https://api.github.com/users/axsh/repos","events_url":"https://api.github.com/users/axsh/events{/privacy}","received_events_url":"https://api.github.com/users/axsh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/axsh/openvnet","description":"Data Center Level Virtual Network Toolkit based on Edge Overlaid Network using OpenFlow 1.3.","fork":false,"url":"https://api.github.com/repos/axsh/openvnet","forks_url":"https://api.github.com/repos/axsh/openvnet/forks","keys_url":"https://api.github.com/repos/axsh/openvnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/axsh/openvnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/axsh/openvnet/teams","hooks_url":"https://api.github.com/repos/axsh/openvnet/hooks","issue_events_url":"https://api.github.com/repos/axsh/openvnet/issues/events{/number}","events_url":"https://api.github.com/repos/axsh/openvnet/events","assignees_url":"https://api.github.com/repos/axsh/openvnet/assignees{/user}","branches_url":"https://api.github.com/repos/axsh/openvnet/branches{/branch}","tags_url":"https://api.github.com/repos/axsh/openvnet/tags","blobs_url":"https://api.github.com/repos/axsh/openvnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/axsh/openvnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/axsh/openvnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/axsh/openvnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/axsh/openvnet/statuses/{sha}","languages_url":"https://api.github.com/repos/axsh/openvnet/languages","stargazers_url":"https://api.github.com/repos/axsh/openvnet/stargazers","contributors_url":"https://api.github.com/repos/axsh/openvnet/contributors","subscribers_url":"https://api.github.com/repos/axsh/openvnet/subscribers","subscription_url":"https://api.github.com/repos/axsh/openvnet/subscription","commits_url":"https://api.github.com/repos/axsh/openvnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/axsh/openvnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/axsh/openvnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/axsh/openvnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/axsh/openvnet/contents/{+path}","compare_url":"https://api.github.com/repos/axsh/openvnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/axsh/openvnet/merges","archive_url":"https://api.github.com/repos/axsh/openvnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/axsh/openvnet/downloads","issues_url":"https://api.github.com/repos/axsh/openvnet/issues{/number}","pulls_url":"https://api.github.com/repos/axsh/openvnet/pulls{/number}","milestones_url":"https://api.github.com/repos/axsh/openvnet/milestones{/number}","notifications_url":"https://api.github.com/repos/axsh/openvnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/axsh/openvnet/labels{/name}","releases_url":"https://api.github.com/repos/axsh/openvnet/releases{/id}","deployments_url":"https://api.github.com/repos/axsh/openvnet/deployments","created_at":"2013-04-15T07:36:18Z","updated_at":"2017-04-02T11:57:13Z","pushed_at":"2017-04-19T09:08:33Z","git_url":"git://github.com/axsh/openvnet.git","ssh_url":"git@github.com:axsh/openvnet.git","clone_url":"https://github.com/axsh/openvnet.git","svn_url":"https://github.com/axsh/openvnet","homepage":"http://openvnet.org","size":8850,"stargazers_count":50,"watchers_count":50,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":15,"mirror_url":null,"open_issues_count":55,"forks":15,"open_issues":55,"watchers":50,"default_branch":"develop"}},"base":{"label":"axsh:v0.10rc","ref":"v0.10rc","sha":"f83f00a74026910968140f53ddef459f27c0d469","user":{"login":"axsh","id":95230,"avatar_url":"https://avatars1.githubusercontent.com/u/95230?v=3","gravatar_id":"","url":"https://api.github.com/users/axsh","html_url":"https://github.com/axsh","followers_url":"https://api.github.com/users/axsh/followers","following_url":"https://api.github.com/users/axsh/following{/other_user}","gists_url":"https://api.github.com/users/axsh/gists{/gist_id}","starred_url":"https://api.github.com/users/axsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axsh/subscriptions","organizations_url":"https://api.github.com/users/axsh/orgs","repos_url":"https://api.github.com/users/axsh/repos","events_url":"https://api.github.com/users/axsh/events{/privacy}","received_events_url":"https://api.github.com/users/axsh/received_events","type":"Organization","site_admin":false},"repo":{"id":9443209,"name":"openvnet","full_name":"axsh/openvnet","owner":{"login":"axsh","id":95230,"avatar_url":"https://avatars1.githubusercontent.com/u/95230?v=3","gravatar_id":"","url":"https://api.github.com/users/axsh","html_url":"https://github.com/axsh","followers_url":"https://api.github.com/users/axsh/followers","following_url":"https://api.github.com/users/axsh/following{/other_user}","gists_url":"https://api.github.com/users/axsh/gists{/gist_id}","starred_url":"https://api.github.com/users/axsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axsh/subscriptions","organizations_url":"https://api.github.com/users/axsh/orgs","repos_url":"https://api.github.com/users/axsh/repos","events_url":"https://api.github.com/users/axsh/events{/privacy}","received_events_url":"https://api.github.com/users/axsh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/axsh/openvnet","description":"Data Center Level Virtual Network Toolkit based on Edge Overlaid Network using OpenFlow 1.3.","fork":false,"url":"https://api.github.com/repos/axsh/openvnet","forks_url":"https://api.github.com/repos/axsh/openvnet/forks","keys_url":"https://api.github.com/repos/axsh/openvnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/axsh/openvnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/axsh/openvnet/teams","hooks_url":"https://api.github.com/repos/axsh/openvnet/hooks","issue_events_url":"https://api.github.com/repos/axsh/openvnet/issues/events{/number}","events_url":"https://api.github.com/repos/axsh/openvnet/events","assignees_url":"https://api.github.com/repos/axsh/openvnet/assignees{/user}","branches_url":"https://api.github.com/repos/axsh/openvnet/branches{/branch}","tags_url":"https://api.github.com/repos/axsh/openvnet/tags","blobs_url":"https://api.github.com/repos/axsh/openvnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/axsh/openvnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/axsh/openvnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/axsh/openvnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/axsh/openvnet/statuses/{sha}","languages_url":"https://api.github.com/repos/axsh/openvnet/languages","stargazers_url":"https://api.github.com/repos/axsh/openvnet/stargazers","contributors_url":"https://api.github.com/repos/axsh/openvnet/contributors","subscribers_url":"https://api.github.com/repos/axsh/openvnet/subscribers","subscription_url":"https://api.github.com/repos/axsh/openvnet/subscription","commits_url":"https://api.github.com/repos/axsh/openvnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/axsh/openvnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/axsh/openvnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/axsh/openvnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/axsh/openvnet/contents/{+path}","compare_url":"https://api.github.com/repos/axsh/openvnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/axsh/openvnet/merges","archive_url":"https://api.github.com/repos/axsh/openvnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/axsh/openvnet/downloads","issues_url":"https://api.github.com/repos/axsh/openvnet/issues{/number}","pulls_url":"https://api.github.com/repos/axsh/openvnet/pulls{/number}","milestones_url":"https://api.github.com/repos/axsh/openvnet/milestones{/number}","notifications_url":"https://api.github.com/repos/axsh/openvnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/axsh/openvnet/labels{/name}","releases_url":"https://api.github.com/repos/axsh/openvnet/releases{/id}","deployments_url":"https://api.github.com/repos/axsh/openvnet/deployments","created_at":"2013-04-15T07:36:18Z","updated_at":"2017-04-02T11:57:13Z","pushed_at":"2017-04-19T09:08:33Z","git_url":"git://github.com/axsh/openvnet.git","ssh_url":"git@github.com:axsh/openvnet.git","clone_url":"https://github.com/axsh/openvnet.git","svn_url":"https://github.com/axsh/openvnet","homepage":"http://openvnet.org","size":8850,"stargazers_count":50,"watchers_count":50,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":15,"mirror_url":null,"open_issues_count":55,"forks":15,"open_issues":55,"watchers":50,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/axsh/openvnet/pulls/537"},"html":{"href":"https://github.com/axsh/openvnet/pull/537"},"issue":{"href":"https://api.github.com/repos/axsh/openvnet/issues/537"},"comments":{"href":"https://api.github.com/repos/axsh/openvnet/issues/537/comments"},"review_comments":{"href":"https://api.github.com/repos/axsh/openvnet/pulls/537/comments"},"review_comment":{"href":"https://api.github.com/repos/axsh/openvnet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/axsh/openvnet/pulls/537/commits"},"statuses":{"href":"https://api.github.com/repos/axsh/openvnet/statuses/6c7e52a0e490434255ae62190076fe56b0b6f7d1"}},"merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":3,"additions":45,"deletions":8,"changed_files":6}}
{"actor":{"display_login":"Metallion"}}