-
-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #715 from bastelfreak/wip
Rebase of #683 / mock systemd fact properly
- Loading branch information
Showing
13 changed files
with
162 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
require 'rspec-puppet-facts' | ||
include RspecPuppetFacts | ||
# # Original fact sources: | ||
add_custom_fact :puppetversion, Puppet.version # Facter, but excluded from rspec-puppet-facts | ||
add_custom_fact :rabbitmq_version, '3.6.1' # puppet-rabbitmq | ||
add_custom_fact :erl_ssl_path, '/usr/lib64/erlang/lib/ssl-7.3.3.1/ebin' # puppet-rabbitmq | ||
|
||
def os_specific_facts(facts) | ||
case facts[:os]['family'] | ||
when 'Archlinux' | ||
{ service_provider: 'systemd', systemd: true } | ||
when 'Debian' | ||
case facts[:os]['release']['major'] | ||
when '7' | ||
{ service_provider: 'sysv', systemd: false } | ||
when '14.04' | ||
{ service_provider: 'upstart', systemd: false } | ||
else | ||
{ service_provider: 'systemd', systemd: true } | ||
end | ||
when 'RedHat' | ||
case facts[:os]['release']['major'] | ||
when '6' | ||
{ service_provider: 'sysv', systemd: false } | ||
else | ||
{ service_provider: 'systemd', systemd: true } | ||
end | ||
else | ||
{ service_provider: 'systemd', systemd: true } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.