rsmp 0.42.0 → 0.42.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e00101c429f0533a6f979cbd9b23ce7cb37d30283fe71766916aab6d7634115a
4
- data.tar.gz: b5bc3b782f93caf825ca8a7add57e5d1e1c09b08d9bc9bab4ebeba337707db22
3
+ metadata.gz: 49c61e299fa55246bbee0c3c0bbd28f294dc652fdcb754020292738bdd4b7e2f
4
+ data.tar.gz: 688d17de1f51cfd5a82b7c71b4d49db20365fdace976d481eaae93973400edd1
5
5
  SHA512:
6
- metadata.gz: e0ee7eb5a3df9aa770e26625dce129b114176fee2ed671503dfdecb590839a9aff264599ebd2201f07339cab3295dfa08c6476cf27a91baef18277bc5fd3e352
7
- data.tar.gz: 148b2eefca4411bf7262446632d407617b00f9ea17e8f0a0c427aeba48eb857c4292936b8474e0108c1a8d23841c10320eb4a6dc0c17c5a940c78a9fd91082eb
6
+ metadata.gz: 981237d8987c178ef8a9bca82ad3c6735553bc04165680da82b4b60cef9f40db4349db5ab9faa7fd10612516796e1ea33759e12578d6e0a165b4d0c3a36666d8
7
+ data.tar.gz: 2a0832841d760be46b2d507b391726734a1036dc191545c33f380fd27a3f4cce58e78272067ffaa51aebd97333c495b8624122055b0f89bef9df80df15f37b53
data/.rubocop.yml CHANGED
@@ -40,6 +40,7 @@ Metrics/ParameterLists:
40
40
  # Allow some blocks to be longer for complex configurations and tests
41
41
  Metrics/BlockLength:
42
42
  Exclude:
43
+ - 'test/**/*'
43
44
  - 'test/**/*'
44
45
  - 'features/**/*'
45
46
  - '*.gemspec'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.42.0)
4
+ rsmp (0.42.2)
5
5
  async (~> 2.32)
6
6
  colorize (~> 1.1)
7
7
  io-endpoint (~> 0.15)
@@ -121,7 +121,7 @@ GEM
121
121
  rubocop (>= 1.72.1)
122
122
  ruby-progressbar (1.13.0)
123
123
  simpleidn (0.2.3)
124
- sus (0.35.2)
124
+ sus (0.36.0)
125
125
  sus-fixtures-async (0.2.0)
126
126
  async
127
127
  sus (~> 0.10)
data/lib/rsmp/cli.rb CHANGED
@@ -86,7 +86,8 @@ module RSMP
86
86
 
87
87
  def apply_basic_site_options(settings)
88
88
  settings['site_id'] = options[:id] if options[:id]
89
- settings['core_version'] = options[:core] if options[:core]
89
+ settings['core_version'] = options[:core] || ENV['CORE_VERSION'] if options[:core] || ENV['CORE_VERSION']
90
+ settings['sxl_version'] = ENV['SXL_VERSION'] if ENV['SXL_VERSION']
90
91
  end
91
92
 
92
93
  def parse_supervisors(settings)
@@ -50,8 +50,7 @@ module RSMP
50
50
 
51
51
  def handshake_complete
52
52
  super
53
- sanitized_sxl_version = RSMP::Schema.sanitize_version(@site_sxl_version)
54
- log "Connection to site #{@site_id} established, using core #{@core_version}, #{@sxl} #{sanitized_sxl_version}",
53
+ log "Connection to site #{@site_id} established, using core #{@core_version}, #{@sxl} #{@site_sxl_version}",
55
54
  level: :info
56
55
  start_watchdog
57
56
  end
@@ -126,12 +125,12 @@ module RSMP
126
125
  # note that the type comes from the site config, while the version
127
126
  # comes from the Version message send by the site
128
127
  type = @site_settings['sxl']
129
- version = message.attribute 'SXL'
130
- RSMP::Schema.find_schema! type, version, lenient: true
128
+ version = RSMP::Schema.sanitize_version(message.attribute('SXL'))
129
+ RSMP::Schema.find_schema! type, version
131
130
 
132
- # store sxl version requested by site
131
+ # store sanitized sxl version requested by site
133
132
  # TODO should check agaist site settings
134
- @site_sxl_version = message.attribute 'SXL'
133
+ @site_sxl_version = version
135
134
  rescue RSMP::Schema::UnknownSchemaError => e
136
135
  dont_acknowledge message, "Rejected #{message.type} message,", e.to_s
137
136
  end
@@ -196,8 +196,8 @@ module RSMP
196
196
 
197
197
  # S0006 - Emergency route status (deprecated, use S0035)
198
198
  def handle_s0006(_status_code, status_name = nil, options = {})
199
- if Proxy.version_meets_requirement? options[:sxl_version],
200
- '>=1.2.0'
199
+ if RSMP::Proxy.version_meets_requirement? options[:sxl_version],
200
+ '>=1.2.0'
201
201
  log 'S0006 is depreciated, use S0035 instead.',
202
202
  level: :warning
203
203
  end
@@ -63,22 +63,36 @@ module RSMP
63
63
  end
64
64
 
65
65
  # S0091 - Operator logged in/out OP-panel
66
- def handle_s0091(_status_code, status_name = nil, _options = {})
67
- case status_name
68
- when 'user'
69
- TrafficControllerSite.make_status 0
70
- when 'username'
71
- TrafficControllerSite.make_status ''
66
+ def handle_s0091(_status_code, status_name = nil, options = {})
67
+ if RSMP::Proxy.version_meets_requirement?(options[:sxl_version], '>=1.1')
68
+ case status_name
69
+ when 'user'
70
+ TrafficControllerSite.make_status 0
71
+ end
72
+ else
73
+ case status_name
74
+ when 'user'
75
+ TrafficControllerSite.make_status 'nobody'
76
+ when 'status'
77
+ TrafficControllerSite.make_status 'logout'
78
+ end
72
79
  end
73
80
  end
74
81
 
75
82
  # S0092 - Operator logged in/out web-interface
76
- def handle_s0092(_status_code, status_name = nil, _options = {})
77
- case status_name
78
- when 'user'
79
- TrafficControllerSite.make_status 0
80
- when 'username'
81
- TrafficControllerSite.make_status ''
83
+ def handle_s0092(_status_code, status_name = nil, options = {})
84
+ if RSMP::Proxy.version_meets_requirement?(options[:sxl_version], '>=1.1')
85
+ case status_name
86
+ when 'user'
87
+ TrafficControllerSite.make_status 0
88
+ end
89
+ else
90
+ case status_name
91
+ when 'user'
92
+ TrafficControllerSite.make_status 'nobody'
93
+ when 'status'
94
+ TrafficControllerSite.make_status 'logout'
95
+ end
82
96
  end
83
97
  end
84
98
 
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = '0.42.0'.freeze
2
+ VERSION = '0.42.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.42.0
4
+ version: 0.42.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin