omf_rc 6.0.4 → 6.0.4.1

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.
data/bin/omf_rc CHANGED
@@ -17,14 +17,14 @@ $stdout.sync = true
17
17
 
18
18
  #
19
19
  # Class to start an OMF RC. The configuration parameters can be set
20
- # in decreasing priority through the command line, configuration
21
- # file and default settings (see @def_opts).
20
+ # in decreasing priority through the command line, configuration
21
+ # file and default settings (see @def_opts).
22
22
  #
23
23
  # For historic reasons and to make this implementation more interesting
24
24
  # there are two different config file formats. A 'normal' one inherited from
25
25
  # earlier version of OMF, and an 'advanced' one which is identical to the
26
26
  # format accepted by OmfCommon.init(). To maintain some level of sanity,
27
- # only one configuration file is accepted.
27
+ # only one configuration file is accepted.
28
28
  #
29
29
  # Having said that, there is one exception and that relates to the 'oml'
30
30
  # configuration which is stripped out first and handed to the OML4R library
@@ -36,9 +36,9 @@ class OmfRcRunner
36
36
  @executable_name = File.basename($PROGRAM_NAME)
37
37
  @oml_enabled = false
38
38
  @gem_version = Gem::Specification.find_by_name('omf_rc').version.to_s
39
-
39
+
40
40
  @node_id = Socket.gethostname
41
-
41
+
42
42
  @def_opts = {
43
43
  uid: @node_id,
44
44
  uri: "xmpp:#{@node_id}-#{Process.pid}:#{@node_id}-#{Process.pid}@localhost",
@@ -46,40 +46,40 @@ class OmfRcRunner
46
46
  debug: false
47
47
  }
48
48
  @copts = {}
49
-
49
+
50
50
  @gopts = {
51
51
  config_file: nil,
52
52
  adv_config_file: nil,
53
53
  logging_configfile: nil,
54
54
  environment: nil
55
55
  }
56
-
56
+
57
57
  @opts = {}
58
58
  @omlopts = {appName: @executable_name}
59
59
  end
60
-
60
+
61
61
  def run()
62
62
  setup()
63
63
  OmfCommon::Measure.enable if @oml_enabled
64
-
64
+
65
65
  OmfCommon.init(@gopts[:environment], @opts) do |el|
66
66
  # Load a customised logging set up if provided
67
67
  OmfCommon.load_logging_config(@gopts[:logging_configfile]) if @gopts[:logging_configfile]
68
-
68
+
69
69
  info "Starting OMF Resource Controller version '#{@gem_version}'"
70
-
70
+
71
71
  #el.on_int_signal do # Implementation missing
72
72
  Signal.trap("SIGINT") do
73
73
  # TODO: Should release resources first
74
- info "Stopping ..."
74
+ info "Stopping ..."
75
75
  el.stop
76
76
  end
77
-
77
+
78
78
  # Load extensions
79
79
  if @opts[:add_default_factories] != false
80
80
  OmfRc::ResourceFactory.load_default_resource_proxies
81
81
  end
82
-
82
+
83
83
  @opts[:factories].each do |f|
84
84
  if (req = f[:require])
85
85
  begin
@@ -90,15 +90,15 @@ class OmfRcRunner
90
90
  end
91
91
  end
92
92
  end
93
-
93
+
94
94
  OmfCommon.comm.on_connected do |comm|
95
95
  info "Connected using #{comm.conn_info}"
96
-
96
+
97
97
  #if @opts[:auth] && @optss[:auth][:root_cert_dir]
98
98
  # OmfCommon::Auth::CertificateStore.instance.register_default_certs(@opts[:auth][:root_cert_dir])
99
99
  #end
100
100
  #OmfCommon::Auth::CertificateStore.instance.register(entity) if entity
101
-
101
+
102
102
  @opts[:resources].each do |res_opts|
103
103
  rtype = res_opts.delete(:type)
104
104
  res_creation_opts = res_opts.delete(:creation_opts)
