{"action":"created","comment":{"url":"https://api.github.com/repos/emc-openstack/storops/pulls/comments/194295760","pull_request_review_id":127438412,"id":194295760,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDI5NTc2MA==","diff_hunk":"@@ -179,17 +180,45 @@ def add_lun(self, *lun_list):\n     def remove_lun(self, *lun_list):\n         return self.modify(lun_remove=lun_list)\n \n-    def replace_lun(self, *lun_list):\n-        \"\"\"Replaces the exiting LUNs to lun_list.\"\"\"\n-        existing_ids = {lun.get_id() for lun in self.luns}\n-        new_ids = {lun.get_id() for lun in lun_list}\n-        add_ids = new_ids - existing_ids\n+    @property\n+    def existing_lun_ids(self):\n+        luns = self.luns if self.luns else []\n+        return {lun.get_id() for lun in luns}\n+\n+    def _prepare_luns_add(self, lun_list):\n+        if not lun_list:\n+            return None\n+        add_ids = {lun.get_id() for lun in lun_list} - self.existing_lun_ids\n         log.debug(\"Adding LUN(s) '{}' to cg {}\".format(add_ids, self.get_id()))\n-        lun_add = [UnityLun(_id=_id, cli=self._cli) for _id in add_ids]\n-        remove_ids = existing_ids - new_ids\n+        return [UnityLun(_id=_id, cli=self._cli) for _id in add_ids]\n+\n+    def _prepare_luns_remove(self, lun_list, is_delta):","path":"storops/unity/resource/cg.py","position":31,"original_position":31,"commit_id":"94225811a50a5083260a2fbbb3a68b9528f1e5d9","original_commit_id":"94225811a50a5083260a2fbbb3a68b9528f1e5d9","user":{"login":"Murray-LIANG","id":13897261,"node_id":"MDQ6VXNlcjEzODk3MjYx","avatar_url":"https://avatars0.githubusercontent.com/u/13897261?v=4","gravatar_id":"","url":"https://api.github.com/users/Murray-LIANG","html_url":"https://github.com/Murray-LIANG","followers_url":"https://api.github.com/users/Murray-LIANG/followers","following_url":"https://api.github.com/users/Murray-LIANG/following{/other_user}","gists_url":"https://api.github.com/users/Murray-LIANG/gists{/gist_id}","starred_url":"https://api.github.com/users/Murray-LIANG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Murray-LIANG/subscriptions","organizations_url":"https://api.github.com/users/Murray-LIANG/orgs","repos_url":"https://api.github.com/users/Murray-LIANG/repos","events_url":"https://api.github.com/users/Murray-LIANG/events{/privacy}","received_events_url":"https://api.github.com/users/Murray-LIANG/received_events","type":"User","site_admin":false},"body":"I want to let the caller invoke this method with all arguments explicitly and be aware of the difference of passing in and not passing in `is_delta`.","created_at":"2018-06-11T05:36:11Z","updated_at":"2018-06-11T05:36:11Z","html_url":"https://github.com/emc-openstack/storops/pull/221#discussion_r194295760","pull_request_url":"https://api.github.com/repos/emc-openstack/storops/pulls/221","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/emc-openstack/storops/pulls/comments/194295760"},"html":{"href":"https://github.com/emc-openstack/storops/pull/221#discussion_r194295760"},"pull_request":{"href":"https://api.github.com/repos/emc-openstack/storops/pulls/221"}},"in_reply_to_id":193676901},"pull_request":{"url":"https://api.github.com/repos/emc-openstack/storops/pulls/221","id":192649685,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNjQ5Njg1","html_url":"https://github.com/emc-openstack/storops/pull/221","diff_url":"https://github.com/emc-openstack/storops/pull/221.diff","patch_url":"https://github.com/emc-openstack/storops/pull/221.patch","issue_url":"https://api.github.com/repos/emc-openstack/storops/issues/221","number":221,"state":"open","locked":false,"title":"Unity: add cg.update_lun and attach member snap","user":{"login":"Murray-LIANG","id":13897261,"node_id":"MDQ6VXNlcjEzODk3MjYx","avatar_url":"https://avatars0.githubusercontent.com/u/13897261?v=4","gravatar_id":"","url":"https://api.github.com/users/Murray-LIANG","html_url":"https://github.com/Murray-LIANG","followers_url":"https://api.github.com/users/Murray-LIANG/followers","following_url":"https://api.github.com/users/Murray-LIANG/following{/other_user}","gists_url":"https://api.github.com/users/Murray-LIANG/gists{/gist_id}","starred_url":"https://api.github.com/users/Murray-LIANG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Murray-LIANG/subscriptions","organizations_url":"https://api.github.com/users/Murray-LIANG/orgs","repos_url":"https://api.github.com/users/Murray-LIANG/repos","events_url":"https://api.github.com/users/Murray-LIANG/events{/privacy}","received_events_url":"https://api.github.com/users/Murray-LIANG/received_events","type":"User","site_admin":false},"body":"- `update_lun` accepts `add_luns` and `remove_luns` to update the luns\r\nin cg.\r\n- Update host.attach to attach a member snap of cg snap.","created_at":"2018-06-05T09:49:10Z","updated_at":"2018-06-11T05:36:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9bbcbbe5c80073b2633aeff44ce0f625d1447fda","assignee":{"login":"Murray-LIANG","id":13897261,"node_id":"MDQ6VXNlcjEzODk3MjYx","avatar_url":"https://avatars0.githubusercontent.com/u/13897261?v=4","gravatar_id":"","url":"https://api.github.com/users/Murray-LIANG","html_url":"https://github.com/Murray-LIANG","followers_url":"https://api.github.com/users/Murray-LIANG/followers","following_url":"https://api.github.com/users/Murray-LIANG/following{/other_user}","gists_url":"https://api.github.com/users/Murray-LIANG/gists{/gist_id}","starred_url":"https://api.github.com/users/Murray-LIANG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Murray-LIANG/subscriptions","organizations_url":"https://api.github.com/users/Murray-LIANG/orgs","repos_url":"https://api.github.com/users/Murray-LIANG/repos","events_url":"https://api.github.com/users/Murray-LIANG/events{/privacy}","received_events_url":"https://api.github.com/users/Murray-LIANG/received_events","type":"User","site_admin":false},"assignees":[{"login":"Murray-LIANG","id":13897261,"node_id":"MDQ6VXNlcjEzODk3MjYx","avatar_url":"https://avatars0.githubusercontent.com/u/13897261?v=4","gravatar_id":"","url":"https://api.github.com/users/Murray-LIANG","html_url":"https://github.com/Murray-LIANG","followers_url":"https://api.github.com/users/Murray-LIANG/followers","following_url":"https://api.github.com/users/Murray-LIANG/following{/other_user}","gists_url":"https://api.github.com/users/Murray-LIANG/gists{/gist_id}","starred_url":"https://api.github.com/users/Murray-LIANG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Murray-LIANG/subscriptions","organizations_url":"https://api.github.com/users/Murray-LIANG/orgs","repos_url":"https://api.github.com/users/Murray-LIANG/repos","events_url":"https://api.github.com/users/Murray-LIANG/events{/privacy}","received_events_url":"https://api.github.com/users/Murray-LIANG/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/emc-openstack/storops/pulls/221/commits","review_comments_url":"https://api.github.com/repos/emc-openstack/storops/pulls/221/comments","review_comment_url":"https://api.github.com/repos/emc-openstack/storops/pulls/comments{/number}","comments_url":"https://api.github.com/repos/emc-openstack/storops/issues/221/comments","statuses_url":"https://api.github.com/repos/emc-openstack/storops/statuses/94225811a50a5083260a2fbbb3a68b9528f1e5d9","head":{"label":"emc-openstack:update-lun-for-cg","ref":"update-lun-for-cg","sha":"94225811a50a5083260a2fbbb3a68b9528f1e5d9","user":{"login":"emc-openstack","id":6210145,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMTAxNDU=","avatar_url":"https://avatars0.githubusercontent.com/u/6210145?v=4","gravatar_id":"","url":"https://api.github.com/users/emc-openstack","html_url":"https://github.com/emc-openstack","followers_url":"https://api.github.com/users/emc-openstack/followers","following_url":"https://api.github.com/users/emc-openstack/following{/other_user}","gists_url":"https://api.github.com/users/emc-openstack/gists{/gist_id}","starred_url":"https://api.github.com/users/emc-openstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emc-openstack/subscriptions","organizations_url":"https://api.github.com/users/emc-openstack/orgs","repos_url":"https://api.github.com/users/emc-openstack/repos","events_url":"https://api.github.com/users/emc-openstack/events{/privacy}","received_events_url":"https://api.github.com/users/emc-openstack/received_events","type":"Organization","site_admin":false},"repo":{"id":53636425,"node_id":"MDEwOlJlcG9zaXRvcnk1MzYzNjQyNQ==","name":"storops","full_name":"emc-openstack/storops","owner":{"login":"emc-openstack","id":6210145,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMTAxNDU=","avatar_url":"https://avatars0.githubusercontent.com/u/6210145?v=4","gravatar_id":"","url":"https://api.github.com/users/emc-openstack","html_url":"https://github.com/emc-openstack","followers_url":"https://api.github.com/users/emc-openstack/followers","following_url":"https://api.github.com/users/emc-openstack/following{/other_user}","gists_url":"https://api.github.com/users/emc-openstack/gists{/gist_id}","starred_url":"https://api.github.com/users/emc-openstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emc-openstack/subscriptions","organizations_url":"https://api.github.com/users/emc-openstack/orgs","repos_url":"https://api.github.com/users/emc-openstack/repos","events_url":"https://api.github.com/users/emc-openstack/events{/privacy}","received_events_url":"https://api.github.com/users/emc-openstack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/emc-openstack/storops","description":"Python storage management library for VNX and Unity.","fork":false,"url":"https://api.github.com/repos/emc-openstack/storops","forks_url":"https://api.github.com/repos/emc-openstack/storops/forks","keys_url":"https://api.github.com/repos/emc-openstack/storops/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emc-openstack/storops/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emc-openstack/storops/teams","hooks_url":"https://api.github.com/repos/emc-openstack/storops/hooks","issue_events_url":"https://api.github.com/repos/emc-openstack/storops/issues/events{/number}","events_url":"https://api.github.com/repos/emc-openstack/storops/events","assignees_url":"https://api.github.com/repos/emc-openstack/storops/assignees{/user}","branches_url":"https://api.github.com/repos/emc-openstack/storops/branches{/branch}","tags_url":"https://api.github.com/repos/emc-openstack/storops/tags","blobs_url":"https://api.github.com/repos/emc-openstack/storops/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emc-openstack/storops/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emc-openstack/storops/git/refs{/sha}","trees_url":"https://api.github.com/repos/emc-openstack/storops/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emc-openstack/storops/statuses/{sha}","languages_url":"https://api.github.com/repos/emc-openstack/storops/languages","stargazers_url":"https://api.github.com/repos/emc-openstack/storops/stargazers","contributors_url":"https://api.github.com/repos/emc-openstack/storops/contributors","subscribers_url":"https://api.github.com/repos/emc-openstack/storops/subscribers","subscription_url":"https://api.github.com/repos/emc-openstack/storops/subscription","commits_url":"https://api.github.com/repos/emc-openstack/storops/commits{/sha}","git_commits_url":"https://api.github.com/repos/emc-openstack/storops/git/commits{/sha}","comments_url":"https://api.github.com/repos/emc-openstack/storops/comments{/number}","issue_comment_url":"https://api.github.com/repos/emc-openstack/storops/issues/comments{/number}","contents_url":"https://api.github.com/repos/emc-openstack/storops/contents/{+path}","compare_url":"https://api.github.com/repos/emc-openstack/storops/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emc-openstack/storops/merges","archive_url":"https://api.github.com/repos/emc-openstack/storops/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emc-openstack/storops/downloads","issues_url":"https://api.github.com/repos/emc-openstack/storops/issues{/number}","pulls_url":"https://api.github.com/repos/emc-openstack/storops/pulls{/number}","milestones_url":"https://api.github.com/repos/emc-openstack/storops/milestones{/number}","notifications_url":"https://api.github.com/repos/emc-openstack/storops/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emc-openstack/storops/labels{/name}","releases_url":"https://api.github.com/repos/emc-openstack/storops/releases{/id}","deployments_url":"https://api.github.com/repos/emc-openstack/storops/deployments","created_at":"2016-03-11T03:24:35Z","updated_at":"2018-06-08T09:23:18Z","pushed_at":"2018-06-08T09:23:17Z","git_url":"git://github.com/emc-openstack/storops.git","ssh_url":"git@github.com:emc-openstack/storops.git","clone_url":"https://github.com/emc-openstack/storops.git","svn_url":"https://github.com/emc-openstack/storops","homepage":"","size":2167,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":12,"open_issues":15,"watchers":24,"default_branch":"develop"}},"base":{"label":"emc-openstack:develop","ref":"develop","sha":"acc91e85fbf01eac9c27eb9170fe35e3ec5c24d5","user":{"login":"emc-openstack","id":6210145,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMTAxNDU=","avatar_url":"https://avatars0.githubusercontent.com/u/6210145?v=4","gravatar_id":"","url":"https://api.github.com/users/emc-openstack","html_url":"https://github.com/emc-openstack","followers_url":"https://api.github.com/users/emc-openstack/followers","following_url":"https://api.github.com/users/emc-openstack/following{/other_user}","gists_url":"https://api.github.com/users/emc-openstack/gists{/gist_id}","starred_url":"https://api.github.com/users/emc-openstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emc-openstack/subscriptions","organizations_url":"https://api.github.com/users/emc-openstack/orgs","repos_url":"https://api.github.com/users/emc-openstack/repos","events_url":"https://api.github.com/users/emc-openstack/events{/privacy}","received_events_url":"https://api.github.com/users/emc-openstack/received_events","type":"Organization","site_admin":false},"repo":{"id":53636425,"node_id":"MDEwOlJlcG9zaXRvcnk1MzYzNjQyNQ==","name":"storops","full_name":"emc-openstack/storops","owner":{"login":"emc-openstack","id":6210145,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMTAxNDU=","avatar_url":"https://avatars0.githubusercontent.com/u/6210145?v=4","gravatar_id":"","url":"https://api.github.com/users/emc-openstack","html_url":"https://github.com/emc-openstack","followers_url":"https://api.github.com/users/emc-openstack/followers","following_url":"https://api.github.com/users/emc-openstack/following{/other_user}","gists_url":"https://api.github.com/users/emc-openstack/gists{/gist_id}","starred_url":"https://api.github.com/users/emc-openstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emc-openstack/subscriptions","organizations_url":"https://api.github.com/users/emc-openstack/orgs","repos_url":"https://api.github.com/users/emc-openstack/repos","events_url":"https://api.github.com/users/emc-openstack/events{/privacy}","received_events_url":"https://api.github.com/users/emc-openstack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/emc-openstack/storops","description":"Python storage management library for VNX and Unity.","fork":false,"url":"https://api.github.com/repos/emc-openstack/storops","forks_url":"https://api.github.com/repos/emc-openstack/storops/forks","keys_url":"https://api.github.com/repos/emc-openstack/storops/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emc-openstack/storops/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emc-openstack/storops/teams","hooks_url":"https://api.github.com/repos/emc-openstack/storops/hooks","issue_events_url":"https://api.github.com/repos/emc-openstack/storops/issues/events{/number}","events_url":"https://api.github.com/repos/emc-openstack/storops/events","assignees_url":"https://api.github.com/repos/emc-openstack/storops/assignees{/user}","branches_url":"https://api.github.com/repos/emc-openstack/storops/branches{/branch}","tags_url":"https://api.github.com/repos/emc-openstack/storops/tags","blobs_url":"https://api.github.com/repos/emc-openstack/storops/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emc-openstack/storops/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emc-openstack/storops/git/refs{/sha}","trees_url":"https://api.github.com/repos/emc-openstack/storops/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emc-openstack/storops/statuses/{sha}","languages_url":"https://api.github.com/repos/emc-openstack/storops/languages","stargazers_url":"https://api.github.com/repos/emc-openstack/storops/stargazers","contributors_url":"https://api.github.com/repos/emc-openstack/storops/contributors","subscribers_url":"https://api.github.com/repos/emc-openstack/storops/subscribers","subscription_url":"https://api.github.com/repos/emc-openstack/storops/subscription","commits_url":"https://api.github.com/repos/emc-openstack/storops/commits{/sha}","git_commits_url":"https://api.github.com/repos/emc-openstack/storops/git/commits{/sha}","comments_url":"https://api.github.com/repos/emc-openstack/storops/comments{/number}","issue_comment_url":"https://api.github.com/repos/emc-openstack/storops/issues/comments{/number}","contents_url":"https://api.github.com/repos/emc-openstack/storops/contents/{+path}","compare_url":"https://api.github.com/repos/emc-openstack/storops/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emc-openstack/storops/merges","archive_url":"https://api.github.com/repos/emc-openstack/storops/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emc-openstack/storops/downloads","issues_url":"https://api.github.com/repos/emc-openstack/storops/issues{/number}","pulls_url":"https://api.github.com/repos/emc-openstack/storops/pulls{/number}","milestones_url":"https://api.github.com/repos/emc-openstack/storops/milestones{/number}","notifications_url":"https://api.github.com/repos/emc-openstack/storops/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emc-openstack/storops/labels{/name}","releases_url":"https://api.github.com/repos/emc-openstack/storops/releases{/id}","deployments_url":"https://api.github.com/repos/emc-openstack/storops/deployments","created_at":"2016-03-11T03:24:35Z","updated_at":"2018-06-08T09:23:18Z","pushed_at":"2018-06-08T09:23:17Z","git_url":"git://github.com/emc-openstack/storops.git","ssh_url":"git@github.com:emc-openstack/storops.git","clone_url":"https://github.com/emc-openstack/storops.git","svn_url":"https://github.com/emc-openstack/storops","homepage":"","size":2167,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":12,"open_issues":15,"watchers":24,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/emc-openstack/storops/pulls/221"},"html":{"href":"https://github.com/emc-openstack/storops/pull/221"},"issue":{"href":"https://api.github.com/repos/emc-openstack/storops/issues/221"},"comments":{"href":"https://api.github.com/repos/emc-openstack/storops/issues/221/comments"},"review_comments":{"href":"https://api.github.com/repos/emc-openstack/storops/pulls/221/comments"},"review_comment":{"href":"https://api.github.com/repos/emc-openstack/storops/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/emc-openstack/storops/pulls/221/commits"},"statuses":{"href":"https://api.github.com/repos/emc-openstack/storops/statuses/94225811a50a5083260a2fbbb3a68b9528f1e5d9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Murray-LIANG"}}