Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added oracle linux to rhel platform section of 'service' resource. #1511

Merged
merged 1 commit into from Mar 2, 2017
Merged

Added oracle linux to rhel platform section of 'service' resource. #1511

merged 1 commit into from Mar 2, 2017

Conversation

carldjohnston
Copy link
Contributor

Tests currently skipping over 'service' resource on oracle linux.

Broken when chef/train was fixed to detect oracle linux correctly.

@@ -134,9 +134,9 @@ def select_service_mgmt # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticCom
else
SysV.new(inspec, service_ctl || '/usr/sbin/service')
end
elsif %w{redhat fedora centos}.include?(platform)
elsif %w{redhat fedora centos oracle}.include?(platform)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we spit this and support more redhat systems?

elsif os.redhat?
  if os[:release].to_i >= 7
    Systemd.new(inspec, service_ctl)
  else
    SysV.new(inspec, service_ctl || '/sbin/service')
  end
elsif %w{fedora}.include?(platform)
  if os[:release].to_i >= 15
    Systemd.new(inspec, service_ctl)
  else
    SysV.new(inspec, service_ctl || '/sbin/service')
  end

to support https://github.com/chef/train/blob/master/lib/train/extras/os_detect_linux.rb#L17

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor of @chris-rock's suggestion as well.

@chris-rock
Copy link
Contributor

@carldjohnston Anything we can help you with to get the support for oracle linux in?

@carldjohnston
Copy link
Contributor Author

Hi @chris-rock, thanks for the prod - just finding time to progress these :)

I like you're suggestions, new commit shows this new approach.

Copy link
Contributor

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @carldjohnston

Copy link
Contributor

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot wrlinux. @carldjohnston Can you please update once again. I apologize for the extra work. I like the split between fedora and redhat though.

elsif %w{redhat fedora centos}.include?(platform)
version = os[:release].to_i
if (%w{ redhat centos }.include?(platform) && version >= 7) || (platform == 'fedora' && version >= 15)
elsif os.redhat?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to go with %w{redhat fedora centos oracle}.include?(platform)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chris-rock, I've reverted to the previous commit - messy but it works :)

@zetan503
Copy link

zetan503 commented Mar 2, 2017

I have this problem, all Oracle Linux systems, and inspec service is not supported. When will this be generally available, or is there a workaround?

@chris-rock
Copy link
Contributor

@carldjohnston Can you do me a favor? We do not need the revert in our history. We need to rebase your branch on latest master and remove the 2 of the 3 commits. You can fix that with the following commands:

➜  inspec git:(oracle-linux-service-resource) ✗ git checkout master
Switched to branch 'master'
➜  inspec git:(master) git remote add inspec https://github.com/chef/inspec.git
➜  inspec git:(master) ✗ git pull inspec master
From https://github.com/chef/inspec
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> inspec/master
Already up-to-date.
➜  inspec git:(master) ✗ git checkout oracle-linux-service-resource
Switched to branch 'oracle-linux-service-resource'
Your branch is up-to-date with 'carldjohnston/oracle-linux-service-resource'.
➜  inspec git:(oracle-linux-service-resource) ✗ git rebase master
First, rewinding head to replay your work on top of it...
Applying: Added oracle linux to rhel platform section.
Applying: Split rhel / fedora to support more redhat systems (via chef/train)
Applying: Revert "Split rhel / fedora to support more redhat systems (via chef/train)"
➜  inspec git:(oracle-linux-service-resource) ✗ git reset HEAD~2
➜  inspec git:(oracle-linux-service-resource) ✗ git push origin oracle-linux-service-resource -f

Please ensure that the git history is alright before you force push to github.

Broken when chef/train was fixed to detect oracle linux correctly.

Signed-off-by: Carl Johnston <carldjohnston@gmail.com>
@carldjohnston
Copy link
Contributor Author

Hi @chris-rock, thanks for the instruction, very cool - you learn something new every day!

I've rebased and pushed up the cleaned up repo.

@chris-rock
Copy link
Contributor

cc @adamleff

@adamleff
Copy link
Contributor

adamleff commented Mar 2, 2017

Nice work, @carldjohnston! Thanks for working with us on this contribution.

@adamleff adamleff merged commit 6bd66df into inspec:master Mar 2, 2017
@carldjohnston carldjohnston deleted the oracle-linux-service-resource branch March 14, 2017 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants