busser-testinfra 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/busser/runner_plugin/testinfra.rb +24 -0
- data/lib/busser/testinfra/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1ab16f0f804973cf62b3ca8e6a0a39ab5d05eb6
|
4
|
+
data.tar.gz: 12b5e96aa5a20a351be4694fbd0b0feacef196b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2582219b624bf6f484039de2c375d7a445470840c19cd2ef14cc256836bc71d61a18a57b58b064169ccdf56f73852a73e16609716392a10d30b15740dbc2515a
|
7
|
+
data.tar.gz: c6d83da5f52af01ae0c5d6a7abe3990f6b1cdb664fa5b40a100f9f8a8b348d46467cea08bfec51a07fd54b0b543003c952f4415bf4881271c29dc34bdd2bdff8
|
@@ -22,8 +22,32 @@ class Busser::RunnerPlugin::Testinfra < Busser::RunnerPlugin::Base
|
|
22
22
|
exe = find_executable0 "testinfra", nil
|
23
23
|
if exe.nil?
|
24
24
|
banner("Installing testinfra...")
|
25
|
+
if linux_variant == "Redhat"
|
26
|
+
run("pip install setuptools==20.6.7")
|
27
|
+
end
|
25
28
|
run("pip install testinfra")
|
26
29
|
end
|
27
30
|
end
|
28
31
|
|
32
|
+
# http://stackoverflow.com/questions/25970280/detecting-linux-distribution-platform-in-ruby
|
33
|
+
def linux_variant
|
34
|
+
r = { :distro => nil, :family => nil }
|
35
|
+
|
36
|
+
if File.exist?("/etc/lsb-release")
|
37
|
+
File.open("/etc/lsb-release", "r").read.each_line do |line|
|
38
|
+
r = { :distro => $1 } if line =~ /^DISTRIB_ID=(.*)/
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
if File.exist?("/etc/debian_version")
|
43
|
+
r[:distro] = "Debian" if r[:distro].nil?
|
44
|
+
r[:family] = "Debian" if r[:variant].nil?
|
45
|
+
elsif File.exist?("/etc/redhat-release") || File.exist?("/etc/centos-release")
|
46
|
+
r[:family] = "RedHat" if r[:family].nil?
|
47
|
+
r[:distro] = "CentOS" if File.exist?("/etc/centos-release")
|
48
|
+
elsif File.exist?("/etc/SuSE-release")
|
49
|
+
r[:distro] = "SLES" if r[:distro].nil?
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
29
53
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: busser-testinfra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Tang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: busser
|
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
version: '0'
|
165
165
|
requirements: []
|
166
166
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.4.
|
167
|
+
rubygems_version: 2.4.5.1
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: A Busser runner plugin for testing testinfra
|
@@ -173,4 +173,3 @@ test_files:
|
|
173
173
|
- features/plugin_list_command.feature
|
174
174
|
- features/support/env.rb
|
175
175
|
- features/test_command.feature
|
176
|
-
has_rdoc:
|