@@ -111,19 +111,19 @@ class OmfRcRunner
111
111
  error "#{e.message}\n#{e.backtrace.join("\n")}"
112
112
  end
113
113
  end
114
-
114
+
115
115
  end
116
116
  end
117
117
  info "Stopping OMF Resource Controller version '#{@gem_version}'"
118
118
  end
119
-
119
+
120
120
  def setup()
121
121
  oml_init() # calls parse_config_files()
122
122
  unless @opts[:communication][:url]
123
123
  puts "Error: Missing parameters to connect to a PubSub Server (see --help)"
124
124
  exit(1)
125
125
  end
126
-
126
+
127
127
  opts = @opts
128
128
  # TODO: This needs to be fixed
129
129
  if opts[:auth]
@@ -134,7 +134,7 @@ class OmfRcRunner
134
134
  end
135
135
  opts[:communication][:auth] = {} if entity
136
136
  end
137
-
137
+
138
138
  def parse_config_files()
139
139
  @opts = {communication: {}, resources: [], factories: [], add_default_factories: true}
140
140
  config_file = @gopts[:config_file]
@@ -143,7 +143,7 @@ class OmfRcRunner
143
143
  puts "To avoid any unexpected surprises, you should stick to one form of config file"
144
144
  exit(1)
145
145
  end
146
-
146
+
147
147
  if config_file
148
148
  cfg_opts = OmfCommon.load_yaml(config_file, symbolize_keys: true, erb_process: true)
149
149
  copts = @def_opts.merge(cfg_opts.merge(@copts))
@@ -156,7 +156,7 @@ class OmfRcRunner
156
156
  @gopts[:environment] ||= copts[:environment]
157
157
  @omlopts.merge(copts[:oml] || {}) {|k, v1, v2| v1 } # merge in place as OML may hold @omlopts
158
158
  end
159
-
159
+
160
160
  if adv_config_file
161
161
  aopts = OmfCommon.load_yaml(adv_config_file, symbolize_keys: true, erb_process: true)
162
162
  aenv = aopts.delete(:environment)
@@ -166,45 +166,45 @@ class OmfRcRunner
166
166
  @omlopts.merge!(@opts.delete(:oml) || {}) {|k, v1, v2| v1 || v2 } # merge in place as OML may hold @omlopts
167
167
  end
168
168
  end
169
-
169
+
170
170
  def oml_init
171
171
  begin
172
172
  @omlopts[:afterParse] = lambda {|o| parse_config_files() }
173
173
  @oml_enabled = OML4R::init(ARGV, @omlopts) do |op|
174
174
  op.banner = "OMF Resource Controller version '#{@gem_version}'\n"
175
175
  op.banner += "Usage: #{@executable_name} [options]"
176
-
176
+
177
177
  op.on("-c CONFIGFILE", "Configuration File") do |file|
178
178
  @gopts[:config_file] = file
179
179
  end
180
-
180
+
181
181
  op.on("-a ADVANCED_CONFIGFILE", "Advanced Configuration File") do |file|
182
182
  @gopts[:adv_config_file] = file
183
183
  end
184
-
184
+
185
185
  op.on("--log_config CONFIGFILE", "Logging Configuration File") do |file|
186
186
  @gopts[:logging_configfile] = file
187
187
  end
188
-
188
+
189
189
  op.on("-u URI", "Communication URI [#{@def_opts[:uri]}") do |uri|
190
190
  @copts[:uri] = uri
191
191
  end
192
-
192
+
193
193
  op.on("-e ENVIRONMENT", "Environment (development, production ...) [#{@def_opts[:environment]}]") do |e|
194
194
  @gopts[:environment] = e
195
195
  end
196
-
196
+
197
197
  op.on("-i UID", "UID (and pubsub topic) of the resource, [#{@def_opts[:uid]}]") do |uid|
198
198
  @copts[:uid] = uid
199
199
  end
