{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-cli/pulls/comments/172942435","pull_request_review_id":102047145,"id":172942435,"diff_hunk":"@@ -207,3 +207,16 @@ def normalize_blob_file_path(path, name):\n     if path:\n         name = path_sep.join((path, name))\n     return path_sep.join(os.path.normpath(name).split(os.path.sep)).strip(path_sep)\n+\n+\n+def check_precondition_success(func):\n+    def new_func(*args, **kwargs):\n+        from azure.common import AzureHttpError\n+        try:\n+            return (True, func(*args, **kwargs))\n+        except AzureHttpError as ex:\n+            # Precondition failed error\n+            if ex.status_code != 412:\n+                raise ex","path":"src/command_modules/azure-cli-storage/azure/cli/command_modules/storage/util.py","position":14,"original_position":14,"commit_id":"5d5fe1e317cae20429e274a5fcfd217063cbc29c","original_commit_id":"5d5fe1e317cae20429e274a5fcfd217063cbc29c","user":{"login":"troydai","id":1329240,"avatar_url":"https://avatars2.githubusercontent.com/u/1329240?v=4","gravatar_id":"","url":"https://api.github.com/users/troydai","html_url":"https://github.com/troydai","followers_url":"https://api.github.com/users/troydai/followers","following_url":"https://api.github.com/users/troydai/following{/other_user}","gists_url":"https://api.github.com/users/troydai/gists{/gist_id}","starred_url":"https://api.github.com/users/troydai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troydai/subscriptions","organizations_url":"https://api.github.com/users/troydai/orgs","repos_url":"https://api.github.com/users/troydai/repos","events_url":"https://api.github.com/users/troydai/events{/privacy}","received_events_url":"https://api.github.com/users/troydai/received_events","type":"User","site_admin":false},"body":"Also, can we log a warning here?","created_at":"2018-03-07T18:37:46Z","updated_at":"2018-03-07T18:38:35Z","html_url":"https://github.com/Azure/azure-cli/pull/5702#discussion_r172942435","pull_request_url":"https://api.github.com/repos/Azure/azure-cli/pulls/5702","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/comments/172942435"},"html":{"href":"https://github.com/Azure/azure-cli/pull/5702#discussion_r172942435"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/5702"}},"in_reply_to_id":172939380},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-cli/pulls/5702","id":172086643,"html_url":"https://github.com/Azure/azure-cli/pull/5702","diff_url":"https://github.com/Azure/azure-cli/pull/5702.diff","patch_url":"https://github.com/Azure/azure-cli/pull/5702.patch","issue_url":"https://api.github.com/repos/Azure/azure-cli/issues/5702","number":5702,"state":"open","locked":false,"title":"Batch commands no longer throw error upon precondition failures.","user":{"login":"williexu","id":8580552,"avatar_url":"https://avatars2.githubusercontent.com/u/8580552?v=4","gravatar_id":"","url":"https://api.github.com/users/williexu","html_url":"https://github.com/williexu","followers_url":"https://api.github.com/users/williexu/followers","following_url":"https://api.github.com/users/williexu/following{/other_user}","gists_url":"https://api.github.com/users/williexu/gists{/gist_id}","starred_url":"https://api.github.com/users/williexu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williexu/subscriptions","organizations_url":"https://api.github.com/users/williexu/orgs","repos_url":"https://api.github.com/users/williexu/repos","events_url":"https://api.github.com/users/williexu/events{/privacy}","received_events_url":"https://api.github.com/users/williexu/received_events","type":"User","site_admin":false},"body":"---\r\nCloses: https://github.com/Azure/azure-cli/issues/5286\r\n-batch commands should not fail upon preconditions set by user\r\n\r\nThis checklist is used to make sure that common guidelines for a pull request are followed.\r\n\r\n### General Guidelines\r\n\r\n- [x] 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","created_at":"2018-02-28T22:05:53Z","updated_at":"2018-03-07T18:38:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0e9492dc7341265f323c3b2cc566e0a6e4656b1","assignee":{"login":"troydai","id":1329240,"avatar_url":"https://avatars2.githubusercontent.com/u/1329240?v=4","gravatar_id":"","url":"https://api.github.com/users/troydai","html_url":"https://github.com/troydai","followers_url":"https://api.github.com/users/troydai/followers","following_url":"https://api.github.com/users/troydai/following{/other_user}","gists_url":"https://api.github.com/users/troydai/gists{/gist_id}","starred_url":"https://api.github.com/users/troydai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troydai/subscriptions","organizations_url":"https://api.github.com/users/troydai/orgs","repos_url":"https://api.github.com/users/troydai/repos","events_url":"https://api.github.com/users/troydai/events{/privacy}","received_events_url":"https://api.github.com/users/troydai/received_events","type":"User","site_admin":false},"assignees":[{"login":"troydai","id":1329240,"avatar_url":"https://avatars2.githubusercontent.com/u/1329240?v=4","gravatar_id":"","url":"https://api.github.com/users/troydai","html_url":"https://github.com/troydai","followers_url":"https://api.github.com/users/troydai/followers","following_url":"https://api.github.com/users/troydai/following{/other_user}","gists_url":"https://api.github.com/users/troydai/gists{/gist_id}","starred_url":"https://api.github.com/users/troydai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troydai/subscriptions","organizations_url":"https://api.github.com/users/troydai/orgs","repos_url":"https://api.github.com/users/troydai/repos","events_url":"https://api.github.com/users/troydai/events{/privacy}","received_events_url":"https://api.github.com/users/troydai/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":418939315,"url":"https://api.github.com/repos/Azure/azure-cli/labels/Storage","name":"Storage","color":"d4c5f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-cli/pulls/5702/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-cli/pulls/5702/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/5702/comments","statuses_url":"https://api.github.com/repos/Azure/azure-cli/statuses/5d5fe1e317cae20429e274a5fcfd217063cbc29c","head":{"label":"williexu:storageprecondition","ref":"storageprecondition","sha":"5d5fe1e317cae20429e274a5fcfd217063cbc29c","user":{"login":"williexu","id":8580552,"avatar_url":"https://avatars2.githubusercontent.com/u/8580552?v=4","gravatar_id":"","url":"https://api.github.com/users/williexu","html_url":"https://github.com/williexu","followers_url":"https://api.github.com/users/williexu/followers","following_url":"https://api.github.com/users/williexu/following{/other_user}","gists_url":"https://api.github.com/users/williexu/gists{/gist_id}","starred_url":"https://api.github.com/users/williexu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williexu/subscriptions","organizations_url":"https://api.github.com/users/williexu/orgs","repos_url":"https://api.github.com/users/williexu/repos","events_url":"https://api.github.com/users/williexu/events{/privacy}","received_events_url":"https://api.github.com/users/williexu/received_events","type":"User","site_admin":false},"repo":{"id":100400046,"name":"azure-cli","full_name":"williexu/azure-cli","owner":{"login":"williexu","id":8580552,"avatar_url":"https://avatars2.githubusercontent.com/u/8580552?v=4","gravatar_id":"","url":"https://api.github.com/users/williexu","html_url":"https://github.com/williexu","followers_url":"https://api.github.com/users/williexu/followers","following_url":"https://api.github.com/users/williexu/following{/other_user}","gists_url":"https://api.github.com/users/williexu/gists{/gist_id}","starred_url":"https://api.github.com/users/williexu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williexu/subscriptions","organizations_url":"https://api.github.com/users/williexu/orgs","repos_url":"https://api.github.com/users/williexu/repos","events_url":"https://api.github.com/users/williexu/events{/privacy}","received_events_url":"https://api.github.com/users/williexu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/williexu/azure-cli","description":"Command-line tools for Azure.","fork":true,"url":"https://api.github.com/repos/williexu/azure-cli","forks_url":"https://api.github.com/repos/williexu/azure-cli/forks","keys_url":"https://api.github.com/repos/williexu/azure-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/williexu/azure-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/williexu/azure-cli/teams","hooks_url":"https://api.github.com/repos/williexu/azure-cli/hooks","issue_events_url":"https://api.github.com/repos/williexu/azure-cli/issues/events{/number}","events_url":"https://api.github.com/repos/williexu/azure-cli/events","assignees_url":"https://api.github.com/repos/williexu/azure-cli/assignees{/user}","branches_url":"https://api.github.com/repos/williexu/azure-cli/branches{/branch}","tags_url":"https://api.github.com/repos/williexu/azure-cli/tags","blobs_url":"https://api.github.com/repos/williexu/azure-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/williexu/azure-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/williexu/azure-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/williexu/azure-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/williexu/azure-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/williexu/azure-cli/languages","stargazers_url":"https://api.github.com/repos/williexu/azure-cli/stargazers","contributors_url":"https://api.github.com/repos/williexu/azure-cli/contributors","subscribers_url":"https://api.github.com/repos/williexu/azure-cli/subscribers","subscription_url":"https://api.github.com/repos/williexu/azure-cli/subscription","commits_url":"https://api.github.com/repos/williexu/azure-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/williexu/azure-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/williexu/azure-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/williexu/azure-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/williexu/azure-cli/contents/{+path}","compare_url":"https://api.github.com/repos/williexu/azure-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/williexu/azure-cli/merges","archive_url":"https://api.github.com/repos/williexu/azure-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/williexu/azure-cli/downloads","issues_url":"https://api.github.com/repos/williexu/azure-cli/issues{/number}","pulls_url":"https://api.github.com/repos/williexu/azure-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/williexu/azure-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/williexu/azure-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/williexu/azure-cli/labels{/name}","releases_url":"https://api.github.com/repos/williexu/azure-cli/releases{/id}","deployments_url":"https://api.github.com/repos/williexu/azure-cli/deployments","created_at":"2017-08-15T17:03:52Z","updated_at":"2017-08-15T17:03:59Z","pushed_at":"2018-03-07T18:07:21Z","git_url":"git://github.com/williexu/azure-cli.git","ssh_url":"git@github.com:williexu/azure-cli.git","clone_url":"https://github.com/williexu/azure-cli.git","svn_url":"https://github.com/williexu/azure-cli","homepage":null,"size":37129,"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,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:dev","ref":"dev","sha":"e4bd776dd259809c71082bb6365931442d484e1f","user":{"login":"Azure","id":6844498,"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,"name":"azure-cli","full_name":"Azure/azure-cli","owner":{"login":"Azure","id":6844498,"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-03-07T06:05:41Z","pushed_at":"2018-03-07T18:25:45Z","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":36871,"stargazers_count":688,"watchers_count":688,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":404,"mirror_url":null,"archived":false,"open_issues_count":708,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":404,"open_issues":708,"watchers":688,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/5702"},"html":{"href":"https://github.com/Azure/azure-cli/pull/5702"},"issue":{"href":"https://api.github.com/repos/Azure/azure-cli/issues/5702"},"comments":{"href":"https://api.github.com/repos/Azure/azure-cli/issues/5702/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/5702/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/5702/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-cli/statuses/5d5fe1e317cae20429e274a5fcfd217063cbc29c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"troydai"}}