{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-cli/pulls/comments/192010127","pull_request_review_id":124695773,"id":192010127,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjAxMDEyNw==","diff_hunk":"@@ -91,6 +94,28 @@ def get_registry_by_name(cli_ctx, registry_name, resource_group_name=None):\n     return client.get(resource_group_name, registry_name), resource_group_name\n \n \n+def get_registry_from_name(cli_ctx, login_server=None, registry_name=None):\n+    \"\"\"Returns a Registry object for the specified name.\n+    :param str name: either the registry name or the login server of the registry.\n+    \"\"\"\n+    client = get_acr_service_client(cli_ctx).registries\n+    registry_list = client.list()\n+\n+    if registry_name:\n+        elements = [item for item in registry_list if\n+                    item.login_server.lower() == login_server.lower() or item.name.lower() == registry_name.lower()]","path":"src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/_utils.py","position":30,"original_position":30,"commit_id":"ce702036bd8f1ab47525f7f982596fe7e6feff99","original_commit_id":"ce702036bd8f1ab47525f7f982596fe7e6feff99","user":{"login":"djyou","id":3630974,"node_id":"MDQ6VXNlcjM2MzA5NzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/3630974?v=4","gravatar_id":"","url":"https://api.github.com/users/djyou","html_url":"https://github.com/djyou","followers_url":"https://api.github.com/users/djyou/followers","following_url":"https://api.github.com/users/djyou/following{/other_user}","gists_url":"https://api.github.com/users/djyou/gists{/gist_id}","starred_url":"https://api.github.com/users/djyou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djyou/subscriptions","organizations_url":"https://api.github.com/users/djyou/orgs","repos_url":"https://api.github.com/users/djyou/repos","events_url":"https://api.github.com/users/djyou/events{/privacy}","received_events_url":"https://api.github.com/users/djyou/received_events","type":"User","site_admin":false},"body":"I think this method should be generic enough to accept either `name` or `login_server` (i.e., both should be default to None). Just use the non-empty ones to compare and filter the results.\r\n\r\nI am hoping this method can further be reused to support scenarios such as `acr login -n registry.azurecr.io`.","created_at":"2018-05-31T07:28:14Z","updated_at":"2018-05-31T07:28:14Z","html_url":"https://github.com/Azure/azure-cli/pull/6375#discussion_r192010127","pull_request_url":"https://api.github.com/repos/Azure/azure-cli/pulls/6375","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/comments/192010127"},"html":{"href":"https://github.com/Azure/azure-cli/pull/6375#discussion_r192010127"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/6375"}},"in_reply_to_id":191990495},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-cli/pulls/6375","id":188808934,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg4ODA4OTM0","html_url":"https://github.com/Azure/azure-cli/pull/6375","diff_url":"https://github.com/Azure/azure-cli/pull/6375.diff","patch_url":"https://github.com/Azure/azure-cli/pull/6375.patch","issue_url":"https://api.github.com/repos/Azure/azure-cli/issues/6375","number":6375,"state":"open","locked":false,"title":"Add ACR Image Import Commands","user":{"login":"NatalieGong","id":7592862,"node_id":"MDQ6VXNlcjc1OTI4NjI=","avatar_url":"https://avatars0.githubusercontent.com/u/7592862?v=4","gravatar_id":"","url":"https://api.github.com/users/NatalieGong","html_url":"https://github.com/NatalieGong","followers_url":"https://api.github.com/users/NatalieGong/followers","following_url":"https://api.github.com/users/NatalieGong/following{/other_user}","gists_url":"https://api.github.com/users/NatalieGong/gists{/gist_id}","starred_url":"https://api.github.com/users/NatalieGong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NatalieGong/subscriptions","organizations_url":"https://api.github.com/users/NatalieGong/orgs","repos_url":"https://api.github.com/users/NatalieGong/repos","events_url":"https://api.github.com/users/NatalieGong/events{/privacy}","received_events_url":"https://api.github.com/users/NatalieGong/received_events","type":"User","site_admin":false},"body":"---\r\n\r\nThis checklist is used to make sure that common guidelines for a pull request are followed.\r\n\r\n- [ ] The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see [Modifying change log](https://github.com/Azure/azure-cli/tree/master/doc/authoring_command_modules#modify-change-log)).\r\n\r\n- [ ] I adhere to the [Command Guidelines](https://github.com/Azure/azure-cli/blob/dev/doc/command_guidelines.md).\r\n","created_at":"2018-05-17T17:30:12Z","updated_at":"2018-05-31T07:28:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b989424a48d71b5bfd1341a21609b0a48d6935fc","assignee":null,"assignees":[],"requested_reviewers":[{"login":"yugangw-msft","id":6014209,"node_id":"MDQ6VXNlcjYwMTQyMDk=","avatar_url":"https://avatars1.githubusercontent.com/u/6014209?v=4","gravatar_id":"","url":"https://api.github.com/users/yugangw-msft","html_url":"https://github.com/yugangw-msft","followers_url":"https://api.github.com/users/yugangw-msft/followers","following_url":"https://api.github.com/users/yugangw-msft/following{/other_user}","gists_url":"https://api.github.com/users/yugangw-msft/gists{/gist_id}","starred_url":"https://api.github.com/users/yugangw-msft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yugangw-msft/subscriptions","organizations_url":"https://api.github.com/users/yugangw-msft/orgs","repos_url":"https://api.github.com/users/yugangw-msft/repos","events_url":"https://api.github.com/users/yugangw-msft/events{/privacy}","received_events_url":"https://api.github.com/users/yugangw-msft/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":465806087,"node_id":"MDU6TGFiZWw0NjU4MDYwODc=","url":"https://api.github.com/repos/Azure/azure-cli/labels/ACR","name":"ACR","color":"d4c5f9","default":false},{"id":365197827,"node_id":"MDU6TGFiZWwzNjUxOTc4Mjc=","url":"https://api.github.com/repos/Azure/azure-cli/labels/New%20Command(s)","name":"New Command(s)","color":"c2e0c6","default":false}],"milestone":{"url":"https://api.github.com/repos/Azure/azure-cli/milestones/40","html_url":"https://github.com/Azure/azure-cli/milestone/40","labels_url":"https://api.github.com/repos/Azure/azure-cli/milestones/40/labels","id":3330816,"node_id":"MDk6TWlsZXN0b25lMzMzMDgxNg==","number":40,"title":"Sprint 38","description":"Release date: 6/5","creator":{"login":"tjprescott","id":5723682,"node_id":"MDQ6VXNlcjU3MjM2ODI=","avatar_url":"https://avatars2.githubusercontent.com/u/5723682?v=4","gravatar_id":"","url":"https://api.github.com/users/tjprescott","html_url":"https://github.com/tjprescott","followers_url":"https://api.github.com/users/tjprescott/followers","following_url":"https://api.github.com/users/tjprescott/following{/other_user}","gists_url":"https://api.github.com/users/tjprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/tjprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjprescott/subscriptions","organizations_url":"https://api.github.com/users/tjprescott/orgs","repos_url":"https://api.github.com/users/tjprescott/repos","events_url":"https://api.github.com/users/tjprescott/events{/privacy}","received_events_url":"https://api.github.com/users/tjprescott/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":9,"state":"open","created_at":"2018-05-08T17:45:53Z","updated_at":"2018-05-31T05:48:06Z","due_on":"2018-06-01T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/Azure/azure-cli/pulls/6375/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-cli/pulls/6375/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-cli/issues/6375/comments","statuses_url":"https://api.github.com/repos/Azure/azure-cli/statuses/ce702036bd8f1ab47525f7f982596fe7e6feff99","head":{"label":"AzureCR:natalie-release","ref":"natalie-release","sha":"ce702036bd8f1ab47525f7f982596fe7e6feff99","user":{"login":"AzureCR","id":8304256,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgzMDQyNTY=","avatar_url":"https://avatars1.githubusercontent.com/u/8304256?v=4","gravatar_id":"","url":"https://api.github.com/users/AzureCR","html_url":"https://github.com/AzureCR","followers_url":"https://api.github.com/users/AzureCR/followers","following_url":"https://api.github.com/users/AzureCR/following{/other_user}","gists_url":"https://api.github.com/users/AzureCR/gists{/gist_id}","starred_url":"https://api.github.com/users/AzureCR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzureCR/subscriptions","organizations_url":"https://api.github.com/users/AzureCR/orgs","repos_url":"https://api.github.com/users/AzureCR/repos","events_url":"https://api.github.com/users/AzureCR/events{/privacy}","received_events_url":"https://api.github.com/users/AzureCR/received_events","type":"Organization","site_admin":false},"repo":{"id":65927884,"node_id":"MDEwOlJlcG9zaXRvcnk2NTkyNzg4NA==","name":"azure-cli","full_name":"AzureCR/azure-cli","owner":{"login":"AzureCR","id":8304256,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgzMDQyNTY=","avatar_url":"https://avatars1.githubusercontent.com/u/8304256?v=4","gravatar_id":"","url":"https://api.github.com/users/AzureCR","html_url":"https://github.com/AzureCR","followers_url":"https://api.github.com/users/AzureCR/followers","following_url":"https://api.github.com/users/AzureCR/following{/other_user}","gists_url":"https://api.github.com/users/AzureCR/gists{/gist_id}","starred_url":"https://api.github.com/users/AzureCR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzureCR/subscriptions","organizations_url":"https://api.github.com/users/AzureCR/orgs","repos_url":"https://api.github.com/users/AzureCR/repos","events_url":"https://api.github.com/users/AzureCR/events{/privacy}","received_events_url":"https://api.github.com/users/AzureCR/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AzureCR/azure-cli","description":"Command-line tools for Azure.","fork":true,"url":"https://api.github.com/repos/AzureCR/azure-cli","forks_url":"https://api.github.com/repos/AzureCR/azure-cli/forks","keys_url":"https://api.github.com/repos/AzureCR/azure-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AzureCR/azure-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AzureCR/azure-cli/teams","hooks_url":"https://api.github.com/repos/AzureCR/azure-cli/hooks","issue_events_url":"https://api.github.com/repos/AzureCR/azure-cli/issues/events{/number}","events_url":"https://api.github.com/repos/AzureCR/azure-cli/events","assignees_url":"https://api.github.com/repos/AzureCR/azure-cli/assignees{/user}","branches_url":"https://api.github.com/repos/AzureCR/azure-cli/branches{/branch}","tags_url":"https://api.github.com/repos/AzureCR/azure-cli/tags","blobs_url":"https://api.github.com/repos/AzureCR/azure-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AzureCR/azure-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AzureCR/azure-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/AzureCR/azure-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AzureCR/azure-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/AzureCR/azure-cli/languages","stargazers_url":"https://api.github.com/repos/AzureCR/azure-cli/stargazers","contributors_url":"https://api.github.com/repos/AzureCR/azure-cli/contributors","subscribers_url":"https://api.github.com/repos/AzureCR/azure-cli/subscribers","subscription_url":"https://api.github.com/repos/AzureCR/azure-cli/subscription","commits_url":"https://api.github.com/repos/AzureCR/azure-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/AzureCR/azure-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/AzureCR/azure-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/AzureCR/azure-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/AzureCR/azure-cli/contents/{+path}","compare_url":"https://api.github.com/repos/AzureCR/azure-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AzureCR/azure-cli/merges","archive_url":"https://api.github.com/repos/AzureCR/azure-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AzureCR/azure-cli/downloads","issues_url":"https://api.github.com/repos/AzureCR/azure-cli/issues{/number}","pulls_url":"https://api.github.com/repos/AzureCR/azure-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/AzureCR/azure-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/AzureCR/azure-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AzureCR/azure-cli/labels{/name}","releases_url":"https://api.github.com/repos/AzureCR/azure-cli/releases{/id}","deployments_url":"https://api.github.com/repos/AzureCR/azure-cli/deployments","created_at":"2016-08-17T17:24:59Z","updated_at":"2018-05-17T04:08:46Z","pushed_at":"2018-05-31T04:45:52Z","git_url":"git://github.com/AzureCR/azure-cli.git","ssh_url":"git@github.com:AzureCR/azure-cli.git","clone_url":"https://github.com/AzureCR/azure-cli.git","svn_url":"https://github.com/AzureCR/azure-cli","homepage":null,"size":42697,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":4,"watchers":2,"default_branch":"dev"}},"base":{"label":"Azure:dev","ref":"dev","sha":"ee9d00cca46e05a3183c369d461f335f6906a8d6","user":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":51040886,"node_id":"MDEwOlJlcG9zaXRvcnk1MTA0MDg4Ng==","name":"azure-cli","full_name":"Azure/azure-cli","owner":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-cli","description":"Command-line tools for Azure.","fork":false,"url":"https://api.github.com/repos/Azure/azure-cli","forks_url":"https://api.github.com/repos/Azure/azure-cli/forks","keys_url":"https://api.github.com/repos/Azure/azure-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-cli/teams","hooks_url":"https://api.github.com/repos/Azure/azure-cli/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-cli/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-cli/events","assignees_url":"https://api.github.com/repos/Azure/azure-cli/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-cli/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-cli/tags","blobs_url":"https://api.github.com/repos/Azure/azure-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-cli/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-cli/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-cli/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-cli/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-cli/subscription","commits_url":"https://api.github.com/repos/Azure/azure-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-cli/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-cli/merges","archive_url":"https://api.github.com/repos/Azure/azure-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-cli/downloads","issues_url":"https://api.github.com/repos/Azure/azure-cli/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-cli/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-cli/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-cli/deployments","created_at":"2016-02-04T00:21:51Z","updated_at":"2018-05-31T05:48:10Z","pushed_at":"2018-05-31T05:48:06Z","git_url":"git://github.com/Azure/azure-cli.git","ssh_url":"git@github.com:Azure/azure-cli.git","clone_url":"https://github.com/Azure/azure-cli.git","svn_url":"https://github.com/Azure/azure-cli","homepage":null,"size":42691,"stargazers_count":762,"watchers_count":762,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":461,"mirror_url":null,"archived":false,"open_issues_count":738,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":461,"open_issues":738,"watchers":762,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/6375"},"html":{"href":"https://github.com/Azure/azure-cli/pull/6375"},"issue":{"href":"https://api.github.com/repos/Azure/azure-cli/issues/6375"},"comments":{"href":"https://api.github.com/repos/Azure/azure-cli/issues/6375/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/6375/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/6375/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-cli/statuses/ce702036bd8f1ab47525f7f982596fe7e6feff99"}},"author_association":"NONE"}}
{"actor":{"display_login":"djyou"}}