{"action":"created","comment":{"url":"https://api.github.com/repos/SUSE/machinery/pulls/comments/49836317","id":49836317,"diff_hunk":"@@ -24,29 +24,23 @@ def initialize(system, description)\n   end\n \n   def inspect(_filter, _options = {})\n-    if @description.environment.system_type == \"docker\"\n-      result = ServicesScope.new(\n-        [],\n-        init_system: \"none\"\n-      )\n-    elsif @system.has_command?(\"systemctl\")\n-      result = ServicesScope.new(\n-        inspect_systemd_services,\n-        init_system: \"systemd\"\n-      )\n-    elsif @system.has_command?(\"initctl\")\n-      result = ServicesScope.new(\n-        inspect_ubuntu_services,\n-        init_system: \"upstart\"\n-      )\n-    else\n-      result = ServicesScope.new(\n-        inspect_sysvinit_services,\n-        init_system: \"sysvinit\"\n-      )\n-    end\n-\n-    @description.services = result\n+    services, init_system = case\n+      when @description.environment.system_type == \"docker\"\n+        then [[], \"none\"]\n+      when @system.has_command?(\"systemctl\")\n+        then [inspect_systemd_services, \"systemd\"]\n+      when @system.has_command?(\"initctl\") && @system.has_command?(\"chkconfig\")\n+        then [parse_redhat_chkconfig, \"upstart\"]\n+      when @system.has_command?(\"initctl\") && !@system.has_command?(\"chkconfig\")","path":"plugins/services/services_inspector.rb","position":34,"original_position":34,"commit_id":"d6018a5efa9570443952fd6e184be400ccf79c88","original_commit_id":"d6018a5efa9570443952fd6e184be400ccf79c88","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Indent `when` as deep as `case`.","created_at":"2016-01-15T09:50:24Z","updated_at":"2016-01-15T09:50:24Z","html_url":"https://github.com/SUSE/machinery/pull/1839#discussion_r49836317","pull_request_url":"https://api.github.com/repos/SUSE/machinery/pulls/1839","_links":{"self":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/comments/49836317"},"html":{"href":"https://github.com/SUSE/machinery/pull/1839#discussion_r49836317"},"pull_request":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1839"}}},"pull_request":{"url":"https://api.github.com/repos/SUSE/machinery/pulls/1839","id":56149035,"html_url":"https://github.com/SUSE/machinery/pull/1839","diff_url":"https://github.com/SUSE/machinery/pull/1839.diff","patch_url":"https://github.com/SUSE/machinery/pull/1839.patch","issue_url":"https://api.github.com/repos/SUSE/machinery/issues/1839","number":1839,"state":"open","locked":false,"title":"Fix 1806","user":{"login":"mauromorales","id":433958,"avatar_url":"https://avatars.githubusercontent.com/u/433958?v=3","gravatar_id":"","url":"https://api.github.com/users/mauromorales","html_url":"https://github.com/mauromorales","followers_url":"https://api.github.com/users/mauromorales/followers","following_url":"https://api.github.com/users/mauromorales/following{/other_user}","gists_url":"https://api.github.com/users/mauromorales/gists{/gist_id}","starred_url":"https://api.github.com/users/mauromorales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mauromorales/subscriptions","organizations_url":"https://api.github.com/users/mauromorales/orgs","repos_url":"https://api.github.com/users/mauromorales/repos","events_url":"https://api.github.com/users/mauromorales/events{/privacy}","received_events_url":"https://api.github.com/users/mauromorales/received_events","type":"User","site_admin":false},"body":"fixes #1806","created_at":"2016-01-15T09:50:20Z","updated_at":"2016-01-15T09:50:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0880a3365ec256e07835fde73aba53ab2e8af0f1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SUSE/machinery/pulls/1839/commits","review_comments_url":"https://api.github.com/repos/SUSE/machinery/pulls/1839/comments","review_comment_url":"https://api.github.com/repos/SUSE/machinery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SUSE/machinery/issues/1839/comments","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/d6018a5efa9570443952fd6e184be400ccf79c88","head":{"label":"SUSE:fix_1806","ref":"fix_1806","sha":"d6018a5efa9570443952fd6e184be400ccf79c88","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":21424418,"name":"machinery","full_name":"SUSE/machinery","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/machinery","description":"A systems management toolkit for Linux","fork":false,"url":"https://api.github.com/repos/SUSE/machinery","forks_url":"https://api.github.com/repos/SUSE/machinery/forks","keys_url":"https://api.github.com/repos/SUSE/machinery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/machinery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/machinery/teams","hooks_url":"https://api.github.com/repos/SUSE/machinery/hooks","issue_events_url":"https://api.github.com/repos/SUSE/machinery/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/machinery/events","assignees_url":"https://api.github.com/repos/SUSE/machinery/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/machinery/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/machinery/tags","blobs_url":"https://api.github.com/repos/SUSE/machinery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/machinery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/machinery/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/machinery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/machinery/languages","stargazers_url":"https://api.github.com/repos/SUSE/machinery/stargazers","contributors_url":"https://api.github.com/repos/SUSE/machinery/contributors","subscribers_url":"https://api.github.com/repos/SUSE/machinery/subscribers","subscription_url":"https://api.github.com/repos/SUSE/machinery/subscription","commits_url":"https://api.github.com/repos/SUSE/machinery/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/machinery/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/machinery/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/machinery/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/machinery/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/machinery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/machinery/merges","archive_url":"https://api.github.com/repos/SUSE/machinery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/machinery/downloads","issues_url":"https://api.github.com/repos/SUSE/machinery/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/machinery/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/machinery/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/machinery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/machinery/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/machinery/releases{/id}","created_at":"2014-07-02T13:07:04Z","updated_at":"2016-01-12T10:15:26Z","pushed_at":"2016-01-15T09:50:20Z","git_url":"git://github.com/SUSE/machinery.git","ssh_url":"git@github.com:SUSE/machinery.git","clone_url":"https://github.com/SUSE/machinery.git","svn_url":"https://github.com/SUSE/machinery","homepage":"machinery-project.org","size":61087,"stargazers_count":83,"watchers_count":83,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":14,"mirror_url":null,"open_issues_count":59,"forks":14,"open_issues":59,"watchers":83,"default_branch":"master"}},"base":{"label":"SUSE:ubuntu_inspection","ref":"ubuntu_inspection","sha":"ebfa24e5b0a4334a1b19f8d0f1b85a70ba4dbdd8","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":21424418,"name":"machinery","full_name":"SUSE/machinery","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/machinery","description":"A systems management toolkit for Linux","fork":false,"url":"https://api.github.com/repos/SUSE/machinery","forks_url":"https://api.github.com/repos/SUSE/machinery/forks","keys_url":"https://api.github.com/repos/SUSE/machinery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/machinery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/machinery/teams","hooks_url":"https://api.github.com/repos/SUSE/machinery/hooks","issue_events_url":"https://api.github.com/repos/SUSE/machinery/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/machinery/events","assignees_url":"https://api.github.com/repos/SUSE/machinery/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/machinery/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/machinery/tags","blobs_url":"https://api.github.com/repos/SUSE/machinery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/machinery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/machinery/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/machinery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/machinery/languages","stargazers_url":"https://api.github.com/repos/SUSE/machinery/stargazers","contributors_url":"https://api.github.com/repos/SUSE/machinery/contributors","subscribers_url":"https://api.github.com/repos/SUSE/machinery/subscribers","subscription_url":"https://api.github.com/repos/SUSE/machinery/subscription","commits_url":"https://api.github.com/repos/SUSE/machinery/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/machinery/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/machinery/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/machinery/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/machinery/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/machinery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/machinery/merges","archive_url":"https://api.github.com/repos/SUSE/machinery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/machinery/downloads","issues_url":"https://api.github.com/repos/SUSE/machinery/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/machinery/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/machinery/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/machinery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/machinery/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/machinery/releases{/id}","created_at":"2014-07-02T13:07:04Z","updated_at":"2016-01-12T10:15:26Z","pushed_at":"2016-01-15T09:50:20Z","git_url":"git://github.com/SUSE/machinery.git","ssh_url":"git@github.com:SUSE/machinery.git","clone_url":"https://github.com/SUSE/machinery.git","svn_url":"https://github.com/SUSE/machinery","homepage":"machinery-project.org","size":61087,"stargazers_count":83,"watchers_count":83,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":14,"mirror_url":null,"open_issues_count":59,"forks":14,"open_issues":59,"watchers":83,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1839"},"html":{"href":"https://github.com/SUSE/machinery/pull/1839"},"issue":{"href":"https://api.github.com/repos/SUSE/machinery/issues/1839"},"comments":{"href":"https://api.github.com/repos/SUSE/machinery/issues/1839/comments"},"review_comments":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1839/comments"},"review_comment":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1839/commits"},"statuses":{"href":"https://api.github.com/repos/SUSE/machinery/statuses/d6018a5efa9570443952fd6e184be400ccf79c88"}}}}