{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments/38728236","id":38728236,"diff_hunk":"@@ -142,12 +142,18 @@ def random_password(size = 12)\n #\n # Locking Routines\n #\n+  def new_lock(name)\n+    Crowbar::Lock::LocalBlocking.new(name: name, logger: @logger)\n+  end\n+\n   def acquire_lock(name)\n-    FileLock.acquire(name, logger: @logger)\n+    new_lock(name).acquire\n   end\n \n-  def release_lock(f)\n-    FileLock.release(f, logger: @logger)\n+  def with_lock(name)\n+    new_lock(name).with_lock do\n+      yield\n+    end\n   end","path":"crowbar_framework/app/models/service_object.rb","position":19,"original_position":19,"commit_id":"ec6992b6bbc4eb8bf461922d285f458d500a0d80","original_commit_id":"ec6992b6bbc4eb8bf461922d285f458d500a0d80","user":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"body":"We have these methods here and in deployment_queue.rb. Should they somehow be shared?","created_at":"2015-09-04T07:43:51Z","updated_at":"2015-09-04T07:43:51Z","html_url":"https://github.com/crowbar/crowbar-core/pull/14#discussion_r38728236","pull_request_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments/38728236"},"html":{"href":"https://github.com/crowbar/crowbar-core/pull/14#discussion_r38728236"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/14","id":43563047,"html_url":"https://github.com/crowbar/crowbar-core/pull/14","diff_url":"https://github.com/crowbar/crowbar-core/pull/14.diff","patch_url":"https://github.com/crowbar/crowbar-core/pull/14.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/14","number":14,"state":"open","locked":false,"title":"enhance locking and pause chef-client daemon when applying proposals","user":{"login":"aspiers","id":100738,"avatar_url":"https://avatars.githubusercontent.com/u/100738?v=3","gravatar_id":"","url":"https://api.github.com/users/aspiers","html_url":"https://github.com/aspiers","followers_url":"https://api.github.com/users/aspiers/followers","following_url":"https://api.github.com/users/aspiers/following{/other_user}","gists_url":"https://api.github.com/users/aspiers/gists{/gist_id}","starred_url":"https://api.github.com/users/aspiers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspiers/subscriptions","organizations_url":"https://api.github.com/users/aspiers/orgs","repos_url":"https://api.github.com/users/aspiers/repos","events_url":"https://api.github.com/users/aspiers/events{/privacy}","received_events_url":"https://api.github.com/users/aspiers/received_events","type":"User","site_admin":false},"body":"Reworking of #5 to address concurrency issues, make the interface between the two locking subclasses consistent, and DRY up the calling code.","created_at":"2015-08-27T20:30:03Z","updated_at":"2015-09-04T07:43:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe3418fe9755196e37661a5c13d60a3e435d53b7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/14/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/14/comments","review_comment_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/14/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar-core/statuses/ec6992b6bbc4eb8bf461922d285f458d500a0d80","head":{"label":"aspiers:feature/apply-lock","ref":"feature/apply-lock","sha":"ec6992b6bbc4eb8bf461922d285f458d500a0d80","user":{"login":"aspiers","id":100738,"avatar_url":"https://avatars.githubusercontent.com/u/100738?v=3","gravatar_id":"","url":"https://api.github.com/users/aspiers","html_url":"https://github.com/aspiers","followers_url":"https://api.github.com/users/aspiers/followers","following_url":"https://api.github.com/users/aspiers/following{/other_user}","gists_url":"https://api.github.com/users/aspiers/gists{/gist_id}","starred_url":"https://api.github.com/users/aspiers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspiers/subscriptions","organizations_url":"https://api.github.com/users/aspiers/orgs","repos_url":"https://api.github.com/users/aspiers/repos","events_url":"https://api.github.com/users/aspiers/events{/privacy}","received_events_url":"https://api.github.com/users/aspiers/received_events","type":"User","site_admin":false},"repo":{"id":41430233,"name":"crowbar-core","full_name":"aspiers/crowbar-core","owner":{"login":"aspiers","id":100738,"avatar_url":"https://avatars.githubusercontent.com/u/100738?v=3","gravatar_id":"","url":"https://api.github.com/users/aspiers","html_url":"https://github.com/aspiers","followers_url":"https://api.github.com/users/aspiers/followers","following_url":"https://api.github.com/users/aspiers/following{/other_user}","gists_url":"https://api.github.com/users/aspiers/gists{/gist_id}","starred_url":"https://api.github.com/users/aspiers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspiers/subscriptions","organizations_url":"https://api.github.com/users/aspiers/orgs","repos_url":"https://api.github.com/users/aspiers/repos","events_url":"https://api.github.com/users/aspiers/events{/privacy}","received_events_url":"https://api.github.com/users/aspiers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aspiers/crowbar-core","description":"Core deployment for Crowbar","fork":true,"url":"https://api.github.com/repos/aspiers/crowbar-core","forks_url":"https://api.github.com/repos/aspiers/crowbar-core/forks","keys_url":"https://api.github.com/repos/aspiers/crowbar-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspiers/crowbar-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspiers/crowbar-core/teams","hooks_url":"https://api.github.com/repos/aspiers/crowbar-core/hooks","issue_events_url":"https://api.github.com/repos/aspiers/crowbar-core/issues/events{/number}","events_url":"https://api.github.com/repos/aspiers/crowbar-core/events","assignees_url":"https://api.github.com/repos/aspiers/crowbar-core/assignees{/user}","branches_url":"https://api.github.com/repos/aspiers/crowbar-core/branches{/branch}","tags_url":"https://api.github.com/repos/aspiers/crowbar-core/tags","blobs_url":"https://api.github.com/repos/aspiers/crowbar-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspiers/crowbar-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspiers/crowbar-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspiers/crowbar-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspiers/crowbar-core/statuses/{sha}","languages_url":"https://api.github.com/repos/aspiers/crowbar-core/languages","stargazers_url":"https://api.github.com/repos/aspiers/crowbar-core/stargazers","contributors_url":"https://api.github.com/repos/aspiers/crowbar-core/contributors","subscribers_url":"https://api.github.com/repos/aspiers/crowbar-core/subscribers","subscription_url":"https://api.github.com/repos/aspiers/crowbar-core/subscription","commits_url":"https://api.github.com/repos/aspiers/crowbar-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspiers/crowbar-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspiers/crowbar-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspiers/crowbar-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspiers/crowbar-core/contents/{+path}","compare_url":"https://api.github.com/repos/aspiers/crowbar-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspiers/crowbar-core/merges","archive_url":"https://api.github.com/repos/aspiers/crowbar-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspiers/crowbar-core/downloads","issues_url":"https://api.github.com/repos/aspiers/crowbar-core/issues{/number}","pulls_url":"https://api.github.com/repos/aspiers/crowbar-core/pulls{/number}","milestones_url":"https://api.github.com/repos/aspiers/crowbar-core/milestones{/number}","notifications_url":"https://api.github.com/repos/aspiers/crowbar-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspiers/crowbar-core/labels{/name}","releases_url":"https://api.github.com/repos/aspiers/crowbar-core/releases{/id}","created_at":"2015-08-26T14:25:22Z","updated_at":"2015-08-26T14:25:24Z","pushed_at":"2015-09-03T17:31:54Z","git_url":"git://github.com/aspiers/crowbar-core.git","ssh_url":"git@github.com:aspiers/crowbar-core.git","clone_url":"https://github.com/aspiers/crowbar-core.git","svn_url":"https://github.com/aspiers/crowbar-core","homepage":null,"size":102687,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"crowbar:master","ref":"master","sha":"f0575c214eeb5259802ed6d814e3e5fd75791504","user":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"repo":{"id":39003227,"name":"crowbar-core","full_name":"crowbar/crowbar-core","owner":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crowbar/crowbar-core","description":"Core deployment for Crowbar","fork":false,"url":"https://api.github.com/repos/crowbar/crowbar-core","forks_url":"https://api.github.com/repos/crowbar/crowbar-core/forks","keys_url":"https://api.github.com/repos/crowbar/crowbar-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowbar/crowbar-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowbar/crowbar-core/teams","hooks_url":"https://api.github.com/repos/crowbar/crowbar-core/hooks","issue_events_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/events{/number}","events_url":"https://api.github.com/repos/crowbar/crowbar-core/events","assignees_url":"https://api.github.com/repos/crowbar/crowbar-core/assignees{/user}","branches_url":"https://api.github.com/repos/crowbar/crowbar-core/branches{/branch}","tags_url":"https://api.github.com/repos/crowbar/crowbar-core/tags","blobs_url":"https://api.github.com/repos/crowbar/crowbar-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowbar/crowbar-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowbar/crowbar-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowbar/crowbar-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowbar/crowbar-core/statuses/{sha}","languages_url":"https://api.github.com/repos/crowbar/crowbar-core/languages","stargazers_url":"https://api.github.com/repos/crowbar/crowbar-core/stargazers","contributors_url":"https://api.github.com/repos/crowbar/crowbar-core/contributors","subscribers_url":"https://api.github.com/repos/crowbar/crowbar-core/subscribers","subscription_url":"https://api.github.com/repos/crowbar/crowbar-core/subscription","commits_url":"https://api.github.com/repos/crowbar/crowbar-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowbar/crowbar-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowbar/crowbar-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowbar/crowbar-core/contents/{+path}","compare_url":"https://api.github.com/repos/crowbar/crowbar-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowbar/crowbar-core/merges","archive_url":"https://api.github.com/repos/crowbar/crowbar-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowbar/crowbar-core/downloads","issues_url":"https://api.github.com/repos/crowbar/crowbar-core/issues{/number}","pulls_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls{/number}","milestones_url":"https://api.github.com/repos/crowbar/crowbar-core/milestones{/number}","notifications_url":"https://api.github.com/repos/crowbar/crowbar-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowbar/crowbar-core/labels{/name}","releases_url":"https://api.github.com/repos/crowbar/crowbar-core/releases{/id}","created_at":"2015-07-13T09:31:28Z","updated_at":"2015-08-20T13:43:47Z","pushed_at":"2015-09-04T07:42:30Z","git_url":"git://github.com/crowbar/crowbar-core.git","ssh_url":"git@github.com:crowbar/crowbar-core.git","clone_url":"https://github.com/crowbar/crowbar-core.git","svn_url":"https://github.com/crowbar/crowbar-core","homepage":null,"size":117914,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":10,"forks":14,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/14"},"html":{"href":"https://github.com/crowbar/crowbar-core/pull/14"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar-core/issues/14"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar-core/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar-core/statuses/ec6992b6bbc4eb8bf461922d285f458d500a0d80"}}}}