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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51a3c0f00a9657f11bfe40dc187c243300dbba1c
4
- data.tar.gz: c85505124e254aff234ad702cae1db08698454e0
3
+ metadata.gz: b1ab16f0f804973cf62b3ca8e6a0a39ab5d05eb6
4
+ data.tar.gz: 12b5e96aa5a20a351be4694fbd0b0feacef196b8
5
5
  SHA512:
6
- metadata.gz: d06e2cd3d5a2247970de8c666cc6416b3ac871e0018fc19bc67f7c492d21d68f335cad9e52cf178ed51dcc64da72d57e66f51399f4d1d5d0f854aca697616835
7
- data.tar.gz: ba06f0ecf396662fba479d1b3379478c102d7e9cdcbab9666c0327830a2e90cccf5251e71ea01d25d9baa85ad2154cde36a0bfda6d141d9171f2434881deac72
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
@@ -3,6 +3,6 @@ module Busser
3
3
  module Testinfra
4
4
 
5
5
  # Version string for the Testinfra Busser runner plugin
6
- VERSION = "0.0.2"
6
+ VERSION = "0.0.3"
7
7
  end
8
8
  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.2
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-03-26 00:00:00.000000000 Z
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.8
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: