Project

General

Profile

« Previous | Next » 

Revision 41402094

Added by Ohad Levy about 12 years ago

  • ID 41402094cecccc9d9c5fd674befdfe74ee617a85

removed puppet from Gem file requirement

this commit also tries to simplify the way we use bundler, in future commits,
we should add more logic of which gems to load based on configration file.

View differences:

config/application.rb
require File.expand_path('../boot', __FILE__)
root = File.expand_path(File.dirname(__FILE__) + "/..")
require 'rails/all'
require 'puppet'
require 'puppet/rails'
# import settings file
SETTINGS= YAML.load_file("#{root}/config/settings.yaml")
SETTINGS[:version] = File.read(root + "/VERSION").chomp rescue("N/A")
SETTINGS[:unattended] = SETTINGS[:unattended].nil? || SETTINGS[:unattended]
Puppet[:config] = SETTINGS[:puppetconfdir] || "/etc/puppet/puppet.conf"
Puppet.parse_config
$puppet = Puppet.settings.instance_variable_get(:@values) if Rails.env == "test"
SETTINGS[:login] ||= SETTINGS[:ldap]
begin
if SETTINGS[:unattended]
Bundler.setup(:virt)
require 'virt'
SETTINGS[:libvirt] = true
else
SETTINGS[:libvirt] = false
end
rescue LoadError
Rails.logger.debug "Libvirt binding are missing - hypervisor management is disabled"
SETTINGS[:libvirt] = false
end
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
if defined?(Bundler)

Also available in: Unified diff