specinfra 2.0.0.beta13 → 2.0.0.beta14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/specinfra.rb +1 -1
- data/lib/specinfra/backend/base.rb +2 -2
- data/lib/specinfra/command/processor.rb +8 -8
- data/lib/specinfra/version.rb +1 -1
- data/spec/command/base/file_spec.rb +1 -1
- data/spec/command/redhat/interface_spec.rb +1 -1
- data/spec/command/redhat/package_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26a24975924d84841a016386588bb54c094b94da
|
4
|
+
data.tar.gz: b0e847c24fb0dd945b0f68018ec54372eb6bdfc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5437fca57eea9b86e5a3d885c32bc48e1f8c4fe55a9606421e02b9d55736a9e40542a63b0810f3f4aae646dfae75b778a9f3892d77f1d165848e68d2e3adbd21
|
7
|
+
data.tar.gz: b3b5647f3d39399cc0bf073aa6958e1666f88a79a758e5f0f89142a341dd56e22130d1a8f213b3f1cf4ffa642a218b11720d6c8ac8132bc4da70c51b384d1cfc
|
data/lib/specinfra.rb
CHANGED
@@ -20,7 +20,7 @@ module Specinfra
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def check_zero(cmd, *args)
|
23
|
-
run_command(Specinfra.
|
23
|
+
run_command(Specinfra.command.send(cmd, *args)).success?
|
24
24
|
end
|
25
25
|
|
26
26
|
def method_missing(meth, *args, &block)
|
@@ -28,7 +28,7 @@ module Specinfra
|
|
28
28
|
if meth.to_s =~ /^check/
|
29
29
|
backend.check_zero(meth, *args)
|
30
30
|
else
|
31
|
-
backend.run_command(Specinfra.
|
31
|
+
backend.run_command(Specinfra.command.send(meth, *args))
|
32
32
|
end
|
33
33
|
else
|
34
34
|
Specinfra::Command::Processor.send(meth, *args)
|
@@ -4,12 +4,12 @@ module Specinfra::Command
|
|
4
4
|
if meth.to_s =~ /^check/
|
5
5
|
backend.check_zero(meth, *args)
|
6
6
|
else
|
7
|
-
backend.run_command(Specinfra.
|
7
|
+
backend.run_command(Specinfra.command.send(meth, *args))
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.check_service_is_running(service)
|
12
|
-
ret = backend.run_command(Specinfra.
|
12
|
+
ret = backend.run_command(Specinfra.command.check_service_is_running(service))
|
13
13
|
|
14
14
|
# In Ubuntu, some services are under upstart and "service foo status" returns
|
15
15
|
# exit status 0 even though they are stopped.
|
@@ -18,14 +18,14 @@ module Specinfra::Command
|
|
18
18
|
|
19
19
|
# If the service is not registered, check by ps command
|
20
20
|
if ret.exit_status == 1
|
21
|
-
ret = backend.run_command(Specinfra.
|
21
|
+
ret = backend.run_command(Specinfra.command.check_process_is_running(service))
|
22
22
|
end
|
23
23
|
|
24
24
|
ret.success?
|
25
25
|
end
|
26
26
|
|
27
27
|
def self.check_service_is_monitored_by_monit(process)
|
28
|
-
ret = backend.run_command(Specinfra.
|
28
|
+
ret = backend.run_command(Specinfra.command.check_service_is_monitored_by_monit(process))
|
29
29
|
return false unless ret.stdout != nil && ret.success?
|
30
30
|
|
31
31
|
retlines = ret.stdout.split(/[\r\n]+/).map(&:strip)
|
@@ -36,7 +36,7 @@ module Specinfra::Command
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def self.check_file_is_readable(file, by_whom)
|
39
|
-
mode = sprintf('%04s',backend.run_command(Specinfra.
|
39
|
+
mode = sprintf('%04s',backend.run_command(Specinfra.command.get_file_mode(file)).stdout.strip)
|
40
40
|
mode = mode.split('')
|
41
41
|
mode_octal = mode[0].to_i * 512 + mode[1].to_i * 64 + mode[2].to_i * 8 + mode[3].to_i * 1
|
42
42
|
case by_whom
|
@@ -52,7 +52,7 @@ module Specinfra::Command
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def self.check_file_is_writable(file, by_whom)
|
55
|
-
mode = sprintf('%04s',backend.run_command(Specinfra.
|
55
|
+
mode = sprintf('%04s',backend.run_command(Specinfra.command.get_file_mode(file)).stdout.strip)
|
56
56
|
mode = mode.split('')
|
57
57
|
mode_octal = mode[0].to_i * 512 + mode[1].to_i * 64 + mode[2].to_i * 8 + mode[3].to_i * 1
|
58
58
|
case by_whom
|
@@ -68,7 +68,7 @@ module Specinfra::Command
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def self.check_file_is_executable(file, by_whom)
|
71
|
-
mode = sprintf('%04s',backend.run_command(Specinfra.
|
71
|
+
mode = sprintf('%04s',backend.run_command(Specinfra.command.get_file_mode(file)).stdout.strip)
|
72
72
|
mode = mode.split('')
|
73
73
|
mode_octal = mode[0].to_i * 512 + mode[1].to_i * 64 + mode[2].to_i * 8 + mode[3].to_i * 1
|
74
74
|
case by_whom
|
@@ -84,7 +84,7 @@ module Specinfra::Command
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def self.check_file_is_mounted(path, expected_attr, only_with)
|
87
|
-
ret = backend.run_command(Specinfra.
|
87
|
+
ret = backend.run_command(Specinfra.command.check_file_is_mounted(path))
|
88
88
|
if expected_attr.nil? || ret.failure?
|
89
89
|
return ret.success?
|
90
90
|
end
|
data/lib/specinfra/version.rb
CHANGED
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
property[:os_by_host] = {}
|
4
4
|
set :os, { :family => 'redhat', :release => 7 }
|
5
5
|
|
6
|
-
describe Specinfra.
|
6
|
+
describe Specinfra.command.command_class('interface').create do
|
7
7
|
it { should be_an_instance_of(Specinfra::Command::Linux::Base::Interface) }
|
8
8
|
end
|
9
9
|
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
property[:os_by_host] = {}
|
4
4
|
set :os, { :family => 'redhat' }
|
5
5
|
|
6
|
-
describe Specinfra.
|
6
|
+
describe Specinfra.command.check_package_is_installed('httpd') do
|
7
7
|
after do
|
8
8
|
property[:os_by_host] = nil
|
9
9
|
end
|
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: 2.0.0.
|
4
|
+
version: 2.0.0.beta14
|
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-07-
|
11
|
+
date: 2014-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|