From e926916097d0331174119a88166b7e8856108257 Mon Sep 17 00:00:00 2001 From: Jonathan Pastor <jonathancmoa@gmail.com> Date: Mon, 4 Nov 2019 18:03:11 +0100 Subject: [PATCH] [DIFF] show empty character when null value is expected by generator --- lib/refrepo/gen/oar-properties.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/refrepo/gen/oar-properties.rb b/lib/refrepo/gen/oar-properties.rb index 2697b14dd49..02a0f1db0a2 100644 --- a/lib/refrepo/gen/oar-properties.rb +++ b/lib/refrepo/gen/oar-properties.rb @@ -958,8 +958,12 @@ def do_diff(options, generated_hierarchy, refrepo_properties) {:cpu => "cpu", :core => "core", :cpuset => "cpuset", :gpu => "gpu", :gpudevice => "gpudevice"}.each do |key, value| if row[key].to_s != corresponding_resource[0][value].to_s and not (key == :gpu and row[key].nil? and corresponding_resource[0][value] == 0) + expected_value = row[key] + if expected_value == "" + expected_value = "ΓΈ" + end fix_cmd = <<-TXT -# Error: Resource #{resc["id"]} (host=#{resc["network_address"]} cpu=#{resc["cpu"]} core=#{resc["core"]} cpuset=#{resc["cpuset"]} gpu=#{resc["gpu"]} gpudevice=#{resc["gpudevice"]}) has a mismatch for ressource #{value.upcase}: API gives #{resc[value]}, generator wants #{row[key]}. +# Error: Resource #{resc["id"]} (host=#{resc["network_address"]} cpu=#{resc["cpu"]} core=#{resc["core"]} cpuset=#{resc["cpuset"]} gpu=#{resc["gpu"]} gpudevice=#{resc["gpudevice"]}) has a mismatch for ressource #{value.upcase}: OAR API gives #{resc[value]}, generator wants #{expected_value}. TXT fix_cmds += "#{fix_cmd}" end -- GitLab