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:
parent
e416eef12f
commit
dfa6379090
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user