Skip to content

Commit

Permalink
Obsolete CentOS5
Browse files Browse the repository at this point in the history
  • Loading branch information
kotakanbe authored and Alan Lapthorn committed May 11, 2017
1 parent cca6ac1 commit df40835
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ web/app server in the same configuration under the load balancer
| Ubuntu | 12, 14, 16|
| Debian | 7, 8|
| RHEL | 5, 6, 7|
| CentOS | 5, 6, 7|
| CentOS | 6, 7|
| Amazon Linux| All|
| FreeBSD | 10, 11|
| Raspbian | Wheezy, Jessie |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ If there is a staging environment with the same configuration as the production
| Ubuntu | 12, 14, 16|
| Debian | 7, 8|
| RHEL | 5, 6, 7|
| CentOS | 5, 6, 7|
| CentOS | 6, 7|
| Amazon Linux| All|
| FreeBSD | 10, 11|
| Raspbian | Wheezy, Jessie |
Expand Down
20 changes: 16 additions & 4 deletions scan/redhat.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ func (o *redhat) checkIfSudoNoPasswd() error {
return nil
}

// CentOS 5 ... yum-changelog
// CentOS 6, 7 ... yum-plugin-changelog
// RHEL 5 ... yum-security
// RHEL 6, 7 ... -
Expand All @@ -169,12 +168,25 @@ func (o *redhat) checkDependencies() error {
return fmt.Errorf(msg)
}

if o.Distro.Family == "centos" {
if majorVersion < 6 {
msg := fmt.Sprintf("CentOS %s is not supported", o.Distro.Release)
o.log.Errorf(msg)
return fmt.Errorf(msg)
}

// --assumeno option of yum is needed.
cmd := "yum -h | grep assumeno"
if r := o.exec(cmd, noSudo); !r.isSuccess() {
msg := fmt.Sprintf("Installed yum is old. Please update yum and then retry")
o.log.Errorf(msg)
return fmt.Errorf(msg)
}
}

switch o.Distro.Family {
case "centos":
packName = "yum-plugin-changelog"
if majorVersion < 6 {
packName = "yum-changelog"
}
case "rhel":
if majorVersion < 6 {
packName = "yum-security"
Expand Down

0 comments on commit df40835

Please sign in to comment.