omf_rc 6.2.0.pre.2 → 6.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjY2Njk0NjBhZDdiZTU5Nzg0MjNiY2Y4MDI2MDM1NjM0ZGEzZjgzZQ==
4
+ MWExNjdlOTM2YTM4MzIxMmU5M2ZlM2ZiYWQ0NjFhNmFmODdhZTMzOA==
5
5
  data.tar.gz: !binary |-
6
- N2U3NzA5YWQ1ZWU0YmYxMzlhMDU1YTI3MzRjODE5ZDc1ZjE2YzdiNw==
6
+ ZWU2YzExMzhhYWU4OTMwY2NjMjlmNGI2YjAwZmVhYTBmNDMyNGVkYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWRjOTExNDVlODBlNzVmNDliNzMzNzZhOTJlYTJlNDZhYmM5NTJlZWRjMzhh
10
- OTEwNjE4MzA0ODNmMTg3YTY2ZTExYmZhMjM1YTc2NTk5ODhkZjRjZDBhODgz
11
- M2M3MTYzYTEzY2NkMmM2MDhjYTk0YWQyNmNhZjcwMmVhYzQ2NWM=
9
+ MjE4ZDhlOGM5MjlmZTU2NDZjYzdiNmQzYmRmMTIzZmEzZjY1ZWMyNjM1YzVk
10
+ NDlkNTNlMzQ5NWRjNjM5NjBiNDAwZWUzNjQ4MGFkNWM5OWJmMjM1YWE4YWRi
11
+ ZjA5MTk2YmUyMDExN2VhZmJiZGQzYWUyZDcyYjMzNWM5OGUwYjM=
12
12
  data.tar.gz: !binary |-
13
- YzA5NGY3NWU2YmNiN2E4YzViNjc2NGRhOTIxZTMyMmZhYWUzZTgzMjI1ZTE4
14
- MmMxODlkNmZmZmQyNTUwODcxZmQwZjU0Y2M3NmJjZWEzZDUyMmI1NDI4ZWRi
15
- N2RlN2IyMzk4YTQ3OTc1YmY1NTljOWNhYjg1MDM0Y2Q1MjU0OTc=
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
- res.log_inform_warn "Cannot switch application to unknown state '#{value.to_s}'!"
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
- unless ExecApp[id].nil?
334
- # stop this app
335
- begin
336
- # first, try sending 'exit' on the stdin of the app, and wait
337
- # for 4s to see if the app acted on it...
338
- ExecApp[id].stdin('exit')
339
- sleep 4
340
- unless ExecApp[id].nil?
341
- # second, try sending TERM signal, wait another 4s to see
342
- # if the app acted on it...
343
- ExecApp[id].signal('TERM')
344
- sleep 4
345
- # finally, try sending KILL signal
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.pre.2
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-17 00:00:00.000000000 Z
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.pre.2
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.pre.2
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: 1.3.1
214
+ version: '0'
215
215
  requirements: []
216
216
  rubyforge_project: omf_rc
217
217
  rubygems_version: 2.4.2