200
-
200
+
201
201
  op.on("-v", "--version", "Show version") do
202
202
  puts "OMF Resource Controller version '#{@gem_version}'"
203
203
  exit
204
204
  end
205
-
205
+
206
206
  op.on("-h", "--help", "Show this message") do
207
- puts opts
207
+ puts op
208
208
  exit
209
209
  end
210
210
  end
data/init/debian CHANGED
@@ -1,7 +1,7 @@
1
1
  #! /bin/sh
2
2
  ### BEGIN INIT INFO
3
3
  # Provides: omf-rc
4
- # Required-Start: $remote_fs $syslog
4
+ # Required-Start: $ALL
5
5
  # Required-Stop: $remote_fs $syslog
6
6
  # Default-Start: 2 3 4 5
7
7
  # Default-Stop: 0 1 6
@@ -9,6 +9,7 @@
9
9
  # Description: Enable service provided by daemon.
10
10
  ### END INIT INFO
11
11
 
12
+ PATH=$PATH:/usr/local/bin
12
13
  DAEMON=/usr/local/bin/run_omf_rc.sh
13
14
  [ -x "$DAEMON" ] || exit 0
14
15
  NAME=omf_rc
@@ -48,4 +49,4 @@ case "$1" in
48
49
  ;;
49
50
  esac
50
51
 
51
- :
52
+ :
data/init/fedora CHANGED
@@ -1,7 +1,7 @@
1
1
  #! /bin/sh
2
2
  ### BEGIN INIT INFO
3
3
  # Provides: omf-rc
4
- # Required-Start: $remote_fs $syslog
4
+ # Required-Start: $ALL
5
5
  # Required-Stop: $remote_fs $syslog
6
6
  # Default-Start: 2 3 4 5
7
7
  # Default-Stop: 0 1 6
@@ -9,6 +9,7 @@
9
9
  # Description: Enable service provided by daemon.
10
10
  ### END INIT INFO
11
11
 
12
+ PATH=$PATH:/usr/local/bin
12
13
  DAEMON=/usr/local/bin/run_omf_rc.sh
13
14
  [ -x "$DAEMON" ] || exit 0
14
15
  NAME=omf_rc
@@ -51,4 +52,4 @@ case "$1" in
51
52
  ;;
52
53
  esac
53
54
 
54
- :
55
+ :
data/init/ubuntu CHANGED
@@ -6,4 +6,7 @@ stop on runlevel [!2345]
6
6
 
7
7
  env DAEMON=/usr/local/bin/run_omf_rc.sh
8
8
 
9
- exec $DAEMON 2>&1 | logger -t omf_rc
9
+ script
10
+ PATH=$PATH:/usr/local/bin
11
+ exec $DAEMON 2>&1 | logger -t omf_rc
12
+ end script
@@ -4,5 +4,5 @@
4
4
  # By downloading or using this software you accept the terms and the liability disclaimer in the License.
5
5
 
6
6
  module OmfRc
7
- VERSION = "6.0.4"
7
+ VERSION = "6.0.4.1"
8
8
  end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omf_rc
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.4
4
+ version: 6.0.4.1
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: 2013-09-02 00:00:00.000000000 Z
12
+ date: 2013-09-04 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
@@ -20,6 +22,7 @@ dependencies:
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
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: em-minitest-spec
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
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
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: pry
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ! '>='
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
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
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: simplecov
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ! '>='
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
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
@@ -69,6 +78,7 @@ dependencies:
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
@@ -76,6 +86,7 @@ dependencies:
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
@@ -83,6 +94,7 @@ dependencies:
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
@@ -90,6 +102,7 @@ dependencies:
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
@@ -97,6 +110,7 @@ dependencies:
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: mocha
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
115
  - - ! '>='
102
116
  - !ruby/object:Gem::Version
@@ -104,6 +118,7 @@ dependencies:
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
@@ -187,25 +202,55 @@ files:
187
202
  homepage: http://omf.mytestbed.net
188
203
  licenses:
