1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Feature #1073: Add support for mysql and posgresql in oZones server

This commit is contained in:
Tino Vazquez 2012-03-01 18:55:42 +01:00
parent deb5e8d025
commit f50df547e8
2 changed files with 15 additions and 1 deletions

View File

@ -23,6 +23,7 @@
######################
:databasetype: sqlite
#:databaseserver: dbuser:dbpassword@localhost
#:htaccess: /var/www/.htaccess
:dbdebug: no

View File

@ -57,7 +57,20 @@ config=YAML::load(config_data)
db_type = config[:databasetype]
db_url = db_type + "://" + VAR_LOCATION + "/ozones.db"
case db_type
when "sqlite" then
db_url = db_type + "://" + VAR_LOCATION + "/ozones.db"
when "mysql","postgres" then
if config[:databaseserver].nil?
warn "DB server needed for this type of DB backend"
exit -1
end
db_url = db_type + "://" + config[:databaseserver] + "/ozones"
else
warn "DB type #{db_type} not recognized"
exit -1
end
##############################################################################
# DB bootstrapping