1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

Bug #847: Change authentication conf files for serveradmin to VAR_LOCATION/.one

This commit is contained in:
Carlos Martín 2011-10-28 12:50:36 +02:00
parent e416eef12f
commit dfa6379090
5 changed files with 17 additions and 11 deletions

View File

@ -32,7 +32,7 @@ else
end
VIEWS_LOCATION = RUBY_LIB_LOCATION + "/cloud/econe/views"
EC2_AUTH = VAR_LOCATION + "/ec2_auth"
EC2_AUTH = VAR_LOCATION + "/.one/ec2_auth"
$: << RUBY_LIB_LOCATION
$: << RUBY_LIB_LOCATION+"/cloud"

View File

@ -36,7 +36,7 @@ else
CONFIGURATION_FILE = ONE_LOCATION+"/etc/occi-server.conf"
end
OCCI_AUTH = VAR_LOCATION + "/occi_auth"
OCCI_AUTH = VAR_LOCATION + "/.one/occi_auth"
$: << RUBY_LIB_LOCATION
$: << RUBY_LIB_LOCATION+"/cloud/occi"

View File

@ -191,21 +191,25 @@ module Migrator
new_auth = "#{username}:#{pass}\n"
begin
dir = "#{VAR_LOCATION}/.one"
if ( !File.directory?(dir) )
Dir.mkdir(dir, 0700)
end
["sunstone_auth", "occi_auth", "ec2_auth"].each { |name|
File.open("#{VAR_LOCATION}/#{name}", 'w') {|f|
File.open("#{dir}/#{name}", 'w', 0600) {|f|
f.write(new_auth)
}
}
rescue
puts "Error trying to create new configuration files in #{VAR_LOCATION}"
puts "Error trying to create new configuration files in #{dir}"
return false
end
puts " > New user '#{username}' created "<<
"for Sunstone and public servers operation.\n"<<
" You will need to create some configuration files "<<
"before Sunstone, OCCI or EC2 are "<<
"started.\n Visit\n"<<
" You have three new authentication files in #{dir}.\n"<<
" For more information, visit\n"<<
" http://opennebula.org/documentation:rel3.2:upgrade"
end

View File

@ -31,7 +31,7 @@ else
RUBY_LIB_LOCATION = ONE_LOCATION+"/lib/ruby"
end
SUNSTONE_AUTH = VAR_LOCATION + "/sunstone_auth"
SUNSTONE_AUTH = VAR_LOCATION + "/.one/sunstone_auth"
CONFIGURATION_FILE = ETC_LOCATION + "/sunstone-server.conf"
PLUGIN_CONFIGURATION_FILE = ETC_LOCATION + "/sunstone-plugins.yaml"

View File

@ -132,9 +132,11 @@ UserPool::UserPool(SqlDB * db,
random = SSLTools::sha1_digest( sstr.str() );
filenames[0] = nd.get_var_location() + "/sunstone_auth";
filenames[1] = nd.get_var_location() + "/occi_auth";
filenames[2] = nd.get_var_location() + "/ec2_auth";
filenames[0] = nd.get_var_location() + "/.one/sunstone_auth";
filenames[1] = nd.get_var_location() + "/.one/occi_auth";
filenames[2] = nd.get_var_location() + "/.one/ec2_auth";
mkdir(string(nd.get_var_location() + "/.one").c_str(), S_IRWXU);
for (i=0 ; i < 3; i++)
{