{"action":"created","comment":{"url":"https://api.github.com/repos/alibaba/ansible-provider/pulls/comments/128961365","pull_request_review_id":51685977,"id":128961365,"diff_hunk":"@@ -310,40 +310,37 @@ def main():\n         if state == \"absent\" and cur_slb:\n             changed = cur_slb.delete()\n             module.exit_json(changed=changed, load_balancer_id=cur_slb.load_balancer_id)    \n-        elif state == \"present\" :\n+        elif state == \"present\":\n             if load_balancer_status and cur_slb:\n                 #set status\n                 changed = cur_slb.set_status(load_balancer_status)\n                 if changed:\n-                    cur_slb.load_balancer_status = load_balancer_status  \n-                module.exit_json(changed=changed, load_balancer = get_info(cur_slb)) \n-            elif  load_balancer_name and cur_slb:\n+                    cur_slb.load_balancer_status = load_balancer_status\n+                module.exit_json(changed=changed, load_balancer = get_info(cur_slb), load_balancer_id = cur_slb.load_balancer_id) \n+            elif load_balancer_name and cur_slb:\n                 #set name  \n                 changed = cur_slb.modify_name(load_balancer_name)\n                 if changed:\n                     cur_slb.load_balancer_name = load_balancer_name \n-                module.exit_json(changed=changed, load_balancer = get_info(cur_slb)) \n+                module.exit_json(changed=changed, load_balancer = get_info(cur_slb), load_balancer_id = cur_slb.load_balancer_id) \n             elif (internet_charge_type or bandwidth) and cur_slb:\n                 #set spec\n                 changed = cur_slb.modify_spec(internet_charge_type=internet_charge_type, bandwidth=bandwidth)\n                 if changed:\n                     cur_slb.internet_charge_type = internet_charge_type\n                     cur_slb.bandwidth = bandwidth    \n-                module.exit_json(changed=changed, load_balancer = get_info(cur_slb)) \n+                module.exit_json(changed=changed, load_balancer = get_info(cur_slb), load_balancer_id = cur_slb.load_balancer_id) \n             elif not cur_slb:\n                 res_obj = slb.create_load_balancer(load_balancer_name=load_balancer_name,\n                                                  address_type=address_type, vswitch_id=vswitch_id,\n                                                  internet_charge_type=internet_charge_type,\n                                                  master_zone_id=master_zone_id, slave_zone_id=slave_zone_id,\n                                                  bandwidth=bandwidth)\n                 changed = True\n-                module.exit_json(changed=changed, load_balancer = get_info(res_obj))\n+                module.exit_json(changed=changed, load_balancer = get_info(res_obj), load_balancer_id = res_obj.load_balancer_id)\n             else:\n-                module.fail_json(msg='opration failed, state: {0}'.format(state))\n+                module.exit_json(changed=changed, load_balancer=get_info(cur_slb), load_balancer_id=cur_slb.load_balancer_id)","path":"lib/ansible/modules/cloud/alicloud/alicloud_slb_lb.py","position":null,"original_position":50,"commit_id":"331f32c37a88672684541cb866ca44ffbcee6d49","original_commit_id":"331f32c37a88672684541cb866ca44ffbcee6d49","user":{"login":"xiaozhu36","id":21300084,"avatar_url":"https://avatars1.githubusercontent.com/u/21300084?v=4","gravatar_id":"","url":"https://api.github.com/users/xiaozhu36","html_url":"https://github.com/xiaozhu36","followers_url":"https://api.github.com/users/xiaozhu36/followers","following_url":"https://api.github.com/users/xiaozhu36/following{/other_user}","gists_url":"https://api.github.com/users/xiaozhu36/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaozhu36/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaozhu36/subscriptions","organizations_url":"https://api.github.com/users/xiaozhu36/orgs","repos_url":"https://api.github.com/users/xiaozhu36/repos","events_url":"https://api.github.com/users/xiaozhu36/events{/privacy}","received_events_url":"https://api.github.com/users/xiaozhu36/received_events","type":"User","site_admin":false},"body":"把present的逻辑再重新梳理下：\r\nif present：\r\n  if not cur_slb:\r\n     ...\r\n  if load_balancer_status:\r\n    ...\r\n  elif load_balancer_name:\r\n    ...\r\n  elif internet_charge_type or bandwidth:\r\n    ...\r\n  else:\r\n    ...\r\n\r\n另外，再全文检查下每一行中是否有多余的空格和不必要的提醒，如果有提醒，尽量解决","created_at":"2017-07-24T07:01:40Z","updated_at":"2017-07-24T07:02:03Z","html_url":"https://github.com/alibaba/ansible-provider/pull/22#discussion_r128961365","pull_request_url":"https://api.github.com/repos/alibaba/ansible-provider/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/alibaba/ansible-provider/pulls/comments/128961365"},"html":{"href":"https://github.com/alibaba/ansible-provider/pull/22#discussion_r128961365"},"pull_request":{"href":"https://api.github.com/repos/alibaba/ansible-provider/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/alibaba/ansible-provider/pulls/22","id":129912800,"html_url":"https://github.com/alibaba/ansible-provider/pull/22","diff_url":"https://github.com/alibaba/ansible-provider/pull/22.diff","patch_url":"https://github.com/alibaba/ansible-provider/pull/22.patch","issue_url":"https://api.github.com/repos/alibaba/ansible-provider/issues/22","number":22,"state":"open","locked":false,"title":"Dev pr","user":{"login":"lq0216","id":24906984,"avatar_url":"https://avatars2.githubusercontent.com/u/24906984?v=4","gravatar_id":"","url":"https://api.github.com/users/lq0216","html_url":"https://github.com/lq0216","followers_url":"https://api.github.com/users/lq0216/followers","following_url":"https://api.github.com/users/lq0216/following{/other_user}","gists_url":"https://api.github.com/users/lq0216/gists{/gist_id}","starred_url":"https://api.github.com/users/lq0216/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lq0216/subscriptions","organizations_url":"https://api.github.com/users/lq0216/orgs","repos_url":"https://api.github.com/users/lq0216/repos","events_url":"https://api.github.com/users/lq0216/events{/privacy}","received_events_url":"https://api.github.com/users/lq0216/received_events","type":"User","site_admin":false},"body":"add eip in vpc","created_at":"2017-07-11T13:50:23Z","updated_at":"2017-07-24T07:02:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f9eaf0f9205ce9d5415fdadf7ed98a65799358a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/alibaba/ansible-provider/pulls/22/commits","review_comments_url":"https://api.github.com/repos/alibaba/ansible-provider/pulls/22/comments","review_comment_url":"https://api.github.com/repos/alibaba/ansible-provider/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alibaba/ansible-provider/issues/22/comments","statuses_url":"https://api.github.com/repos/alibaba/ansible-provider/statuses/331f32c37a88672684541cb866ca44ffbcee6d49","head":{"label":"lq0216:dev-pr","ref":"dev-pr","sha":"331f32c37a88672684541cb866ca44ffbcee6d49","user":{"login":"lq0216","id":24906984,"avatar_url":"https://avatars2.githubusercontent.com/u/24906984?v=4","gravatar_id":"","url":"https://api.github.com/users/lq0216","html_url":"https://github.com/lq0216","followers_url":"https://api.github.com/users/lq0216/followers","following_url":"https://api.github.com/users/lq0216/following{/other_user}","gists_url":"https://api.github.com/users/lq0216/gists{/gist_id}","starred_url":"https://api.github.com/users/lq0216/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lq0216/subscriptions","organizations_url":"https://api.github.com/users/lq0216/orgs","repos_url":"https://api.github.com/users/lq0216/repos","events_url":"https://api.github.com/users/lq0216/events{/privacy}","received_events_url":"https://api.github.com/users/lq0216/received_events","type":"User","site_admin":false},"repo":{"id":96866875,"name":"ansible-provider","full_name":"lq0216/ansible-provider","owner":{"login":"lq0216","id":24906984,"avatar_url":"https://avatars2.githubusercontent.com/u/24906984?v=4","gravatar_id":"","url":"https://api.github.com/users/lq0216","html_url":"https://github.com/lq0216","followers_url":"https://api.github.com/users/lq0216/followers","following_url":"https://api.github.com/users/lq0216/following{/other_user}","gists_url":"https://api.github.com/users/lq0216/gists{/gist_id}","starred_url":"https://api.github.com/users/lq0216/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lq0216/subscriptions","organizations_url":"https://api.github.com/users/lq0216/orgs","repos_url":"https://api.github.com/users/lq0216/repos","events_url":"https://api.github.com/users/lq0216/events{/privacy}","received_events_url":"https://api.github.com/users/lq0216/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lq0216/ansible-provider","description":null,"fork":true,"url":"https://api.github.com/repos/lq0216/ansible-provider","forks_url":"https://api.github.com/repos/lq0216/ansible-provider/forks","keys_url":"https://api.github.com/repos/lq0216/ansible-provider/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lq0216/ansible-provider/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lq0216/ansible-provider/teams","hooks_url":"https://api.github.com/repos/lq0216/ansible-provider/hooks","issue_events_url":"https://api.github.com/repos/lq0216/ansible-provider/issues/events{/number}","events_url":"https://api.github.com/repos/lq0216/ansible-provider/events","assignees_url":"https://api.github.com/repos/lq0216/ansible-provider/assignees{/user}","branches_url":"https://api.github.com/repos/lq0216/ansible-provider/branches{/branch}","tags_url":"https://api.github.com/repos/lq0216/ansible-provider/tags","blobs_url":"https://api.github.com/repos/lq0216/ansible-provider/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lq0216/ansible-provider/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lq0216/ansible-provider/git/refs{/sha}","trees_url":"https://api.github.com/repos/lq0216/ansible-provider/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lq0216/ansible-provider/statuses/{sha}","languages_url":"https://api.github.com/repos/lq0216/ansible-provider/languages","stargazers_url":"https://api.github.com/repos/lq0216/ansible-provider/stargazers","contributors_url":"https://api.github.com/repos/lq0216/ansible-provider/contributors","subscribers_url":"https://api.github.com/repos/lq0216/ansible-provider/subscribers","subscription_url":"https://api.github.com/repos/lq0216/ansible-provider/subscription","commits_url":"https://api.github.com/repos/lq0216/ansible-provider/commits{/sha}","git_commits_url":"https://api.github.com/repos/lq0216/ansible-provider/git/commits{/sha}","comments_url":"https://api.github.com/repos/lq0216/ansible-provider/comments{/number}","issue_comment_url":"https://api.github.com/repos/lq0216/ansible-provider/issues/comments{/number}","contents_url":"https://api.github.com/repos/lq0216/ansible-provider/contents/{+path}","compare_url":"https://api.github.com/repos/lq0216/ansible-provider/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lq0216/ansible-provider/merges","archive_url":"https://api.github.com/repos/lq0216/ansible-provider/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lq0216/ansible-provider/downloads","issues_url":"https://api.github.com/repos/lq0216/ansible-provider/issues{/number}","pulls_url":"https://api.github.com/repos/lq0216/ansible-provider/pulls{/number}","milestones_url":"https://api.github.com/repos/lq0216/ansible-provider/milestones{/number}","notifications_url":"https://api.github.com/repos/lq0216/ansible-provider/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lq0216/ansible-provider/labels{/name}","releases_url":"https://api.github.com/repos/lq0216/ansible-provider/releases{/id}","deployments_url":"https://api.github.com/repos/lq0216/ansible-provider/deployments","created_at":"2017-07-11T07:56:20Z","updated_at":"2017-07-11T07:56:22Z","pushed_at":"2017-07-24T06:50:57Z","git_url":"git://github.com/lq0216/ansible-provider.git","ssh_url":"git@github.com:lq0216/ansible-provider.git","clone_url":"https://github.com/lq0216/ansible-provider.git","svn_url":"https://github.com/lq0216/ansible-provider","homepage":null,"size":1057,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"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":"alibaba:dev","ref":"dev","sha":"ed9ba6bf5fde765623684419dcac02dea230b891","user":{"login":"alibaba","id":1961952,"avatar_url":"https://avatars1.githubusercontent.com/u/1961952?v=4","gravatar_id":"","url":"https://api.github.com/users/alibaba","html_url":"https://github.com/alibaba","followers_url":"https://api.github.com/users/alibaba/followers","following_url":"https://api.github.com/users/alibaba/following{/other_user}","gists_url":"https://api.github.com/users/alibaba/gists{/gist_id}","starred_url":"https://api.github.com/users/alibaba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibaba/subscriptions","organizations_url":"https://api.github.com/users/alibaba/orgs","repos_url":"https://api.github.com/users/alibaba/repos","events_url":"https://api.github.com/users/alibaba/events{/privacy}","received_events_url":"https://api.github.com/users/alibaba/received_events","type":"Organization","site_admin":false},"repo":{"id":75266817,"name":"ansible-provider","full_name":"alibaba/ansible-provider","owner":{"login":"alibaba","id":1961952,"avatar_url":"https://avatars1.githubusercontent.com/u/1961952?v=4","gravatar_id":"","url":"https://api.github.com/users/alibaba","html_url":"https://github.com/alibaba","followers_url":"https://api.github.com/users/alibaba/followers","following_url":"https://api.github.com/users/alibaba/following{/other_user}","gists_url":"https://api.github.com/users/alibaba/gists{/gist_id}","starred_url":"https://api.github.com/users/alibaba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibaba/subscriptions","organizations_url":"https://api.github.com/users/alibaba/orgs","repos_url":"https://api.github.com/users/alibaba/repos","events_url":"https://api.github.com/users/alibaba/events{/privacy}","received_events_url":"https://api.github.com/users/alibaba/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alibaba/ansible-provider","description":null,"fork":false,"url":"https://api.github.com/repos/alibaba/ansible-provider","forks_url":"https://api.github.com/repos/alibaba/ansible-provider/forks","keys_url":"https://api.github.com/repos/alibaba/ansible-provider/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alibaba/ansible-provider/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alibaba/ansible-provider/teams","hooks_url":"https://api.github.com/repos/alibaba/ansible-provider/hooks","issue_events_url":"https://api.github.com/repos/alibaba/ansible-provider/issues/events{/number}","events_url":"https://api.github.com/repos/alibaba/ansible-provider/events","assignees_url":"https://api.github.com/repos/alibaba/ansible-provider/assignees{/user}","branches_url":"https://api.github.com/repos/alibaba/ansible-provider/branches{/branch}","tags_url":"https://api.github.com/repos/alibaba/ansible-provider/tags","blobs_url":"https://api.github.com/repos/alibaba/ansible-provider/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alibaba/ansible-provider/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alibaba/ansible-provider/git/refs{/sha}","trees_url":"https://api.github.com/repos/alibaba/ansible-provider/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alibaba/ansible-provider/statuses/{sha}","languages_url":"https://api.github.com/repos/alibaba/ansible-provider/languages","stargazers_url":"https://api.github.com/repos/alibaba/ansible-provider/stargazers","contributors_url":"https://api.github.com/repos/alibaba/ansible-provider/contributors","subscribers_url":"https://api.github.com/repos/alibaba/ansible-provider/subscribers","subscription_url":"https://api.github.com/repos/alibaba/ansible-provider/subscription","commits_url":"https://api.github.com/repos/alibaba/ansible-provider/commits{/sha}","git_commits_url":"https://api.github.com/repos/alibaba/ansible-provider/git/commits{/sha}","comments_url":"https://api.github.com/repos/alibaba/ansible-provider/comments{/number}","issue_comment_url":"https://api.github.com/repos/alibaba/ansible-provider/issues/comments{/number}","contents_url":"https://api.github.com/repos/alibaba/ansible-provider/contents/{+path}","compare_url":"https://api.github.com/repos/alibaba/ansible-provider/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alibaba/ansible-provider/merges","archive_url":"https://api.github.com/repos/alibaba/ansible-provider/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alibaba/ansible-provider/downloads","issues_url":"https://api.github.com/repos/alibaba/ansible-provider/issues{/number}","pulls_url":"https://api.github.com/repos/alibaba/ansible-provider/pulls{/number}","milestones_url":"https://api.github.com/repos/alibaba/ansible-provider/milestones{/number}","notifications_url":"https://api.github.com/repos/alibaba/ansible-provider/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alibaba/ansible-provider/labels{/name}","releases_url":"https://api.github.com/repos/alibaba/ansible-provider/releases{/id}","deployments_url":"https://api.github.com/repos/alibaba/ansible-provider/deployments","created_at":"2016-12-01T07:23:53Z","updated_at":"2017-07-20T09:01:42Z","pushed_at":"2017-07-24T06:50:58Z","git_url":"git://github.com/alibaba/ansible-provider.git","ssh_url":"git@github.com:alibaba/ansible-provider.git","clone_url":"https://github.com/alibaba/ansible-provider.git","svn_url":"https://github.com/alibaba/ansible-provider","homepage":null,"size":961,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":4,"forks":8,"open_issues":4,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alibaba/ansible-provider/pulls/22"},"html":{"href":"https://github.com/alibaba/ansible-provider/pull/22"},"issue":{"href":"https://api.github.com/repos/alibaba/ansible-provider/issues/22"},"comments":{"href":"https://api.github.com/repos/alibaba/ansible-provider/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/alibaba/ansible-provider/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/alibaba/ansible-provider/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alibaba/ansible-provider/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/alibaba/ansible-provider/statuses/331f32c37a88672684541cb866ca44ffbcee6d49"}}}}
{"actor":{"display_login":"xiaozhu36"}}