{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/26688872","id":26688872,"diff_hunk":"@@ -28,12 +28,33 @@ def disable\n \n   def enabled?\n     begin\n-      systemctl(\"is-enabled\", @resource[:name])\n+      systemctl_info = systemctl(\n+         'show',\n+         @resource[:name],\n+         '--property', 'LoadState',\n+         '--property', 'UnitFileState',\n+         '--no-pager'\n+      )\n+\n+      svc_info = Hash.new\n+      systemctl_info.split.map{|svc|\n+        entry_pair = svc.split('=')\n+        svc_info[entry_pair.first.to_sym] = entry_pair.last\n+      }\n+\n+      # The masked state is equivalent to the disabled state in terms of\n+      # comparison so we only care to check if it is masked if we want to keep\n+      # it masked.\n+      #\n+      # We only return :mask if we're trying to mask the service. This prevents\n+      # flapping when simply trying to disable a masked service.\n+      return :mask if (@resource[:enable] == :mask) && (svc_info[:LoadState] == 'masked')\n+      return :true if svc_info[:UnitFileState] == 'enabled'\n     rescue Puppet::ExecutionFailure\n-      return :false\n+      # Don't worry about this failing, just return :false if it does.","path":"lib/puppet/provider/service/systemd.rb","position":44,"original_position":44,"commit_id":"b56494e00d23caa48c18b8492646a2e687c4b4c5","original_commit_id":"b56494e00d23caa48c18b8492646a2e687c4b4c5","user":{"login":"adrienthebo","id":172194,"avatar_url":"https://avatars.githubusercontent.com/u/172194?v=3","gravatar_id":"","url":"https://api.github.com/users/adrienthebo","html_url":"https://github.com/adrienthebo","followers_url":"https://api.github.com/users/adrienthebo/followers","following_url":"https://api.github.com/users/adrienthebo/following{/other_user}","gists_url":"https://api.github.com/users/adrienthebo/gists{/gist_id}","starred_url":"https://api.github.com/users/adrienthebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrienthebo/subscriptions","organizations_url":"https://api.github.com/users/adrienthebo/orgs","repos_url":"https://api.github.com/users/adrienthebo/repos","events_url":"https://api.github.com/users/adrienthebo/events{/privacy}","received_events_url":"https://api.github.com/users/adrienthebo/received_events","type":"User","site_admin":false},"body":"What does a failure indicate in this case?","created_at":"2015-03-18T17:53:33Z","updated_at":"2015-03-18T17:53:33Z","html_url":"https://github.com/puppetlabs/puppet/pull/3684#discussion_r26688872","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/3684","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/26688872"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/3684#discussion_r26688872"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/3684"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/3684","id":30507710,"html_url":"https://github.com/puppetlabs/puppet/pull/3684","diff_url":"https://github.com/puppetlabs/puppet/pull/3684.diff","patch_url":"https://github.com/puppetlabs/puppet/pull/3684.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppet/issues/3684","number":3684,"state":"open","locked":false,"title":"PUP-1253 Add systemd service masking support","user":{"login":"peiriannydd","id":4982601,"avatar_url":"https://avatars.githubusercontent.com/u/4982601?v=3","gravatar_id":"","url":"https://api.github.com/users/peiriannydd","html_url":"https://github.com/peiriannydd","followers_url":"https://api.github.com/users/peiriannydd/followers","following_url":"https://api.github.com/users/peiriannydd/following{/other_user}","gists_url":"https://api.github.com/users/peiriannydd/gists{/gist_id}","starred_url":"https://api.github.com/users/peiriannydd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peiriannydd/subscriptions","organizations_url":"https://api.github.com/users/peiriannydd/orgs","repos_url":"https://api.github.com/users/peiriannydd/repos","events_url":"https://api.github.com/users/peiriannydd/events{/privacy}","received_events_url":"https://api.github.com/users/peiriannydd/received_events","type":"User","site_admin":false},"body":"This updates the systemd service type to add support for masking. If a\r\nservice is masked, it is deemed to also be disabled. If a service is\r\nmasked and changed to enabled, it will first be unmasked since the\r\nstandard 'systemctl enable' command does not properly unmask the command\r\nfirst.","created_at":"2015-03-04T21:46:35Z","updated_at":"2015-03-18T17:53:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4446baedb2d2cd8d6957d448c7542b1f13ac7a33","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/3684/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/3684/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/puppet/issues/3684/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppet/statuses/b56494e00d23caa48c18b8492646a2e687c4b4c5","head":{"label":"onyxpoint:PUP-1253","ref":"PUP-1253","sha":"b56494e00d23caa48c18b8492646a2e687c4b4c5","user":{"login":"onyxpoint","id":169265,"avatar_url":"https://avatars.githubusercontent.com/u/169265?v=3","gravatar_id":"","url":"https://api.github.com/users/onyxpoint","html_url":"https://github.com/onyxpoint","followers_url":"https://api.github.com/users/onyxpoint/followers","following_url":"https://api.github.com/users/onyxpoint/following{/other_user}","gists_url":"https://api.github.com/users/onyxpoint/gists{/gist_id}","starred_url":"https://api.github.com/users/onyxpoint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onyxpoint/subscriptions","organizations_url":"https://api.github.com/users/onyxpoint/orgs","repos_url":"https://api.github.com/users/onyxpoint/repos","events_url":"https://api.github.com/users/onyxpoint/events{/privacy}","received_events_url":"https://api.github.com/users/onyxpoint/received_events","type":"Organization","site_admin":false},"repo":{"id":442466,"name":"puppet","full_name":"onyxpoint/puppet","owner":{"login":"onyxpoint","id":169265,"avatar_url":"https://avatars.githubusercontent.com/u/169265?v=3","gravatar_id":"","url":"https://api.github.com/users/onyxpoint","html_url":"https://github.com/onyxpoint","followers_url":"https://api.github.com/users/onyxpoint/followers","following_url":"https://api.github.com/users/onyxpoint/following{/other_user}","gists_url":"https://api.github.com/users/onyxpoint/gists{/gist_id}","starred_url":"https://api.github.com/users/onyxpoint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onyxpoint/subscriptions","organizations_url":"https://api.github.com/users/onyxpoint/orgs","repos_url":"https://api.github.com/users/onyxpoint/repos","events_url":"https://api.github.com/users/onyxpoint/events{/privacy}","received_events_url":"https://api.github.com/users/onyxpoint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/onyxpoint/puppet","description":"Server automation framework and application","fork":true,"url":"https://api.github.com/repos/onyxpoint/puppet","forks_url":"https://api.github.com/repos/onyxpoint/puppet/forks","keys_url":"https://api.github.com/repos/onyxpoint/puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onyxpoint/puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onyxpoint/puppet/teams","hooks_url":"https://api.github.com/repos/onyxpoint/puppet/hooks","issue_events_url":"https://api.github.com/repos/onyxpoint/puppet/issues/events{/number}","events_url":"https://api.github.com/repos/onyxpoint/puppet/events","assignees_url":"https://api.github.com/repos/onyxpoint/puppet/assignees{/user}","branches_url":"https://api.github.com/repos/onyxpoint/puppet/branches{/branch}","tags_url":"https://api.github.com/repos/onyxpoint/puppet/tags","blobs_url":"https://api.github.com/repos/onyxpoint/puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onyxpoint/puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onyxpoint/puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/onyxpoint/puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onyxpoint/puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/onyxpoint/puppet/languages","stargazers_url":"https://api.github.com/repos/onyxpoint/puppet/stargazers","contributors_url":"https://api.github.com/repos/onyxpoint/puppet/contributors","subscribers_url":"https://api.github.com/repos/onyxpoint/puppet/subscribers","subscription_url":"https://api.github.com/repos/onyxpoint/puppet/subscription","commits_url":"https://api.github.com/repos/onyxpoint/puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/onyxpoint/puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/onyxpoint/puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/onyxpoint/puppet/issues/comments{/number}","contents_url":"https://api.github.com/repos/onyxpoint/puppet/contents/{+path}","compare_url":"https://api.github.com/repos/onyxpoint/puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onyxpoint/puppet/merges","archive_url":"https://api.github.com/repos/onyxpoint/puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onyxpoint/puppet/downloads","issues_url":"https://api.github.com/repos/onyxpoint/puppet/issues{/number}","pulls_url":"https://api.github.com/repos/onyxpoint/puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/onyxpoint/puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/onyxpoint/puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onyxpoint/puppet/labels{/name}","releases_url":"https://api.github.com/repos/onyxpoint/puppet/releases{/id}","created_at":"2009-12-19T02:35:51Z","updated_at":"2015-03-12T16:02:06Z","pushed_at":"2015-03-12T16:02:05Z","git_url":"git://github.com/onyxpoint/puppet.git","ssh_url":"git@github.com:onyxpoint/puppet.git","clone_url":"https://github.com/onyxpoint/puppet.git","svn_url":"https://github.com/onyxpoint/puppet","homepage":"http://reductivelabs.com/trac/puppet/","size":45454,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"4dae4b348ab6942d07c178fd160726e2c7895eaa","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":910744,"name":"puppet","full_name":"puppetlabs/puppet","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/puppet","description":"Server automation framework and application","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppet","forks_url":"https://api.github.com/repos/puppetlabs/puppet/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppet/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppet/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppet/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppet/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppet/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppet/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppet/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppet/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppet/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppet/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppet/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppet/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppet/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/puppet/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppet/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppet/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppet/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppet/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppet/releases{/id}","created_at":"2010-09-14T19:26:44Z","updated_at":"2015-03-18T17:42:16Z","pushed_at":"2015-03-18T17:41:07Z","git_url":"git://github.com/puppetlabs/puppet.git","ssh_url":"git@github.com:puppetlabs/puppet.git","clone_url":"https://github.com/puppetlabs/puppet.git","svn_url":"https://github.com/puppetlabs/puppet","homepage":"http://www.puppetlabs.com/puppet/introduction/","size":110265,"stargazers_count":3061,"watchers_count":3061,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1306,"mirror_url":null,"open_issues_count":40,"forks":1306,"open_issues":40,"watchers":3061,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/3684"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/3684"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppet/issues/3684"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppet/issues/3684/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/3684/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/3684/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppet/statuses/b56494e00d23caa48c18b8492646a2e687c4b4c5"}}}}