Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 447f9f9f authored by Lucas Nussbaum's avatar Lucas Nussbaum
Browse files

Edit SSH host with site_uid, replacing %s (bug 10346)

parent 60068941
No related branches found
No related tags found
No related merge requests found
......@@ -532,10 +532,10 @@ def oarcmd_set_disk_properties(host, disk, disk_properties)
end
# sudo exec
def ssh_exec(cmds, options)
def ssh_exec(cmds, options, site_uid)
# The following is equivalent to : "cat cmds | bash"
#res = ""
c = Net::SSH.start(options[:ssh][:host], options[:ssh][:user])
c = Net::SSH.start(options[:ssh][:host].gsub('%s', site_uid), options[:ssh][:user])
c.open_channel { |channel|
channel.exec('sudo bash') { |ch, success|
# stdout
......@@ -802,7 +802,7 @@ def generate_oar_properties(options)
if options[:exec]
printf 'Apply changes to the OAR server ' + options[:ssh][:host].gsub('%s', site_uid) + ' ? (y/N) '
prompt = STDIN.gets.chomp
ssh_exec(ssh_cmd, options) if prompt.downcase == 'y'
ssh_exec(ssh_cmd, options, site_uid) if prompt.downcase == 'y'
end
end # site loop
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment