diff --git a/.gitignore b/.gitignore index 4e65e68a1..bb5270ff8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ /spec/reports/ /tmp/ **/.vagrant +Gemfile.lock +gems.locked diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 9c4ac185c..000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,161 +0,0 @@ -PATH - remote: . - specs: - pharos-cluster (2.2.1) - bcrypt (~> 3.1) - bcrypt_pbkdf (~> 1.0) - clamp (= 1.2.1) - dry-logic (= 0.4.2) - dry-struct (= 0.5.0) - dry-types (= 0.13.2) - dry-validation (= 0.12.1) - ed25519 (~> 1.2) - excon (~> 0.62.0) - fugit (~> 1.1.2) - k8s-client (~> 0.8.1) - net-ssh (= 5.1.0) - net-ssh-gateway (= 2.0.0) - pastel (~> 0.7) - rouge (~> 3.1) - tty-prompt (~> 0.16) - yaml-safe_load_stream (~> 0.1) - -GEM - remote: https://rubygems.org/ - specs: - ast (2.4.0) - bcrypt (3.1.12) - bcrypt_pbkdf (1.0.0) - clamp (1.2.1) - concurrent-ruby (1.1.4) - diff-lcs (1.3) - dry-configurable (0.8.1) - concurrent-ruby (~> 1.0) - dry-core (~> 0.4, >= 0.4.7) - dry-container (0.7.0) - concurrent-ruby (~> 1.0) - dry-configurable (~> 0.1, >= 0.1.3) - dry-core (0.4.7) - concurrent-ruby (~> 1.0) - dry-equalizer (0.2.1) - dry-inflector (0.1.2) - dry-logic (0.4.2) - dry-container (~> 0.2, >= 0.2.6) - dry-core (~> 0.2) - dry-equalizer (~> 0.2) - dry-struct (0.5.0) - dry-core (~> 0.4, >= 0.4.3) - dry-equalizer (~> 0.2) - dry-types (~> 0.13) - ice_nine (~> 0.11) - dry-types (0.13.2) - concurrent-ruby (~> 1.0) - dry-container (~> 0.3) - dry-core (~> 0.4, >= 0.4.4) - dry-equalizer (~> 0.2) - dry-inflector (~> 0.1, >= 0.1.2) - dry-logic (~> 0.4, >= 0.4.2) - dry-validation (0.12.1) - concurrent-ruby (~> 1.0) - dry-configurable (~> 0.1, >= 0.1.3) - dry-core (~> 0.2, >= 0.2.1) - dry-equalizer (~> 0.2) - dry-logic (~> 0.4, >= 0.4.0) - dry-types (~> 0.13.1) - ed25519 (1.2.4) - equatable (0.5.0) - et-orbi (1.1.7) - tzinfo - excon (0.62.0) - fakefs (0.18.0) - fugit (1.1.8) - et-orbi (~> 1.1, >= 1.1.7) - raabro (~> 1.1) - hashdiff (0.3.8) - ice_nine (0.11.2) - jaro_winkler (1.5.1) - jsonpath (0.9.9) - multi_json - to_regexp (~> 0.2.1) - k8s-client (0.8.2) - dry-struct (~> 0.5.0) - excon (~> 0.62.0) - hashdiff (~> 0.3.7) - jsonpath (~> 0.9.5) - recursive-open-struct (~> 1.1.0) - yajl-ruby (~> 1.4.0) - yaml-safe_load_stream (~> 0.1) - multi_json (1.13.1) - necromancer (0.4.0) - net-ssh (5.1.0) - net-ssh-gateway (2.0.0) - net-ssh (>= 4.0.0) - parallel (1.12.1) - parser (2.5.1.2) - ast (~> 2.4.0) - pastel (0.7.2) - equatable (~> 0.5.0) - tty-color (~> 0.4.0) - powerpack (0.1.2) - raabro (1.1.6) - rainbow (3.0.0) - rake (10.5.0) - recursive-open-struct (1.1.0) - rouge (3.3.0) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.0) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.0) - rubocop (0.58.2) - jaro_winkler (~> 1.5.1) - parallel (~> 1.10) - parser (>= 2.5, != 2.5.1.1) - powerpack (~> 0.1) - rainbow (>= 2.2.2, < 4.0) - ruby-progressbar (~> 1.7) - unicode-display_width (~> 1.0, >= 1.0.1) - ruby-progressbar (1.10.0) - timers (4.3.0) - to_regexp (0.2.1) - tty-color (0.4.3) - tty-cursor (0.6.0) - tty-prompt (0.18.1) - necromancer (~> 0.4.0) - pastel (~> 0.7.0) - timers (~> 4.0) - tty-cursor (~> 0.6.0) - tty-reader (~> 0.5.0) - tty-reader (0.5.0) - tty-cursor (~> 0.6.0) - tty-screen (~> 0.6.4) - wisper (~> 2.0.0) - tty-screen (0.6.5) - tzinfo (2.0.0) - concurrent-ruby (~> 1.0) - unicode-display_width (1.4.0) - wisper (2.0.0) - yajl-ruby (1.4.1) - yaml-safe_load_stream (0.1.1) - -PLATFORMS - ruby - -DEPENDENCIES - bundler (>= 1.17.2, <= 3.0) - fakefs (~> 0.13) - pharos-cluster! - rake (~> 10.0) - rspec (~> 3.7) - rubocop (~> 0.57) - -BUNDLED WITH - 1.17.2 diff --git a/lib/pharos/configuration/route.rb b/lib/pharos/configuration/route.rb index ae7357396..203099745 100644 --- a/lib/pharos/configuration/route.rb +++ b/lib/pharos/configuration/route.rb @@ -5,7 +5,7 @@ module Pharos module Configuration class Route < Pharos::Configuration::Struct - ROUTE_REGEXP = %r(^((?\S+)\s+)?(?default|[0-9./]+)(\s+via (?\S+))?(\s+dev (?\S+))?(\s+proto (?\S+))?(\s+(?.+))?$) + ROUTE_REGEXP = %r(^((?\S+)\s+)?(?default|[0-9./]+)(\s+via (?\S+))?(\s+dev (?\S+))?(\s+proto (?\S+))?(\s+(?.+))?$).freeze # @param line [String] # @return [Pharos::Configuration::Route] diff --git a/lib/pharos/transport/command/result.rb b/lib/pharos/transport/command/result.rb index a241fba77..90309dca6 100644 --- a/lib/pharos/transport/command/result.rb +++ b/lib/pharos/transport/command/result.rb @@ -131,6 +131,7 @@ def synchronize(&block) def initialize_debug return if ENV['DEBUG'].to_s.empty? + @debug_prefix = " #{"#{hostname}:".dim} " end end diff --git a/lib/pharos/transport/ssh.rb b/lib/pharos/transport/ssh.rb index fee2f60c5..17509e07f 100644 --- a/lib/pharos/transport/ssh.rb +++ b/lib/pharos/transport/ssh.rb @@ -39,6 +39,7 @@ def connect(**options) rescue *RETRY_CONNECTION_ERRORS => exc logger.debug { "Received #{exc.class.name} : #{exc.message} when connecting to bastion host #{bastion.user}@#{bastion.host}" } raise if gw_opts[:non_interactive] == false || !$stdin.tty? # don't re-retry + logger.debug { "Retrying in interactive mode" } gw_opts[:non_interactive] = false retry @@ -51,6 +52,7 @@ def connect(**options) rescue *RETRY_CONNECTION_ERRORS => exc logger.debug { "Received #{exc.class.name} : #{exc.message} when connecting to #{@user}@#{@host}" } raise if non_interactive == false || !$stdin.tty? # don't re-retry + logger.debug { "Retrying in interactive mode" } non_interactive = false retry diff --git a/pharos-cluster.gemspec b/pharos-cluster.gemspec index f26188020..92e0f795c 100644 --- a/pharos-cluster.gemspec +++ b/pharos-cluster.gemspec @@ -49,4 +49,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "rspec", "~> 3.7" spec.add_development_dependency "fakefs", "~> 0.13" spec.add_development_dependency "rubocop", "~> 0.57" + spec.add_development_dependency "pry-byebug", "~> 3.6" end