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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 577fd3b2ff3d56cf563cae10864298009865e6d4
4
- data.tar.gz: 9492bf5c9b869f970fe038cf922d51f29ff8df23
3
+ metadata.gz: 57c43910f7e3383297771e203b9487ac3832ce66
4
+ data.tar.gz: b3c1c7ca91123663db49c35409ac0a7a25349c8a
5
5
  SHA512:
6
- metadata.gz: 2c39424a9216178cc408ec808164e122846646761f36aaf3b5f09d7e978758667c8429da2a50f285c0e5e721af5f1bfd23a409e6673bf9ec4cdb4948c0ee4ebb
7
- data.tar.gz: 59806cff36f20271f23f12f027f57ecf8905e220db0ef80347c82abad76a7dd3e24a93596f92fb939d7739e91d91d9ffe199edf50bc386b9dc9f66d7e0c20814
6
+ metadata.gz: 30552786b192a05a2b4ce8c21959561c62e238d3e05f42150373a82788a9b2dccd14732e590ca551b78a5a9dfee0795cb8abc9f9a4ced8cd00819edc203343ab
7
+ data.tar.gz: 534f203f6b2fc78ac298a5169b95490aa4af0c5489e1ba060c8ba786f2d30ba6d0929dfff0e1cf47d311b05715e191d59f3d5bdd73144ff5171dedf6e972143e
@@ -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
@@ -123,12 +123,21 @@ module Specinfra
123
123
 
124
124
  ret.stdout.gsub!(/\r\n/, "\n")
125
125
 
126
- ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+\n(?:default via (\S+))?/
127
- actual_attr = {
128
- :destination => $1,
129
- :gateway => $2 ? $2 : $4,
130
- :interface => expected_attr[:interface] ? $3 : nil
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
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.0.0.beta48"
2
+ VERSION = "2.0.0.beta49"
3
3
  end
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.beta48
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