189
204
  - MIT
190
- metadata: {}
191
205
  post_install_message:
192
206
  rdoc_options: []
193
207
  require_paths:
194
208
  - lib
195
209
  required_ruby_version: !ruby/object:Gem::Requirement
210
+ none: false
196
211
  requirements:
197
212
  - - ! '>='
198
213
  - !ruby/object:Gem::Version
199
214
  version: 1.9.3
200
215
  required_rubygems_version: !ruby/object:Gem::Requirement
216
+ none: false
201
217
  requirements:
202
218
  - - ! '>='
203
219
  - !ruby/object:Gem::Version
204
220
  version: '0'
221
+ segments:
222
+ - 0
223
+ hash: -760579399178425643
205
224
  requirements: []
206
225
  rubyforge_project: omf_rc
207
- rubygems_version: 2.0.7
226
+ rubygems_version: 1.8.25
208
227
  signing_key:
209
- specification_version: 4
228
+ specification_version: 3
210
229
  summary: OMF resource controller
211
- test_files: []
230
+ test_files:
231
+ - test/fixture/ip/addr_show
232
+ - test/fixture/iw/help
233
+ - test/fixture/iw/info
234
+ - test/fixture/iw/link
235
+ - test/fixture/lsmod
236
+ - test/fixture/oml.hash
237
+ - test/fixture/oml.spec
238
+ - test/fixture/oml.xml
239
+ - test/fixture/sys/class/ieee80211/phy0/device/uevent
240
+ - test/fixture/sys/class/ieee80211/phy0/uevent
241
+ - test/fixture/sys/class/net/eth0/device/uevent
242
+ - test/fixture/sys/class/net/eth0/uevent
243
+ - test/fixture/sys/class/net/wlan0/device/uevent
244
+ - test/fixture/sys/class/net/wlan0/uevent
245
+ - test/omf_rc/deferred_process_spec.rb
246
+ - test/omf_rc/message_process_error_spec.rb
247
+ - test/omf_rc/resource_factory_spec.rb
248
+ - test/omf_rc/resource_proxy/abstract_resource_spec.rb
249
+ - test/omf_rc/resource_proxy/application_spec.rb
250
+ - test/omf_rc/resource_proxy/node_spec.rb
251
+ - test/omf_rc/resource_proxy_dsl_spec.rb
252
+ - test/omf_rc/util/common_tools_spec.rb
253
+ - test/omf_rc/util/ip_spec.rb
254
+ - test/omf_rc/util/iw_spec.rb
255
+ - test/omf_rc/util/mod_spec.rb
256
+ - test/test_helper.rb
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- Y2E5YTUyM2U4OWQzYjk2Y2RlMTBlMDZiOGJmYmY5ZTg3MTY0ZTJiOQ==
5
- data.tar.gz: !binary |-
6
- MGQ2YmY4ZTY1NTM3ZjQyNjNhZjU0NTVmYjc4YzM4ZmVhNTlmNzg4Zg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZDEyM2VmZDViZDRkOTM0ZTZhYjY2YmQ2OGNmMGY1MzgzZDEwZjMzMjZiNTYy
10
- MmRiMzY4ZmIxMmIxZTU5MGNkMDlkNDVlOTY2ZjRkODcyMTNjMzFmYmM4NmU2
11
- YmI2YjhlNGMxYmEzOTdjYTg2MmJiYjg3ZTg3ZTkzYmU2ODc5NmY=
12
- data.tar.gz: !binary |-
13
- MDQ3ZmEyMTlkNDhhMGI4NTRkY2IyY2UyZGYxNTIwOTU0ZmU0Mjk3M2E5NjA4
14
- NTQxNTNiYjhlNmMxZGFjZTc1ODdkNTkxZTk0MWZkMTQ5MzRkMDQ3YzljMTk1
15
- OGMwOTcwOGQxZjgyNTc4NDJjODIxMmVkZWY4ZWMzOWM3ZDA0Y2Q=