omf_rc 6.1.9.pre.3 → 6.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -85,6 +85,7 @@ module OmfRc::ResourceProxy::Node
85
85
  # referenced in that file. The result is sent to an OML database.
86
86
  hook :before_ready do |res|
87
87
  next if res.defaults(:topo_file).nil? || res.defaults(:topo_file).empty?
88
- check_topology(res.uid, res.defaults(:topo_file))
88
+ timeout = res.defaults(:topo_check_timeout) || 600
89
+ check_topology(res.uid, res.defaults(:topo_file), timeout)
89
90
  end
90
91
  end
data/lib/omf_rc/runner.rb CHANGED
@@ -142,8 +142,9 @@ module OmfRc
142
142
  end
143
143
 
144
144
  @opts.merge!(@gopts)
145
-
146
- @omlopts.merge(@opts[:instrumentation] || {}) { |k, v1, v2| v1 } # merge in place as OML may hold @omlopts
145
+ # Merge in place as OML may hold @omlopts
146
+ in_place_oml_opts = (@opts[:oml] || @opts[:instrumentation] || Mash.new).to_hash(symbolize_keys: true)
147
+ @omlopts.merge!(in_place_oml_opts)
147
148
  end
148
149
  end
149
150
 
@@ -14,13 +14,13 @@ module OmfRc::Util::Topology
14
14
  # This MP is reporting if a 'to' host is reachable from a 'from' host
15
15
  class OmfRc::Util::Topology::MPEdges < OML4R::MPBase
16
16
  name :edges
17
- param :timestamp, :type => :double # Time (s)
17
+ param :timestamp, :type => :double # Time (s)
18
18
  param :from, :type => :string # ID/Name for this Resource Proxy
19
19
  param :to, :type => :string # Address/Name of remote host
20
20
  param :reachable, :type => :string # Is the remote host reachable?
21
21
  end
22
22
 
23
- # Check if a list of hosts from a local file are reachable from the host
23
+ # Check if a list of hosts from a local file are reachable from the host
24
24
  # running this Node Proxy. The input topology file must simply contain one
25
25
  # line per host, i.e. its IP address of hostname.
26
26
  # The results of this check are send to the OML server and database set
@@ -29,13 +29,18 @@ module OmfRc::Util::Topology
29
29
  # @yieldparam [Object] from the id or name of this Node Proxy
30
30
  # @yieldparam [Object] topo_path the file with the host addresses
31
31
  #
32
- work :check_topology do |res,from,topo_path|
33
- info "Checking topology from file: '#{topo_path}'"
34
- File.foreach(topo_path) do |v|
35
- target = v.chomp
36
- reachable = `ping -c 1 #{target}`.include?('bytes from')
37
- info "Checked link to #{target}: #{reachable}"
38
- OmfRc::Util::Topology::MPEdges.inject(Time.now.to_i, from, target, reachable)
32
+ work :check_topology do |res, from, topo_path, timeout|
33
+ timeout ||= 600 # Stop checking after 10 minutes
34
+ t = OmfCommon.el.every(10) do
35
+ info "Checking topology from file: '#{topo_path}'"
36
+ File.foreach(topo_path) do |v|
37
+ target = v.chomp
38
+ reachable = `ping -c 1 #{target}`.include?('bytes from')
39
+ info "Checked link to #{target}: #{reachable}"
40
+ OmfRc::Util::Topology::MPEdges.inject(Time.now.to_i, from, target, reachable)
41
+ end
39
42
  end
43
+
44
+ OmfCommon.el.after(timeout) { t.cancel }
40
45
  end
41
46
  end
metadata CHANGED
@@ -1,111 +1,126 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omf_rc
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.9.pre.3
4
+ version: 6.1.9
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - NICTA
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-10-09 00:00:00.000000000 Z
12
+ date: 2014-10-10 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: minitest
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - '>='
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: pry
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - '>='
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0'
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - '>='
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: simplecov
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - '>='
51
+ - - ! '>='
46
52
  - !ruby/object:Gem::Version
47
53
  version: '0'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - '>='
59
+ - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: mocha
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - '>='
67
+ - - ! '>='
60
68
  - !ruby/object:Gem::Version
61
69
  version: '0'
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - '>='
75
+ - - ! '>='
67
76
  - !ruby/object:Gem::Version
68
77
  version: '0'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: omf_common
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - '='
74
84
  - !ruby/object:Gem::Version
