specinfra 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/specinfra/backend/exec.rb +6 -0
- data/lib/specinfra/command.rb +1 -0
- data/lib/specinfra/command/suse.rb +27 -0
- data/lib/specinfra/helper/os.rb +1 -0
- data/lib/specinfra/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7305e313da41e92515a147b79088c2fd10c5ec8
|
4
|
+
data.tar.gz: 73d74b156b1ffbc104058c3460a950981a8271f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3154a2b02e09a6e0a202db602ae883835a46408f5b8dbc45bb4fa75829376c7bb29385762ed19b2dd4914a20bd20b221bb13ba4d60b58bf87957ca0320e74be8
|
7
|
+
data.tar.gz: 06efb9ba8734e8bc077f359cdcbf0a2d42f801b933be28228fac8997b77d683297b3761a7447d51469d498c02aa1de4bb84a78d413ad02ad10992d77e2c022cc
|
@@ -189,6 +189,12 @@ module SpecInfra
|
|
189
189
|
{ :family => 'RedHat', :release => release }
|
190
190
|
elsif run_command('ls /etc/system-release').success?
|
191
191
|
{ :family => 'RedHat', :release => nil } # Amazon Linux
|
192
|
+
elsif run_command('ls /etc/SuSE-release').success?
|
193
|
+
line = run_command('cat /etc/SuSE-release').stdout
|
194
|
+
if line =~ /SUSE Linux Enterprise Server (\d+)/
|
195
|
+
release = $1
|
196
|
+
end
|
197
|
+
{ :family => 'SuSE', :release => release }
|
192
198
|
elsif run_command('ls /etc/debian_version').success?
|
193
199
|
lsb_release = run_command("lsb_release -i")
|
194
200
|
if lsb_release.success?
|
data/lib/specinfra/command.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
module SpecInfra
|
2
|
+
module Command
|
3
|
+
class SuSE < Linux
|
4
|
+
def check_enabled(service, level=3)
|
5
|
+
"chkconfig --list #{escape(service)} | grep #{level}:on"
|
6
|
+
end
|
7
|
+
|
8
|
+
def check_installed(package,version=nil)
|
9
|
+
cmd = "rpm -q #{escape(package)}"
|
10
|
+
if version
|
11
|
+
cmd = "#{cmd} | grep -w -- #{escape(version)}"
|
12
|
+
end
|
13
|
+
cmd
|
14
|
+
end
|
15
|
+
|
16
|
+
alias :check_installed_by_rpm :check_installed
|
17
|
+
|
18
|
+
def install(package)
|
19
|
+
cmd = "zypper -n install #{package}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def get_package_version(package, opts=nil)
|
23
|
+
"rpm -qi #{package} | grep Version | awk '{print $3}'"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/specinfra/helper/os.rb
CHANGED
data/lib/specinfra/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specinfra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- lib/specinfra/command/solaris.rb
|
118
118
|
- lib/specinfra/command/solaris10.rb
|
119
119
|
- lib/specinfra/command/solaris11.rb
|
120
|
+
- lib/specinfra/command/suse.rb
|
120
121
|
- lib/specinfra/command/ubuntu.rb
|
121
122
|
- lib/specinfra/command/windows.rb
|
122
123
|
- lib/specinfra/command_result.rb
|