Sha256: 93d603f2526af88367ede1d6b1171d132f1d6d2f1066d6653556b8a5957d7ee8

Contents?: true

Size: 631 Bytes

Versions: 11

Compression:

Stored size: 631 Bytes

Contents

require_relative 'aws/ec2_instance'

module Marty::Diagnostic; class Nodes < Base
  def self.generate
    pack do
      begin
        a_nodes = Aws::Ec2Instance.new.nodes.sort if
          Aws::Ec2Instance.is_aws?
      rescue => e
        a_nodes = [e.message]
      end
      pg_nodes = Node.get_nodes.sort
      a_nodes.nil? || pg_nodes == a_nodes ? pg_nodes.join("\n") :
        error("There is a discrepancy between nodes connected to "\
              "Postgres and those discovered through AWS EC2.\n"\
              "Postgres: \n#{pg_nodes.join("\n")}\n"\
              "AWS: \n#{a_nodes.join("\n")}")
    end
  end
end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
marty-1.2.9 other/marty/diagnostic/nodes.rb
marty-1.2.8 other/marty/diagnostic/nodes.rb
marty-1.2.7 other/marty/diagnostic/nodes.rb
marty-1.2.6 other/marty/diagnostic/nodes.rb
marty-1.2.5 other/marty/diagnostic/nodes.rb
marty-1.2.4 other/marty/diagnostic/nodes.rb
marty-1.2.3 other/marty/diagnostic/nodes.rb
marty-1.2.2 other/marty/diagnostic/nodes.rb
marty-1.2.1 app/models/marty/diagnostic/nodes.rb
marty-1.2.0 app/models/marty/diagnostic/nodes.rb
marty-1.1.9 app/models/marty/diagnostic/nodes.rb