specinfra 2.0.0.beta48 → 2.0.0.beta49
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/specinfra/command.rb +1 -0
- data/lib/specinfra/command/openbsd/base/routing_table.rb +9 -0
- data/lib/specinfra/processor.rb +15 -6
- data/lib/specinfra/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57c43910f7e3383297771e203b9487ac3832ce66
|
4
|
+
data.tar.gz: b3c1c7ca91123663db49c35409ac0a7a25349c8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30552786b192a05a2b4ce8c21959561c62e238d3e05f42150373a82788a9b2dccd14732e590ca551b78a5a9dfee0795cb8abc9f9a4ced8cd00819edc203343ab
|
7
|
+
data.tar.gz: 534f203f6b2fc78ac298a5169b95490aa4af0c5489e1ba060c8ba786f2d30ba6d0929dfff0e1cf47d311b05715e191d59f3d5bdd73144ff5171dedf6e972143e
|
data/lib/specinfra/command.rb
CHANGED
@@ -160,6 +160,7 @@ require 'specinfra/command/openbsd/base/interface'
|
|
160
160
|
require 'specinfra/command/openbsd/base/mail_alias'
|
161
161
|
require 'specinfra/command/openbsd/base/package'
|
162
162
|
require 'specinfra/command/openbsd/base/port'
|
163
|
+
require 'specinfra/command/openbsd/base/routing_table'
|
163
164
|
require 'specinfra/command/openbsd/base/service'
|
164
165
|
require 'specinfra/command/openbsd/base/user'
|
165
166
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class Specinfra::Command::Openbsd::Base::RoutingTable < Specinfra::Command::Base::RoutingTable
|
2
|
+
class << self
|
3
|
+
def check_has_entry(destination)
|
4
|
+
"route -n show -gateway | egrep '(^default|#{destination})' | head -1"
|
5
|
+
end
|
6
|
+
|
7
|
+
alias :get_entry :check_has_entry
|
8
|
+
end
|
9
|
+
end
|
data/lib/specinfra/processor.rb
CHANGED
@@ -123,12 +123,21 @@ module Specinfra
|
|
123
123
|
|
124
124
|
ret.stdout.gsub!(/\r\n/, "\n")
|
125
125
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
126
|
+
if os[:family] == 'openbsd'
|
127
|
+
match = ret.stdout.match(/^(?<destination>\S+)\s+(?<gateway>\S+).*?(?<interface>\S+[0-9]+)$/)
|
128
|
+
actual_attr = {
|
129
|
+
:destination => match[:destination],
|
130
|
+
:gateway => match[:gateway],
|
131
|
+
:interface => expected_attr[:interface] ? match[:interface] : nil
|
132
|
+
}
|
133
|
+
else
|
134
|
+
ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+\n(?:default via (\S+))?/
|
135
|
+
actual_attr = {
|
136
|
+
:destination => $1,
|
137
|
+
:gateway => $2 ? $2 : $4,
|
138
|
+
:interface => expected_attr[:interface] ? $3 : nil
|
139
|
+
}
|
140
|
+
end
|
132
141
|
|
133
142
|
expected_attr.each do |key, val|
|
134
143
|
return false if actual_attr[key] != val
|
data/lib/specinfra/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.beta49
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
@@ -229,6 +229,7 @@ files:
|
|
229
229
|
- lib/specinfra/command/openbsd/base/mail_alias.rb
|
230
230
|
- lib/specinfra/command/openbsd/base/package.rb
|
231
231
|
- lib/specinfra/command/openbsd/base/port.rb
|
232
|
+
- lib/specinfra/command/openbsd/base/routing_table.rb
|
232
233
|
- lib/specinfra/command/openbsd/base/service.rb
|
233
234
|
- lib/specinfra/command/openbsd/base/user.rb
|
234
235
|
- lib/specinfra/command/opensuse.rb
|