mux_tf 0.14.2 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69ba3f3800b5025923625f5c71be014ea5f2689d7bef6a6c309453ba8c77d37e
4
- data.tar.gz: 64b7341a04b36e4daed8f63a4fca12e9a966d73269831ebb82faebfee4f4ee55
3
+ metadata.gz: 5eb20c09b5f5f2fcccfc4ed93018fe52ec1aaf75f5e60981fd0eff0bba895466
4
+ data.tar.gz: 8122a0889cf0da6fa0e237ab94ecac94920daf4f863a218dba8df9bf0cfcc5a1
5
5
  SHA512:
6
- metadata.gz: 8836967a52fb32c981eee5e84945e4ac3c20873f2a3e11af1137bd7442f7631464a37713cd1621571a6fbceba6e35efb9984ae9ec0e2257b91ee263044105a66
7
- data.tar.gz: 5da9f6af5c83cc977c343650078cb27753ca6feeb82148d0662b3c9e7430a683547deda1a0c6411255c622664dbdb6d13a649d2fb91434eb3c2d3dd849fe69fe
6
+ metadata.gz: 020b9f50b507c0f91b6b64bcfbf027010d3a39de8e47829e5fb9dc0407af2e0c850c7fc1942b23e64febf603e028c608d2f0ce86324a7bac410c4c05cfddeea6
7
+ data.tar.gz: aacb58be2f7c86984354d1aad771b898eb7f6979a25df2465448233730ad7db5178914e5b76add063de42536b2358e4c2ef8c4b763819158f079a41d349f2671
@@ -162,6 +162,14 @@ module MuxTf
162
162
  log wrap_log["-" * 40, color: :red]
163
163
  return [false, results]
164
164
  end
165
+ if remedies.delete? :auth
166
+ remedy = :auth
167
+ log wrap_log["auth error encountered!", color: :red]
168
+ log wrap_log["-" * 40, color: :red]
169
+ log wrap_log["!! Auth Error, Please fix the issue and try again", color: :red]
170
+ log wrap_log["-" * 40, color: :red]
171
+ return [false, results]
172
+ end
165
173
 
166
174
  # if there is warnings, but no other remedies .. then we assume all is ok
167
175
  return [true, results] if remedies.delete?(:user_warning) && remedies.empty?
@@ -412,6 +420,7 @@ module MuxTf
412
420
  remedies << :plan if error[:message].include?("timeout while waiting for plugin to start")
413
421
  end
414
422
  remedies << :unlock if lock_error?(meta)
423
+ remedies << :auth if meta[:need_auth]
415
424
  remedies
416
425
  end
417
426
 
@@ -443,6 +452,8 @@ module MuxTf
443
452
  throw :abort, [plan_status, meta]
444
453
  end
445
454
 
455
+ throw :abort, [plan_status, meta] if remedies.include?(:auth)
456
+
446
457
  [remedies, plan_status, meta]
447
458
  }
448
459
 
@@ -396,6 +396,9 @@ module MuxTf
396
396
  when :none
397
397
  if line.blank?
398
398
  # nothing
399
+ elsif raw_line.match(/Error when retrieving token from sso/) || raw_line.match(/Error loading SSO Token/)
400
+ meta[:need_auth] = true
401
+ log pastel.red("authentication problem"), depth: 2
399
402
  else
400
403
  log_unhandled_line(state, line, reason: "unexpected non blank line in :none state")
401
404
  end
@@ -470,6 +473,7 @@ module MuxTf
470
473
  remedies = Set.new
471
474
  if status != 0
472
475
  remedies << :reconfigure if meta[:need_reconfigure]
476
+ remedies << :auth if meta[:need_auth]
473
477
  log "!! expected meta[:errors] to be set, how did we get here?" unless meta[:errors]
474
478
  if meta[:errors]
475
479
  meta[:errors].each do |error|
@@ -544,10 +548,12 @@ module MuxTf
544
548
  parser.state(:backend, /^Initializing the backend\.\.\./, [:none, :modules_init, :modules_upgrade])
545
549
  parser.state(:plugins, /^Initializing provider plugins\.\.\./, [:backend, :modules_init])
546
550
 
551
+ parser.state(:backend_error, /Error when retrieving token from sso/, [:backend])
552
+
547
553
  parser.state(:plugin_warnings, /^$/, [:plugins])
548
554
  parser.state(:backend_error, /Error:/, [:backend])
549
555
 
550
- setup_error_handling(parser, from_states: [:plugins])
556
+ setup_error_handling(parser, from_states: [:plugins, :modules_init])
551
557
 
552
558
  status = tf_init(upgrade: upgrade, reconfigure: reconfigure) { |raw_line|
553
559
  stripped_line = pastel.strip(raw_line.rstrip)
@@ -613,6 +619,10 @@ module MuxTf
613
619
  meta[:need_reconfigure] = true
614
620
  log pastel.red("module needs to be reconfigured"), depth: 2
615
621
  end
622
+ if raw_line.match "Error when retrieving token from sso"
623
+ meta[:need_auth] = true
624
+ log pastel.red("authentication problem"), depth: 2
625
+ end
616
626
  when :plugins
617
627
  if phase != state
618
628
  # first line
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuxTf
4
- VERSION = "0.14.2"
4
+ VERSION = "0.15.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mux_tf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.2
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Banasik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-08 00:00:00.000000000 Z
11
+ date: 2024-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport