rsmp 0.16.7 → 0.16.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/config/tlc.yaml +1 -1
- data/lib/rsmp/proxy.rb +13 -15
- data/lib/rsmp/site.rb +2 -2
- data/lib/rsmp/site_proxy.rb +2 -2
- data/lib/rsmp/supervisor.rb +5 -5
- data/lib/rsmp/supervisor_proxy.rb +4 -4
- data/lib/rsmp/version.rb +1 -1
- data/rsmp.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6145f5ec4795f581c7afc1ecad3e4aa3442d2bcb4277cb7efdc3fc82e9f8d03f
|
4
|
+
data.tar.gz: 7ef1bb9c257e7ee57c48d655b1cf8500e9125df014ba53c7cedc1f8f86494567
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdb2b2d0966bd169caccf9b902ba92bf0f5de8244f32cb4ccc546d0e234914bf4f5cf8079592da99fb1c5c195247a598e549f1cc4bb806979cca6e2feb4cf7a9
|
7
|
+
data.tar.gz: 520fc2ed7db385c9b2bbbe8cd0c0e35cbc6c859e2117c54a92df2f4d9614d22e2da5ef58cd0eeb0adc791cfd19afe16c3673d71cb5518463d831d2718a5b1fda
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rsmp (0.16.
|
4
|
+
rsmp (0.16.9)
|
5
5
|
async (~> 1.30.3)
|
6
6
|
async-io (~> 1.33.0)
|
7
7
|
colorize (~> 0.8.1)
|
8
|
-
rsmp_schema (~> 0.
|
8
|
+
rsmp_schema (~> 0.4.0)
|
9
9
|
thor (~> 1.2.1)
|
10
10
|
|
11
11
|
GEM
|
@@ -79,8 +79,8 @@ GEM
|
|
79
79
|
multi_test (0.1.2)
|
80
80
|
nio4r (2.5.8)
|
81
81
|
rake (13.0.6)
|
82
|
-
regexp_parser (2.
|
83
|
-
rsmp_schema (0.
|
82
|
+
regexp_parser (2.6.0)
|
83
|
+
rsmp_schema (0.4.0)
|
84
84
|
json_schemer (~> 0.2.21)
|
85
85
|
thor (~> 1.2.1)
|
86
86
|
rspec (3.10.0)
|
data/config/tlc.yaml
CHANGED
data/lib/rsmp/proxy.rb
CHANGED
@@ -13,8 +13,7 @@ module RSMP
|
|
13
13
|
include Inspect
|
14
14
|
include Task
|
15
15
|
|
16
|
-
attr_reader :state, :archive, :connection_info, :sxl, :collector, :ip, :port, :node, :
|
17
|
-
|
16
|
+
attr_reader :state, :archive, :connection_info, :sxl, :collector, :ip, :port, :node, :core_version
|
18
17
|
def initialize options
|
19
18
|
@node = options[:node]
|
20
19
|
initialize_logging options
|
@@ -316,7 +315,7 @@ module RSMP
|
|
316
315
|
|
317
316
|
def get_schemas
|
318
317
|
schemas = { core: RSMP::Schema.latest_core_version } # use latest core
|
319
|
-
schemas[:core] =
|
318
|
+
schemas[:core] = core_version if core_version
|
320
319
|
schemas[sxl] = RSMP::Schema.sanitize_version(sxl_version.to_s) if sxl && sxl_version
|
321
320
|
schemas
|
322
321
|
end
|
@@ -455,18 +454,18 @@ module RSMP
|
|
455
454
|
dont_acknowledge message, "Received", "extraneous Version message"
|
456
455
|
end
|
457
456
|
|
458
|
-
def
|
459
|
-
return [RSMP::Schema.latest_core_version] if @site_settings["
|
460
|
-
return RSMP::Schema.core_versions if @site_settings["
|
461
|
-
[@site_settings["
|
457
|
+
def core_versions
|
458
|
+
return [RSMP::Schema.latest_core_version] if @site_settings["core_versions"] == 'latest'
|
459
|
+
return RSMP::Schema.core_versions if @site_settings["core_versions"] == 'all'
|
460
|
+
[@site_settings["core_versions"]].flatten
|
462
461
|
end
|
463
462
|
|
464
|
-
def
|
465
|
-
versions =
|
463
|
+
def check_core_version message
|
464
|
+
versions = core_versions
|
466
465
|
# find versions that both we and the client support
|
467
466
|
candidates = message.versions & versions
|
468
467
|
if candidates.any?
|
469
|
-
@
|
468
|
+
@core_version = candidates.sort_by { |v| Gem::Version.new(v) }.last # pick latest version
|
470
469
|
else
|
471
470
|
raise HandshakeError.new "RSMP versions [#{message.versions.join(',')}] requested, but only [#{versions.join(',')}] supported."
|
472
471
|
end
|
@@ -506,13 +505,13 @@ module RSMP
|
|
506
505
|
raise RSMP::TimeoutError.new "Did not reach state #{state} within #{timeout}s"
|
507
506
|
end
|
508
507
|
|
509
|
-
def send_version site_id,
|
510
|
-
if
|
508
|
+
def send_version site_id, core_versions
|
509
|
+
if core_versions=='latest'
|
511
510
|
versions = [RSMP::Schema.latest_core_version]
|
512
|
-
elsif
|
511
|
+
elsif core_versions=='all'
|
513
512
|
versions = RSMP::Schema.core_versions
|
514
513
|
else
|
515
|
-
versions = [
|
514
|
+
versions = [core_versions].flatten
|
516
515
|
end
|
517
516
|
versions_array = versions.map {|v| {"vers" => v} }
|
518
517
|
|
@@ -662,6 +661,5 @@ module RSMP
|
|
662
661
|
log "StatusSubscribe #{short} acknowledged, allowing repeated status values for #{subscribe_list}", level: :info
|
663
662
|
component.allow_repeat_updates subscribe_list
|
664
663
|
end
|
665
|
-
|
666
664
|
end
|
667
665
|
end
|
data/lib/rsmp/site.rb
CHANGED
@@ -6,7 +6,7 @@ module RSMP
|
|
6
6
|
class Site < Node
|
7
7
|
include Components
|
8
8
|
|
9
|
-
attr_reader :
|
9
|
+
attr_reader :core_versions, :site_settings, :logger, :proxies
|
10
10
|
|
11
11
|
def initialize options={}
|
12
12
|
super options
|
@@ -32,7 +32,7 @@ module RSMP
|
|
32
32
|
'supervisors' => [
|
33
33
|
{ 'ip' => '127.0.0.1', 'port' => 12111 }
|
34
34
|
],
|
35
|
-
'
|
35
|
+
'core_versions' => 'all',
|
36
36
|
'sxl' => 'tlc',
|
37
37
|
'sxl_version' => RSMP::Schema.latest_version(:tlc),
|
38
38
|
'intervals' => {
|
data/lib/rsmp/site_proxy.rb
CHANGED
@@ -48,7 +48,7 @@ module RSMP
|
|
48
48
|
def handshake_complete
|
49
49
|
super
|
50
50
|
sanitized_sxl_version = RSMP::Schema.sanitize_version(@site_sxl_version)
|
51
|
-
log "Connection to site #{@site_id} established, using core #{@
|
51
|
+
log "Connection to site #{@site_id} established, using core #{@core_version}, #{@sxl} #{sanitized_sxl_version}", level: :info
|
52
52
|
start_watchdog
|
53
53
|
end
|
54
54
|
|
@@ -89,7 +89,7 @@ module RSMP
|
|
89
89
|
log "Received Version message for site #{@site_id}", message: message, level: :log
|
90
90
|
start_timer
|
91
91
|
acknowledge message
|
92
|
-
send_version @site_id,
|
92
|
+
send_version @site_id, core_versions
|
93
93
|
@version_determined = true
|
94
94
|
end
|
95
95
|
|
data/lib/rsmp/supervisor.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
module RSMP
|
6
6
|
class Supervisor < Node
|
7
|
-
attr_reader :
|
7
|
+
attr_reader :core_versions, :site_id, :supervisor_settings, :proxies, :logger
|
8
8
|
|
9
9
|
def initialize options={}
|
10
10
|
handle_supervisor_settings( options[:supervisor_settings] || {} )
|
@@ -22,7 +22,7 @@ module RSMP
|
|
22
22
|
'port' => 12111,
|
23
23
|
'ips' => 'all',
|
24
24
|
'guest' => {
|
25
|
-
'
|
25
|
+
'core_versions' => 'all',
|
26
26
|
'sxl' => 'tlc',
|
27
27
|
'intervals' => {
|
28
28
|
'timer' => 1,
|
@@ -37,7 +37,7 @@ module RSMP
|
|
37
37
|
|
38
38
|
# merge options into defaults
|
39
39
|
@supervisor_settings = defaults.deep_merge(supervisor_settings)
|
40
|
-
@
|
40
|
+
@core_versions = @supervisor_settings["guest"]["core_versions"]
|
41
41
|
check_site_sxl_types
|
42
42
|
end
|
43
43
|
|
@@ -185,8 +185,8 @@ module RSMP
|
|
185
185
|
end
|
186
186
|
|
187
187
|
proxy.setup_site_settings
|
188
|
-
proxy.
|
189
|
-
log "Validating using core version #{proxy.
|
188
|
+
proxy.check_core_version version_message
|
189
|
+
log "Validating using core version #{proxy.core_version}", level: :debug
|
190
190
|
|
191
191
|
proxy.start # will run until the site disconnects
|
192
192
|
proxy.wait
|
@@ -43,7 +43,7 @@ module RSMP
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def start_handshake
|
46
|
-
send_version @site_settings['site_id'], @site_settings["
|
46
|
+
send_version @site_settings['site_id'], @site_settings["core_versions"]
|
47
47
|
end
|
48
48
|
|
49
49
|
# connect to the supervisor and initiate handshake supervisor
|
@@ -83,7 +83,7 @@ module RSMP
|
|
83
83
|
|
84
84
|
def handshake_complete
|
85
85
|
sanitized_sxl_version = RSMP::Schema.sanitize_version(sxl_version)
|
86
|
-
log "Connection to supervisor established, using core #{@
|
86
|
+
log "Connection to supervisor established, using core #{@core_version}, #{sxl} #{sanitized_sxl_version}", level: :info
|
87
87
|
set_state :ready
|
88
88
|
start_watchdog
|
89
89
|
if @site_settings['send_after_connect']
|
@@ -155,7 +155,7 @@ module RSMP
|
|
155
155
|
end
|
156
156
|
|
157
157
|
def version_accepted message
|
158
|
-
log "Received Version message, using RSMP #{@
|
158
|
+
log "Received Version message, using RSMP #{@core_version}", message: message, level: :log
|
159
159
|
start_timer
|
160
160
|
acknowledge message
|
161
161
|
@version_determined = true
|
@@ -440,7 +440,7 @@ module RSMP
|
|
440
440
|
|
441
441
|
def process_version message
|
442
442
|
return extraneous_version message if @version_determined
|
443
|
-
|
443
|
+
check_core_version message
|
444
444
|
check_sxl_version message
|
445
445
|
@site_id = Supervisor.build_id_from_ip_port @ip, @port
|
446
446
|
version_accepted message
|
data/lib/rsmp/version.rb
CHANGED
data/rsmp.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency "async-io", "~> 1.33.0"
|
35
35
|
spec.add_dependency "colorize", "~> 0.8.1"
|
36
36
|
spec.add_dependency "thor", "~> 1.2.1"
|
37
|
-
spec.add_dependency "rsmp_schema", "~> 0.
|
37
|
+
spec.add_dependency "rsmp_schema", "~> 0.4.0"
|
38
38
|
|
39
39
|
spec.add_development_dependency "bundler", "~> 2.3.7"
|
40
40
|
spec.add_development_dependency "rake", "~> 13.0.6"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsmp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Tin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.4.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: 0.
|
82
|
+
version: 0.4.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|