{"action":"created","comment":{"url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls/comments/95391119","pull_request_review_id":15943372,"id":95391119,"diff_hunk":"@@ -78,6 +79,145 @@ def add_group(client_session, scopeId, name, member, excludeMember,\n     return raw_result['objectId']\n \n \n+def add_group_exclude_member(client_session, security_group_id, member_id):\n+    raw_result = client_session.read(\n+        'secGroupObject', uri_parameters={'objectId': security_group_id}\n+    )\n+\n+    common.check_raw_result(raw_result)\n+\n+    security_group = raw_result['body']\n+\n+    if 'excludeMember' not in security_group['securitygroup']:\n+        security_group['securitygroup']['excludeMember'] = []\n+\n+    excludeMembers = security_group['securitygroup']['excludeMember']\n+    if isinstance(excludeMembers, dict):\n+        excludeMembers = [excludeMembers]\n+\n+    for member in excludeMembers:\n+        if member.get(\"objectId\") == member_id:\n+            raise cfy_exc.NonRecoverableError(\n+                \"You already have such member in security group.\"","path":"cloudify_nsx/library/nsx_security_group.py","position":31,"original_position":31,"commit_id":"b5212889a535b22987164daa64029a03169bba6c","original_commit_id":"b5212889a535b22987164daa64029a03169bba6c","user":{"login":"geokala","id":8859114,"avatar_url":"https://avatars.githubusercontent.com/u/8859114?v=3","gravatar_id":"","url":"https://api.github.com/users/geokala","html_url":"https://github.com/geokala","followers_url":"https://api.github.com/users/geokala/followers","following_url":"https://api.github.com/users/geokala/following{/other_user}","gists_url":"https://api.github.com/users/geokala/gists{/gist_id}","starred_url":"https://api.github.com/users/geokala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geokala/subscriptions","organizations_url":"https://api.github.com/users/geokala/orgs","repos_url":"https://api.github.com/users/geokala/repos","events_url":"https://api.github.com/users/geokala/events{/privacy}","received_events_url":"https://api.github.com/users/geokala/received_events","type":"User","site_admin":false},"body":"Similar to the comment above, this would probably be better as something like: \"Security group {member} already exists in {group_name}\"","created_at":"2017-01-10T15:47:09Z","updated_at":"2017-01-10T15:47:26Z","html_url":"https://github.com/cloudify-cosmo/cloudify-nsx-plugin/pull/3#discussion_r95391119","pull_request_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls/comments/95391119"},"html":{"href":"https://github.com/cloudify-cosmo/cloudify-nsx-plugin/pull/3#discussion_r95391119"},"pull_request":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls/3","id":100294924,"html_url":"https://github.com/cloudify-cosmo/cloudify-nsx-plugin/pull/3","diff_url":"https://github.com/cloudify-cosmo/cloudify-nsx-plugin/pull/3.diff","patch_url":"https://github.com/cloudify-cosmo/cloudify-nsx-plugin/pull/3.patch","issue_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/issues/3","number":3,"state":"open","locked":false,"title":"NSX-5: example nested security group","user":{"login":"0lvin","id":73573,"avatar_url":"https://avatars.githubusercontent.com/u/73573?v=3","gravatar_id":"","url":"https://api.github.com/users/0lvin","html_url":"https://github.com/0lvin","followers_url":"https://api.github.com/users/0lvin/followers","following_url":"https://api.github.com/users/0lvin/following{/other_user}","gists_url":"https://api.github.com/users/0lvin/gists{/gist_id}","starred_url":"https://api.github.com/users/0lvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0lvin/subscriptions","organizations_url":"https://api.github.com/users/0lvin/orgs","repos_url":"https://api.github.com/users/0lvin/repos","events_url":"https://api.github.com/users/0lvin/events{/privacy}","received_events_url":"https://api.github.com/users/0lvin/received_events","type":"User","site_admin":false},"body":"First part with examples for change member and exclude member of security group.","created_at":"2017-01-05T14:03:58Z","updated_at":"2017-01-10T15:47:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59ff7a2267a7c8862c391d4cb2ef0a341d5d75d2","assignee":{"login":"0lvin","id":73573,"avatar_url":"https://avatars.githubusercontent.com/u/73573?v=3","gravatar_id":"","url":"https://api.github.com/users/0lvin","html_url":"https://github.com/0lvin","followers_url":"https://api.github.com/users/0lvin/followers","following_url":"https://api.github.com/users/0lvin/following{/other_user}","gists_url":"https://api.github.com/users/0lvin/gists{/gist_id}","starred_url":"https://api.github.com/users/0lvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0lvin/subscriptions","organizations_url":"https://api.github.com/users/0lvin/orgs","repos_url":"https://api.github.com/users/0lvin/repos","events_url":"https://api.github.com/users/0lvin/events{/privacy}","received_events_url":"https://api.github.com/users/0lvin/received_events","type":"User","site_admin":false},"assignees":[{"login":"0lvin","id":73573,"avatar_url":"https://avatars.githubusercontent.com/u/73573?v=3","gravatar_id":"","url":"https://api.github.com/users/0lvin","html_url":"https://github.com/0lvin","followers_url":"https://api.github.com/users/0lvin/followers","following_url":"https://api.github.com/users/0lvin/following{/other_user}","gists_url":"https://api.github.com/users/0lvin/gists{/gist_id}","starred_url":"https://api.github.com/users/0lvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0lvin/subscriptions","organizations_url":"https://api.github.com/users/0lvin/orgs","repos_url":"https://api.github.com/users/0lvin/repos","events_url":"https://api.github.com/users/0lvin/events{/privacy}","received_events_url":"https://api.github.com/users/0lvin/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls/3/commits","review_comments_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls/3/comments","review_comment_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/issues/3/comments","statuses_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/statuses/b5212889a535b22987164daa64029a03169bba6c","head":{"label":"Cloudify-PS:NSX-5_example_nested_security_group","ref":"NSX-5_example_nested_security_group","sha":"b5212889a535b22987164daa64029a03169bba6c","user":{"login":"Cloudify-PS","id":20024728,"avatar_url":"https://avatars.githubusercontent.com/u/20024728?v=3","gravatar_id":"","url":"https://api.github.com/users/Cloudify-PS","html_url":"https://github.com/Cloudify-PS","followers_url":"https://api.github.com/users/Cloudify-PS/followers","following_url":"https://api.github.com/users/Cloudify-PS/following{/other_user}","gists_url":"https://api.github.com/users/Cloudify-PS/gists{/gist_id}","starred_url":"https://api.github.com/users/Cloudify-PS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cloudify-PS/subscriptions","organizations_url":"https://api.github.com/users/Cloudify-PS/orgs","repos_url":"https://api.github.com/users/Cloudify-PS/repos","events_url":"https://api.github.com/users/Cloudify-PS/events{/privacy}","received_events_url":"https://api.github.com/users/Cloudify-PS/received_events","type":"Organization","site_admin":false},"repo":{"id":77547199,"name":"cloudify-nsx-plugin","full_name":"Cloudify-PS/cloudify-nsx-plugin","owner":{"login":"Cloudify-PS","id":20024728,"avatar_url":"https://avatars.githubusercontent.com/u/20024728?v=3","gravatar_id":"","url":"https://api.github.com/users/Cloudify-PS","html_url":"https://github.com/Cloudify-PS","followers_url":"https://api.github.com/users/Cloudify-PS/followers","following_url":"https://api.github.com/users/Cloudify-PS/following{/other_user}","gists_url":"https://api.github.com/users/Cloudify-PS/gists{/gist_id}","starred_url":"https://api.github.com/users/Cloudify-PS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cloudify-PS/subscriptions","organizations_url":"https://api.github.com/users/Cloudify-PS/orgs","repos_url":"https://api.github.com/users/Cloudify-PS/repos","events_url":"https://api.github.com/users/Cloudify-PS/events{/privacy}","received_events_url":"https://api.github.com/users/Cloudify-PS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cloudify-PS/cloudify-nsx-plugin","description":"Cloudify Network Virtualization with VMware (NSX) plugin","fork":true,"url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin","forks_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/forks","keys_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/teams","hooks_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/hooks","issue_events_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/events","assignees_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/tags","blobs_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/languages","stargazers_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/stargazers","contributors_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/contributors","subscribers_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/subscribers","subscription_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/subscription","commits_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/merges","archive_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/downloads","issues_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/labels{/name}","releases_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/Cloudify-PS/cloudify-nsx-plugin/deployments","created_at":"2016-12-28T16:42:56Z","updated_at":"2016-12-28T16:42:58Z","pushed_at":"2017-01-10T15:31:29Z","git_url":"git://github.com/Cloudify-PS/cloudify-nsx-plugin.git","ssh_url":"git@github.com:Cloudify-PS/cloudify-nsx-plugin.git","clone_url":"https://github.com/Cloudify-PS/cloudify-nsx-plugin.git","svn_url":"https://github.com/Cloudify-PS/cloudify-nsx-plugin","homepage":null,"size":229,"stargazers_count":0,"watchers_count":0,"language":"RAML","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":"cloudify-cosmo:master","ref":"master","sha":"99579200e4e962e5efed6e7d9cf31201bb143f7a","user":{"login":"cloudify-cosmo","id":6260555,"avatar_url":"https://avatars.githubusercontent.com/u/6260555?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudify-cosmo","html_url":"https://github.com/cloudify-cosmo","followers_url":"https://api.github.com/users/cloudify-cosmo/followers","following_url":"https://api.github.com/users/cloudify-cosmo/following{/other_user}","gists_url":"https://api.github.com/users/cloudify-cosmo/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudify-cosmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudify-cosmo/subscriptions","organizations_url":"https://api.github.com/users/cloudify-cosmo/orgs","repos_url":"https://api.github.com/users/cloudify-cosmo/repos","events_url":"https://api.github.com/users/cloudify-cosmo/events{/privacy}","received_events_url":"https://api.github.com/users/cloudify-cosmo/received_events","type":"Organization","site_admin":false},"repo":{"id":77539323,"name":"cloudify-nsx-plugin","full_name":"cloudify-cosmo/cloudify-nsx-plugin","owner":{"login":"cloudify-cosmo","id":6260555,"avatar_url":"https://avatars.githubusercontent.com/u/6260555?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudify-cosmo","html_url":"https://github.com/cloudify-cosmo","followers_url":"https://api.github.com/users/cloudify-cosmo/followers","following_url":"https://api.github.com/users/cloudify-cosmo/following{/other_user}","gists_url":"https://api.github.com/users/cloudify-cosmo/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudify-cosmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudify-cosmo/subscriptions","organizations_url":"https://api.github.com/users/cloudify-cosmo/orgs","repos_url":"https://api.github.com/users/cloudify-cosmo/repos","events_url":"https://api.github.com/users/cloudify-cosmo/events{/privacy}","received_events_url":"https://api.github.com/users/cloudify-cosmo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudify-cosmo/cloudify-nsx-plugin","description":"Cloudify Network Virtualization with VMware (NSX) plugin","fork":false,"url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin","forks_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/forks","keys_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/teams","hooks_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/hooks","issue_events_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/events","assignees_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/tags","blobs_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/languages","stargazers_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/stargazers","contributors_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/contributors","subscribers_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/subscribers","subscription_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/subscription","commits_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/merges","archive_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/downloads","issues_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/labels{/name}","releases_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/deployments","created_at":"2016-12-28T14:39:24Z","updated_at":"2016-12-28T15:50:44Z","pushed_at":"2017-01-05T14:03:58Z","git_url":"git://github.com/cloudify-cosmo/cloudify-nsx-plugin.git","ssh_url":"git@github.com:cloudify-cosmo/cloudify-nsx-plugin.git","clone_url":"https://github.com/cloudify-cosmo/cloudify-nsx-plugin.git","svn_url":"https://github.com/cloudify-cosmo/cloudify-nsx-plugin","homepage":null,"size":192,"stargazers_count":0,"watchers_count":0,"language":"RAML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls/3"},"html":{"href":"https://github.com/cloudify-cosmo/cloudify-nsx-plugin/pull/3"},"issue":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/issues/3"},"comments":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-nsx-plugin/statuses/b5212889a535b22987164daa64029a03169bba6c"}}}}
{"actor":{"display_login":"geokala"}}