75
- version: 6.1.9.pre.3
85
+ version: 6.1.9
76
86
  type: :runtime
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - '='
81
92
  - !ruby/object:Gem::Version
82
- version: 6.1.9.pre.3
93
+ version: 6.1.9
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: cocaine
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
- - - '>='
99
+ - - ! '>='
88
100
  - !ruby/object:Gem::Version
89
101
  version: '0'
90
102
  type: :runtime
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
- - - '>='
107
+ - - ! '>='
95
108
  - !ruby/object:Gem::Version
96
109
  version: '0'
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: facter
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
- - - '>='
115
+ - - ! '>='
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0'
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
- - - '>='
123
+ - - ! '>='
109
124
  - !ruby/object:Gem::Version
110
125
  version: '0'
111
126
  description: Resource controller of OMF, a generic framework for controlling and managing
@@ -197,54 +212,29 @@ files:
197
212
  homepage: http://omf.mytestbed.net
198
213
  licenses:
199
214
  - MIT
200
- metadata: {}
201
215
  post_install_message:
202
216
  rdoc_options: []
203
217
  require_paths:
204
218
  - lib
205
219
  required_ruby_version: !ruby/object:Gem::Requirement
220
+ none: false
206
221
  requirements:
207
- - - '>='
222
+ - - ! '>='
208
223
  - !ruby/object:Gem::Version
209
224
  version: 1.9.3
210
225
  required_rubygems_version: !ruby/object:Gem::Requirement
226
+ none: false
211
227
  requirements:
212
- - - '>'
228
+ - - ! '>='
213
229
  - !ruby/object:Gem::Version
214
- version: 1.3.1
230
+ version: '0'
231
+ segments:
232
+ - 0
233
+ hash: -3715069632668391664
215
234
  requirements: []
216
235
  rubyforge_project: omf_rc
217
- rubygems_version: 2.1.11
236
+ rubygems_version: 1.8.23
218
237
  signing_key:
219
- specification_version: 4
238
+ specification_version: 3
220
239
  summary: OMF resource controller
221
- test_files:
222
- - test/fixture/ip/addr_show
223
- - test/fixture/iw/help
224
- - test/fixture/iw/info
225
- - test/fixture/iw/link
226
- - test/fixture/lsmod
227
- - test/fixture/omf_rc.simple.yml
228
- - test/fixture/omf_rc.yml
229
- - test/fixture/oml.hash
230
- - test/fixture/oml.spec
231
- - test/fixture/oml.xml
232
- - test/fixture/sys/class/ieee80211/phy0/device/uevent
233
- - test/fixture/sys/class/ieee80211/phy0/uevent
234
- - test/fixture/sys/class/net/eth0/device/uevent
235
- - test/fixture/sys/class/net/eth0/uevent
236
- - test/fixture/sys/class/net/wlan0/device/uevent
237
- - test/fixture/sys/class/net/wlan0/uevent
238
- - test/omf_rc/message_process_error_spec.rb
239
- - test/omf_rc/resource_factory_spec.rb
240
- - test/omf_rc/resource_proxy/abstract_resource_spec.rb
241
- - test/omf_rc/resource_proxy/application_spec.rb
242
- - test/omf_rc/resource_proxy/node_spec.rb
243
- - test/omf_rc/resource_proxy_dsl_spec.rb
244
- - test/omf_rc/runner_spec.rb
245
- - test/omf_rc/util/common_tools_spec.rb
246
- - test/omf_rc/util/fact_spec.rb
247
- - test/omf_rc/util/ip_spec.rb
248
- - test/omf_rc/util/iw_spec.rb
249
- - test/omf_rc/util/mod_spec.rb
250
- - test/test_helper.rb
240
+ test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 40a379ccf3e96a718c8ed4ea8a8b65e14edc2d82
4
- data.tar.gz: 3bd5b1e9b8f98b6bf53980b71dcc9a41e3fcdeac
5
- SHA512:
6
- metadata.gz: 95d40bf71325da5f8c74a0ebcb2fe3c99022ee5b37533cef23713db32ed15b06a0e64fcff6e40f2e22b03cca299c6e44716f8a7c6b5235b5ee4313f258b2c626
7
- data.tar.gz: 05ac257e1e5b88172d13fa7fe3244bd590f8b5e58a6f2fa92cd44882524d4bd1a0642c34c3835c56a5c1ba2180183ace15988159616c9cb882a8cf2effb19bc5