mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
Database parameter from configuration file is used in oca
git-svn-id: http://svn.opennebula.org/one/trunk@715 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
parent
3f4a3355aa
commit
98b0d7f40e
@ -19,20 +19,22 @@ require 'EC2'
|
||||
require 'time'
|
||||
|
||||
require 'OpenNebula'
|
||||
require 'repo_manager'
|
||||
#require 'repo_manager'
|
||||
require 'OcaConfiguration'
|
||||
|
||||
require 'pp'
|
||||
|
||||
include OpenNebula
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG=OcaConfiguration.new(CONF_LOCATION+'/oca.conf')
|
||||
AUTH="#{CONFIG[:user]}:#{CONFIG[:password]}"
|
||||
ONE_RM_DATABASE=CONFIG[:database]
|
||||
|
||||
# Load this gere to use ONE_RM_DATABASE form the configuration file
|
||||
require 'repo_manager'
|
||||
Image.image_dir=CONFIG[:image_dir]
|
||||
|
||||
|
||||
INSTANCE_TYPES=Hash.new
|
||||
|
||||
pp CONFIG
|
||||
|
@ -1,15 +1,17 @@
|
||||
|
||||
require 'rubygems'
|
||||
#require 'storage_pool'
|
||||
require 'uuid'
|
||||
require 'fileutils'
|
||||
#gem 'sequel', '< 3.0'
|
||||
require 'sequel'
|
||||
require 'logger'
|
||||
|
||||
# Seems that database should be opened before defining models
|
||||
# TODO: fix this
|
||||
DB=Sequel.sqlite('database.db')
|
||||
if ONE_RM_DATABASE
|
||||
DB=Sequel.sqlite(ONE_RM_DATABASE)
|
||||
else
|
||||
DB=Sequel.sqlite('database.db')
|
||||
end
|
||||
#DB.loggers << Logger.new($stdout)
|
||||
require 'image'
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user