From 109a64ec4538ce902a2a790c0d5a7ccf3028dcce Mon Sep 17 00:00:00 2001
From: David Loup <david.loup@inria.fr>
Date: Mon, 8 Jun 2020 10:17:49 +0200
Subject: [PATCH] Add exotic properties to oar generator and validator

---
 lib/refrepo/gen/oar-properties.rb   | 6 ++++++
 lib/refrepo/valid/oar-properties.rb | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/refrepo/gen/oar-properties.rb b/lib/refrepo/gen/oar-properties.rb
index 9a5862812af..5538d7c760e 100644
--- a/lib/refrepo/gen/oar-properties.rb
+++ b/lib/refrepo/gen/oar-properties.rb
@@ -463,6 +463,12 @@ def get_ref_node_properties_internal(cluster_uid, cluster, node_uid, node)
     h['gpu_count'] = 0
   end
 
+  if node.key?('exotic')
+    h['exotic'] = node['exotic']
+  else
+    h['exotic'] = false
+  end
+
   h['mic'] = if node['mic']
                'YES'
              else
diff --git a/lib/refrepo/valid/oar-properties.rb b/lib/refrepo/valid/oar-properties.rb
index 783293f4402..302d09a8209 100644
--- a/lib/refrepo/valid/oar-properties.rb
+++ b/lib/refrepo/valid/oar-properties.rb
@@ -7,7 +7,7 @@ require 'hashdiff'
 IGNORED_PROPERTIES=%w{}
 
 # Propriétés qui devraient être présentes
-G5K_PROPERTIES=%w{api_timestamp available_upto besteffort chassis chunks cluster cluster_priority comment core cpu cpuarch cpucore cpufreq cpuset cputype deploy desktop_computing disk disk_reservation_count diskpath disktype drain eth_count eth_rate expiry_date finaud_decision gpu gpudevice gpu_model gpu_count grub host ib ib_count ib_rate id ip last_available_upto last_job_date links maintenance max_walltime memcore memcpu memnode mic myri myri_count myri_rate network_address next_finaud_decision next_state nodemodel production rconsole scheduler_priority slash_16 slash_17 slash_18 slash_19 slash_20 slash_21 slash_22 state state_num subnet_address subnet_prefix suspended_jobs switch type virtual vlan wattmeter opa_count opa_rate}.sort - IGNORED_PROPERTIES
+G5K_PROPERTIES=%w{api_timestamp available_upto besteffort chassis chunks cluster cluster_priority comment core cpu cpuarch cpucore cpufreq cpuset cputype deploy desktop_computing disk disk_reservation_count diskpath disktype drain eth_count eth_rate exotic expiry_date finaud_decision gpu gpudevice gpu_model gpu_count grub host ib ib_count ib_rate id ip last_available_upto last_job_date links maintenance max_walltime memcore memcpu memnode mic myri myri_count myri_rate network_address next_finaud_decision next_state nodemodel production rconsole scheduler_priority slash_16 slash_17 slash_18 slash_19 slash_20 slash_21 slash_22 state state_num subnet_address subnet_prefix suspended_jobs switch type virtual vlan wattmeter opa_count opa_rate}.sort - IGNORED_PROPERTIES
 
 
 module RefRepo::Valid::OarProperties
-- 
GitLab