Commit a76d41f2 authored by Lucas Nussbaum's avatar Lucas Nussbaum
Browse files

gen/oar-properties: fix DO=exec

parent f77255da
Pipeline #50900 passed with stages
in 1 minute and 31 seconds
......@@ -125,7 +125,7 @@ namespace :gen do
exit(ret)
end
desc "Generate OAR properties -- parameters: [SITE={grenoble,...}] [CLUSTER={yeti,...}] [NODE={dahu-1,...}] DO={print,exec,diff,check} [VERBOSE={0,1,2,3}]"
desc "Generate OAR properties -- parameters: [SITE={grenoble,...}] [CLUSTER={yeti,...}] [NODE={dahu-1,...}] DO={output,exec,diff,check} [VERBOSE={0,1,2,3}]"
task "oar-properties" do
require 'refrepo/gen/oar-properties'
options = {}
......@@ -144,7 +144,7 @@ namespace :gen do
ENV['DO'].split(',').each do |t|
options[:diff] = true if t == 'diff'
options[:output] = true if t == 'output'
options[:exec] = true if t == 'update'
options[:exec] = true if t == 'exec'
if t == 'check'
options[:diff] = true # check requires diff
options[:check] = true
......
......@@ -2,6 +2,7 @@
require 'hashdiff'
require 'refrepo/data_loader'
require 'net/ssh'
class MissingProperty < StandardError; end
......@@ -528,7 +529,7 @@ end
def ssh_exec(site_uid, cmds, options)
# The following is equivalent to : "cat cmds | bash"
#res = ""
c = Net::SSH.start(options[:ssh][:host].gsub("%s", site_uid), options[:ssh][:user], options[:ssh][:params])
c = Net::SSH.start("oar.#{site_uid}.g5kadmin", "g5kadmin")
c.open_channel { |channel|
channel.exec('sudo bash') { |ch, success|
# stdout
......
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