Commit 2134b406 authored by Samir Noir's avatar Samir Noir 🧀
Browse files

Merge branch 'bugs/#12478' into 'master'

Add missing workdir parameter when calling OAR's API

See merge request !82
parents 9d0adc42 ff0fea02
Pipeline #189955 waiting for manual action with stages
in 21 minutes and 49 seconds
......@@ -27,7 +27,7 @@ module Grid5000
# OAR expects these as import-job-key-from-file
READ_ONLY_UNDERSCORE_ATTRIBUTES = [:import_job_key_from_file].freeze
READ_WRITE_ATTRIBUTES = %i[name project].freeze
READ_WRITE_ATTRIBUTES = %i[name project workdir].freeze
attr_reader(*READ_ONLY_ATTRIBUTES)
attr_reader(*READ_ONLY_UNDERSCORE_ATTRIBUTES)
attr_accessor(*READ_WRITE_ATTRIBUTES)
......@@ -61,6 +61,7 @@ module Grid5000
value = instance_variable_get "@#{integer_field}"
instance_variable_set "@#{integer_field}", value.to_i unless value.nil?
end
@workdir = @directory
@on_launch = {} if @on_launch.nil?
end
......@@ -75,7 +76,7 @@ module Grid5000
h['property'] = properties unless properties.nil? || properties.empty?
h['type'] = types unless types.nil? || types.empty?
%w[walltime queue directory name project signal checkpoint stderr stdout].each do |prop|
%w[walltime queue directory name project signal checkpoint stderr stdout workdir].each do |prop|
value = instance_variable_get "@#{prop}"
h[prop] = value unless value.nil?
end
......
......@@ -82,7 +82,8 @@ describe Grid5000::Job do
'command' => '',
'project' => 'default',
'properties' => "(deploy = 'YES') AND desktop_computing = 'NO'",
'state' => 'running'
'state' => 'running',
'workdir' => '/home/grenoble/rchakode'
})
end
it 'should export to a hash structure valid for submitting a job to the oarapi' do
......
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