Skip to content

Commit

Permalink
Merge pull request #17769 from mkanoor/add_codename
Browse files Browse the repository at this point in the history
Add codename in log file and stdout
  • Loading branch information
Fryguy authored Aug 9, 2018
2 parents 6439a45 + 67ebcd4 commit 19e608c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ class Application < Rails::Application
config.after_initialize do
Vmdb::Initializer.init
ActiveRecord::Base.connection_pool.release_connection
puts "** #{Vmdb::Appliance.BANNER}"
end

console do
Expand Down
9 changes: 9 additions & 0 deletions lib/vmdb/appliance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ def self.BUILD
@EVM_BUILD ||= get_build
end

def self.CODENAME
"Hammer".freeze
end

def self.BANNER
"#{self.PRODUCT_NAME} #{self.VERSION}, codename: #{self.CODENAME}"
end

def self.BUILD_NUMBER
@EVM_BUILD_NUMBER ||= self.BUILD.nil? ? "N/A" : self.BUILD.split("-").last # Grab the build number after the last hyphen
end
Expand Down Expand Up @@ -39,6 +47,7 @@ def self.log_config(*args)

fh.info("Version: #{self.VERSION}")
fh.info("Build: #{self.BUILD}")
fh.info("Codename: #{self.CODENAME}")
fh.info("RUBY Environment: #{Object.const_defined?(:RUBY_DESCRIPTION) ? RUBY_DESCRIPTION : "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE} patchlevel #{RUBY_PATCHLEVEL}) [#{RUBY_PLATFORM}]"}")
fh.info("RAILS Environment: #{Rails.env} version #{Rails.version}")

Expand Down

0 comments on commit 19e608c

Please sign in to comment.