specinfra 2.0.0.beta12 → 2.0.0.beta13
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 +4 -0
- data/lib/specinfra/backend/base.rb +2 -2
- data/lib/specinfra/command/base/package.rb +0 -1
- data/lib/specinfra/command/base/routing_table.rb +2 -0
- data/lib/specinfra/command/processor.rb +9 -9
- data/lib/specinfra/helper/os.rb +0 -4
- 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: 5c02ea87aab8e7f7ed23696adbe6f4c943179cd8
|
|
4
|
+
data.tar.gz: ec24615f39351a0e8b94b85196e3ea00becb2ae9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b5639ff7909fc512270dc42c47f609b67635367b8faa5917316729e40c1506a36922d91d17f26a63fa670bac6942e7a4239f9e0e68fa46f3d7cdb81da59ee0ff
|
|
7
|
+
data.tar.gz: abc23375ee803df39d37accd78cd054f229706dfb6aa8632ef2adeb2e8d0512627d88249fe85543d424b1e63a580c524d7e1437e2b458f7f057c049899b0554b
|
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(commands.send(cmd, *args)).success?
|
|
23
|
+
run_command(Specinfra.commands.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(commands.send(meth, *args))
|
|
31
|
+
backend.run_command(Specinfra.commands.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(commands.send(meth, *args))
|
|
7
|
+
backend.run_command(Specinfra.commands.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(commands.check_service_is_running(service))
|
|
12
|
+
ret = backend.run_command(Specinfra.commands.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(commands.check_process_is_running(service))
|
|
21
|
+
ret = backend.run_command(Specinfra.commands.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(commands.check_service_is_monitored_by_monit(process))
|
|
28
|
+
ret = backend.run_command(Specinfra.commands.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(commands.get_file_mode(file)).stdout.strip)
|
|
39
|
+
mode = sprintf('%04s',backend.run_command(Specinfra.commands.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(commands.get_file_mode(file)).stdout.strip)
|
|
55
|
+
mode = sprintf('%04s',backend.run_command(Specinfra.commands.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(commands.get_file_mode(file)).stdout.strip)
|
|
71
|
+
mode = sprintf('%04s',backend.run_command(Specinfra.commands.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(commands.check_file_is_mounted(path))
|
|
87
|
+
ret = backend.run_command(Specinfra.commands.check_file_is_mounted(path))
|
|
88
88
|
if expected_attr.nil? || ret.failure?
|
|
89
89
|
return ret.success?
|
|
90
90
|
end
|
|
@@ -118,7 +118,7 @@ module Specinfra::Command
|
|
|
118
118
|
|
|
119
119
|
def self.check_routing_table_has_entry(expected_attr)
|
|
120
120
|
return false if ! expected_attr[:destination]
|
|
121
|
-
ret = backend.
|
|
121
|
+
ret = backend.get_routing_table_entry(expected_attr[:destination])
|
|
122
122
|
return false if ret.failure?
|
|
123
123
|
|
|
124
124
|
ret.stdout.gsub!(/\r\n/, "\n")
|
data/lib/specinfra/helper/os.rb
CHANGED
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 commands.command_class('interface').create do
|
|
6
|
+
describe Specinfra.commands.command_class('interface').create do
|
|
7
7
|
it { should be_an_instance_of(Specinfra::Command::Linux::Base::Interface) }
|
|
8
8
|
end
|
|
9
9
|
|
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.beta13
|
|
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-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: net-ssh
|