{"action":"created","comment":{"url":"https://api.github.com/repos/SUSE/machinery/pulls/comments/23308522","id":23308522,"diff_hunk":"@@ -232,4 +226,121 @@\n       expect(names).to eq(names.sort)\n     end\n   end\n+\n+  describe \"yum repositories\" do\n+    let(:yum_conf) {<<-EOF\n+[main]\n+cachedir=/var/cache/yum/$basearch/$releasever\n+keepcache=0\n+debuglevel=2\n+logfile=/var/log/yum.log\n+exactarch=1\n+obsoletes=1\n+gpgcheck=1\n+plugins=1\n+installonly_limit=3\n+\n+[rhel-source]\n+name=Red Hat Enterprise Linux $releasever - $basearch - Source\n+baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/\n+enabled=0\n+gpgcheck=1\n+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release\n+EOF\n+    }\n+\n+    let(:find_yum_repos_output) {\n+\"/etc/yum.repos.d/download.opensuse.org_repositories_Virtualization_Appliances_RedHat_RHEL-6_.repo\\n\n+/etc/yum.repos.d/rhel-source.repo\"\n+    }\n+\n+    let(:yum_repo1) {<<-EOF\n+\n+[download.opensuse.org_repositories_Virtualization_Appliances_RedHat_RHEL-6_]\n+name=added from: http://download.opensuse.org/repositories/Virtualization:/Appliances/RedHat_RHEL-6/\n+baseurl=http://download.opensuse.org/repositories/Virtualization:/Appliances/RedHat_RHEL-6/\n+enabled=1\n+\n+EOF\n+    }\n+\n+    let(:yum_repo2) {<<-EOF\n+\n+[rhel-source-beta]\n+name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source\n+baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/\n+enabled=0\n+gpgcheck=0\n+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release\n+\n+EOF\n+    }\n+\n+    let(:expected_yum_repo_list) {\n+      RepositoriesScope.new([\n+        Repository.new(\n+          alias: \"download.opensuse.org_repositories_Virtualization_Appliances_RedHat_RHEL-6_\",\n+          name: \"added from: http://download.opensuse.org/repositories/Virtualization:/Appliances/RedHat_RHEL-6/\",\n+          type: \"rpm-md\",\n+          enabled: true,\n+          gpgcheck: true,\n+          url: \"http://download.opensuse.org/repositories/Virtualization:/Appliances/RedHat_RHEL-6/\"\n+        ),\n+        Repository.new(\n+          alias: \"rhel-source\",\n+          name: \"Red Hat Enterprise Linux $releasever - $basearch - Source\",\n+          type: \"rpm-md\",\n+          enabled: false,\n+          gpgcheck: true,\n+          url: \"ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/\"\n+        ),\n+        Repository.new(\n+          alias: \"rhel-source-beta\",\n+          name: \"Red Hat Enterprise Linux $releasever Beta - $basearch - Source\",\n+          type: \"rpm-md\",\n+          enabled: false,\n+          gpgcheck: false,\n+          url: \"ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/\"\n+        )\n+      ])\n+    }\n+\n+    before(:each) do\n+      allow(system).to receive(:has_command?).with(\"zypper\").and_return(false)\n+      allow(system).to receive(:has_command?).with(\"yum\").and_return(true)\n+\n+      allow(system).to receive(:read_file).with(\"/etc/yum.conf\").and_return(yum_conf)\n+      allow(system).to receive(:run_command).with(\n+        \"find\", \"/etc/yum.repos.d/\", \"-type\", \"f\", :stdout => :capture\n+      ).and_return(find_yum_repos_output)\n+      allow(system).to receive(:read_file).with(\n+        \"/etc/yum.repos.d/download.opensuse.org_repositories_Virtualization_Appliances\" \\\n+          \"_RedHat_RHEL-6_.repo\"\n+      ).and_return(yum_repo1)\n+      allow(system).to receive(:read_file).with(\n+        \"/etc/yum.repos.d/rhel-source.repo\"\n+      ).and_return(yum_repo2)\n+    end\n+\n+    it \"inspects repos\" do\n+      inspector = RepositoriesInspector.new\n+      summary = inspector.inspect(system, description)\n+      expect(description.repositories).to match_array(expected_yum_repo_list)\n+      expect(summary).to include(\"Found 3 repositories\")\n+    end\n+\n+    it \"shows a warning if the repo file is unparsable\" do\n+      allow(system).to receive(:read_file).with(\n+        \"/etc/yum.repos.d/download.opensuse.org_repositories_Virtualization_Appliances\" \\\n+          \"_RedHat_RHEL-6_.repo\"\n+      ).and_return(\"broken file content\")\n+\n+      inspector = RepositoriesInspector.new\n+      expect(Machinery::Ui).to receive(:warn).with(\n+        \" -> The repository file '/etc/yum.repos.d/download.opensuse.org_repositories_Virtualization_Appliances_RedHat_RHEL-6_.repo' couldn't be parsed.\"","path":"spec/unit/repositories_inspector_spec.rb","position":187,"original_position":187,"commit_id":"d2af429a75069a4c4c2e4d9e1f701a9a45cb6a45","original_commit_id":"d2af429a75069a4c4c2e4d9e1f701a9a45cb6a45","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":"Line is too long. [153/100]","created_at":"2015-01-21T15:51:12Z","updated_at":"2015-01-21T15:51:12Z","html_url":"https://github.com/SUSE/machinery/pull/538#discussion_r23308522","pull_request_url":"https://api.github.com/repos/SUSE/machinery/pulls/538","_links":{"self":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/comments/23308522"},"html":{"href":"https://github.com/SUSE/machinery/pull/538#discussion_r23308522"},"pull_request":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/538"}}},"pull_request":{"url":"https://api.github.com/repos/SUSE/machinery/pulls/538","id":27769841,"html_url":"https://github.com/SUSE/machinery/pull/538","diff_url":"https://github.com/SUSE/machinery/pull/538.diff","patch_url":"https://github.com/SUSE/machinery/pull/538.patch","issue_url":"https://api.github.com/repos/SUSE/machinery/issues/538","number":538,"state":"open","locked":false,"title":"Add redhat repository support","user":{"login":"thardeck","id":2063848,"avatar_url":"https://avatars.githubusercontent.com/u/2063848?v=3","gravatar_id":"","url":"https://api.github.com/users/thardeck","html_url":"https://github.com/thardeck","followers_url":"https://api.github.com/users/thardeck/followers","following_url":"https://api.github.com/users/thardeck/following{/other_user}","gists_url":"https://api.github.com/users/thardeck/gists{/gist_id}","starred_url":"https://api.github.com/users/thardeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thardeck/subscriptions","organizations_url":"https://api.github.com/users/thardeck/orgs","repos_url":"https://api.github.com/users/thardeck/repos","events_url":"https://api.github.com/users/thardeck/events{/privacy}","received_events_url":"https://api.github.com/users/thardeck/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-21T15:51:04Z","updated_at":"2015-01-21T15:51:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76afff281035a6c186a732467e7cf3a61c74e28a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SUSE/machinery/pulls/538/commits","review_comments_url":"https://api.github.com/repos/SUSE/machinery/pulls/538/comments","review_comment_url":"https://api.github.com/repos/SUSE/machinery/pulls/comments/{number}","comments_url":"https://api.github.com/repos/SUSE/machinery/issues/538/comments","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/d2af429a75069a4c4c2e4d9e1f701a9a45cb6a45","head":{"label":"SUSE:add_redhat_repository_support","ref":"add_redhat_repository_support","sha":"d2af429a75069a4c4c2e4d9e1f701a9a45cb6a45","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":"2015-01-20T13:28:10Z","pushed_at":"2015-01-21T15:49:54Z","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":11614,"stargazers_count":38,"watchers_count":38,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":26,"forks":6,"open_issues":26,"watchers":38,"default_branch":"master"}},"base":{"label":"SUSE:master","ref":"master","sha":"eb41dec50a46ac11a329f11cbd24960f9ca6b0f2","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":"2015-01-20T13:28:10Z","pushed_at":"2015-01-21T15:49:54Z","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":11614,"stargazers_count":38,"watchers_count":38,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":26,"forks":6,"open_issues":26,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/538"},"html":{"href":"https://github.com/SUSE/machinery/pull/538"},"issue":{"href":"https://api.github.com/repos/SUSE/machinery/issues/538"},"comments":{"href":"https://api.github.com/repos/SUSE/machinery/issues/538/comments"},"review_comments":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/538/comments"},"review_comment":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/538/commits"},"statuses":{"href":"https://api.github.com/repos/SUSE/machinery/statuses/d2af429a75069a4c4c2e4d9e1f701a9a45cb6a45"}}}}