raiseMissingProperty,"Node #{node_uid} does not have a main network_adapter (ie. an ethernet interface with enabled=true && mounted==true && management==false)"unlessmain_network_adapter
[[ $(oarnodes --sql "host='$1' and type='disk' and disk=$2") ]]
}
EOF
end
defoarcmd_create_node(host,properties,node_hash)# host = grifffon-1.nancy.grid5000.fr; properties, node_hash: input of the reference API for the node
#return "# Cannot create #{host} : not enough information about it (node_hash['architecture']['nb_procs'], properties['cpucore'])" if node_hash['architecture'].nil? || properties['cpucore'].nil?
defoarcmd_separator
return"echo '"+'='*80+"'\n\n"
end
node_uid,site_uid,grid_uid=host.split(".")
cluster_uid,node_number=node_uid.split("-")
defoarcmd_create_properties(properties_keys)
command=''
properties_keys.eachdo|key,key_type|
ifkey_type==Fixnum
command+="oarproperty -a #{key} || true\n"
elsifkey_type==String
command+="oarproperty -a #{key} --varchar || true\n"
else
raise"Error: the type of the '#{key}' property is unknown (Integer/String). Cannot generate the corresponding 'oarproperty' command. You must create this property manually ('oarproperty -a #{key} [--varchar]')"