omf_rc 6.2.0.pre.2 → 6.2.0
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 +8 -8
- data/lib/omf_rc/resource_proxy/application.rb +17 -18
- data/test/omf_rc/resource_factory_spec.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWExNjdlOTM2YTM4MzIxMmU5M2ZlM2ZiYWQ0NjFhNmFmODdhZTMzOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWU2YzExMzhhYWU4OTMwY2NjMjlmNGI2YjAwZmVhYTBmNDMyNGVkYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjE4ZDhlOGM5MjlmZTU2NDZjYzdiNmQzYmRmMTIzZmEzZjY1ZWMyNjM1YzVk
|
10
|
+
NDlkNTNlMzQ5NWRjNjM5NjBiNDAwZWUzNjQ4MGFkNWM5OWJmMjM1YWE4YWRi
|
11
|
+
ZjA5MTk2YmUyMDExN2VhZmJiZGQzYWUyZDcyYjMzNWM5OGUwYjM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTA4MmFhMDQwZTY2M2E5ZjQ1ZGNiNzMwMzYzMzg1ZDhkNTBkMDNjODI4NWIw
|
14
|
+
OTM5OTI5MThiOTBmNTVkMDgwZGE5NDVjNmMzMWExYzkwYjEwNDZkNGI5ZmIz
|
15
|
+
ZDE5ODczZDhjZWVkMTY3MzJlMzA2NjkwNGY1NzA4NTIzNzY2Mjk=
|
@@ -283,7 +283,10 @@ module OmfRc::ResourceProxy::Application
|
|
283
283
|
when :running then res.switch_to_running
|
284
284
|
when :paused then res.switch_to_paused
|
285
285
|
else
|
286
|
-
|
286
|
+
# It is OK to create an APP with state :created
|
287
|
+
unless res.property.state == :created
|
288
|
+
res.log_inform_warn "Cannot switch application to unknown state '#{value.to_s}'!"
|
289
|
+
end
|
287
290
|
end
|
288
291
|
end
|
289
292
|
res.property.state
|
@@ -330,23 +333,19 @@ module OmfRc::ResourceProxy::Application
|
|
330
333
|
work('switch_to_stopped') do |res|
|
331
334
|
if res.property.state == :running || res.property.state == :paused
|
332
335
|
id = res.property.app_id
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
ExecApp[id].signal('KILL') unless ExecApp[id].nil?
|
347
|
-
end
|
348
|
-
res.property.state = :stopped
|
349
|
-
rescue => err
|
336
|
+
# stop this app
|
337
|
+
# first, try sending 'exit' on the stdin of the app, and wait
|
338
|
+
# for 4s to see if the app acted on it...
|
339
|
+
ExecApp.has?(id) ? (ExecApp[id].stdin('exit') rescue nil) : res.property.state = :stopped
|
340
|
+
|
341
|
+
OmfCommon.el.after(4) do
|
342
|
+
# second, try sending TERM signal, wait another 4s to see
|
343
|
+
# if the app acted on it...
|
344
|
+
ExecApp.has?(id) ? (ExecApp[id].signal('TERM') rescue nil) : res.property.state = :stopped
|
345
|
+
|
346
|
+
OmfCommon.el.after(4) do
|
347
|
+
# finally, try sending KILL signal
|
348
|
+
ExecApp.has?(id) ? (ExecApp[id].signal('KILL') rescue nil) : res.property.state = :stopped
|
350
349
|
end
|
351
350
|
end
|
352
351
|
end
|
@@ -10,7 +10,7 @@ describe OmfRc::ResourceFactory do
|
|
10
10
|
describe "when resource proxies loaded" do
|
11
11
|
before do
|
12
12
|
@xmpp = MiniTest::Mock.new
|
13
|
-
@xmpp.expect(:subscribe, true, [String])
|
13
|
+
@xmpp.expect(:subscribe, true, [String, Hash])
|
14
14
|
end
|
15
15
|
|
16
16
|
it "must have list of registered proxies and utilities" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omf_rc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.2.0
|
4
|
+
version: 6.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NICTA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 6.2.0
|
75
|
+
version: 6.2.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 6.2.0
|
82
|
+
version: 6.2.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: cocaine
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,9 +209,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
209
209
|
version: 1.9.3
|
210
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
211
|
requirements:
|
212
|
-
- - ! '
|
212
|
+
- - ! '>='
|
213
213
|
- !ruby/object:Gem::Version
|
214
|
-
version:
|
214
|
+
version: '0'
|
215
215
|
requirements: []
|
216
216
|
rubyforge_project: omf_rc
|
217
217
|
rubygems_version: 2.4.2
|