Skip to content

Commit

Permalink
removed candlepin version check from thin start script
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Strachota committed Feb 3, 2012
1 parent 947585f commit 0e2499e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
1 change: 0 additions & 1 deletion config/subsystems.yml

This file was deleted.

35 changes: 0 additions & 35 deletions script/thin
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,5 @@ if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
ARGV.shift
end

# Subsystem check
# We add the check after initialization, because Rspec runs its initail rails init in development mode
# but this file is not run as part of rspec
module Src
class Application < Rails::Application
config.after_initialize do

require 'resources/candlepin'
subsystems_file = "#{Rails.root}/config/subsystems.yml"
raise _("Unable to find config/subsystems.yml") unless File.exists? subsystems_file
subsystems = YAML::load_file(subsystems_file) || {}

begin
required_version = subsystems["candlepin"]
raise _("No version of candlepin specified") if required_version.nil?
cp_ping = Candlepin::CandlepinPing.ping
actual_version = "#{cp_ping[:version]}-#{cp_ping[:release]}"
actual_version.gsub!('%{?dist}','') #remove %{?dist}
raise _("Incorrect version , Expected #{required_version}, got #{actual_version}") if actual_version != required_version
rescue Exception => e
#print to console and the logs, extra newlines make it stand out
2.times do
78.times { print '*' }; puts '*'
end
puts Rails.logger.error _("\nWarning: #{e.message}\n\n")
puts "To suppress this message, edit subsystems.yml config file."
2.times do
78.times { print '*' }; puts '*'
end
end
end
end
end


gem 'thin', version
load Gem.bin_path('thin', 'thin', version)

0 comments on commit 0e2499e

Please sign in to comment.