Commit bef2184f authored by Pascal Morillon's avatar Pascal Morillon

[oar-properties] Allow create resources on custom OAR serveur, useful for testing OAR

parent 855e0d06
Pipeline #61772 failed with stages
in 54 seconds
......@@ -136,6 +136,10 @@ namespace :gen do
if ENV['NODE']
options[:nodes] = ENV['NODE'].split(',')
end
if ENV['OAR_SERVER']
options[:ssh] ||= {}
options[:ssh][:host] = ENV['OAR_SERVER']
end
options[:output] = false
options[:diff] = false
options[:exec] = false
......
......@@ -535,7 +535,7 @@ end
def ssh_exec(site_uid, cmds, _options)
# The following is equivalent to : "cat cmds | bash"
#res = ""
c = Net::SSH.start("oar.#{site_uid}.g5kadmin", "g5kadmin")
c = Net::SSH.start(_options[:ssh][:host], _options[:ssh][:user])
c.open_channel { |channel|
channel.exec('sudo bash') { |ch, success|
# stdout
......@@ -591,9 +591,9 @@ def generate_oar_properties(options)
conf = RefRepo::Utils.get_api_config
options[:api][:user] = conf['username']
options[:api][:pwd] = conf['password']
options[:ssh] = {}
options[:ssh] ||= {}
options[:ssh][:user] = 'g5kadmin'
options[:ssh][:host] = 'oar.%s.g5kadmin'
options[:ssh][:host] ||= 'oar.%s.g5kadmin'
ret = true
global_hash = load_data_hierarchy
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment