omf_rc 6.1.2.pre.2 → 6.1.2.pre.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ require "bundler/setup"
1
2
  require 'rake/testtask'
2
3
  require "bundler/gem_tasks"
3
4
 
@@ -31,5 +31,19 @@ module OmfRc::ResourceProxy::Net
31
31
  # Interface name, default is 'eth0'.
32
32
  # @!macro prop
33
33
  property :if_name, :default => "eth0"
34
+
35
+ property :timer
36
+ # @!endgroup
37
+
38
+ # @!macro group_hook
39
+ hook :before_ready do |device|
40
+ device.property.timer = OmfCommon.el.every(5) do |timer|
41
+ net_state = device.request_state
42
+ if net_state == 'UP'
43
+ device.inform(:status, { state: net_state })
44
+ timer.cancel
45
+ end
46
+ end
47
+ end
34
48
  # @!endgroup
35
49
  end
@@ -77,5 +77,33 @@ module OmfRc::ResourceProxy::Node
77
77
  raise StandardError, "Device '#{opts[:if_name]}' not found" if net_dev.nil?
78
78
  end
79
79
  end
80
+
81
+ property :foo, default: 'this is foo'
82
+
83
+ configure :rubbish do |node, some_arg|
84
+ warn "this is useless #{some_arg}"
85
+ "this is useless #{some_arg}"
86
+ end
87
+
88
+ configure_all do |node, props, result|
89
+ if (r = props[:rubbish])
90
+ result[:rubbish] = node.configure_rubbish(r)
91
+ info "this should happen first #{r}"
92
+ else
93
+ props.each { |k, v| result[k] = node.__send__("configure_#{k}", v) }
94
+ end
95
+ end
96
+
97
+ hook :pre_configure do |node, props, result|
98
+ warn "PRE #{props}, #{result}"
99
+ end
100
+
101
+ hook :post_configure do |node, props, result|
102
+ error "PRE #{props}, #{result}"
103
+ end
104
+
105
+ #hook :on_configure do |node, opts|
106
+ # warn 'this might be useful'
107
+ #end
80
108
  # @!endgroup
81
109
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omf_rc
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.2.pre.2
4
+ version: 6.1.2.pre.3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-29 00:00:00.000000000 Z
12
+ date: 2014-05-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -82,7 +82,7 @@ dependencies:
82
82
  requirements:
83
83
  - - '='
84
84
  - !ruby/object:Gem::Version
85
- version: 6.1.2.pre.2
85
+ version: 6.1.2.pre.3
86
86
  type: :runtime
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ dependencies:
90
90
  requirements:
91
91
  - - '='
92
92
  - !ruby/object:Gem::Version
93
- version: 6.1.2.pre.2
93
+ version: 6.1.2.pre.3
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: cocaine
96
96
  requirement: !ruby/object:Gem::Requirement
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  version: 1.3.1
228
228
  requirements: []
229
229
  rubyforge_project: omf_rc
230
- rubygems_version: 1.8.28
230
+ rubygems_version: 1.8.23
231
231
  signing_key:
232
232
  specification_version: 3
233
233
  summary: OMF resource controller