Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 970666b0 authored by Samir Noir's avatar Samir Noir :cheese:
Browse files

[lib] add postinstall version and forced-deployment-timestamp on each

nodes
parent 73d3345d
No related branches found
No related tags found
1 merge request!94add softwares versions
---
software:
postinstall-version: '1.2020040200'
forced-deployment-timestamp: 202004151110
......@@ -112,6 +112,9 @@ def generate_reference_api
# remove kavlan information for now
global_hash.delete('vlans')
# also remove software info
global_hash.delete('software')
# also remove ipv6 info
global_hash.delete('ipv6')
......
......@@ -5,14 +5,14 @@ require 'refrepo/hash/hash'
def load_yaml_file_hierarchy(directory = File.expand_path("../../input/grid5000/", File.dirname(__FILE__)))
global_hash = {} # the global data structure
Dir.chdir(directory) {
# Recursively list the .yaml files.
# The order in which the results are returned depends on the system (http://ruby-doc.org/core-2.2.3/Dir.html).
# => List deepest files first as they have lowest priority when hash keys are duplicated.
list_of_yaml_files = Dir['**/*.y*ml', '**/*.y*ml.erb'].sort_by { |x| -x.count('/') }
list_of_yaml_files.each { |filename|
begin
# Load YAML
......@@ -54,6 +54,9 @@ def load_yaml_file_hierarchy(directory = File.expand_path("../../input/grid5000/
add_kavlan_ips(global_hash)
add_kavlan_ipv6s(global_hash)
# populate each node with software informations
add_software(global_hash)
return global_hash
end
......@@ -175,3 +178,15 @@ def add_kavlan_ipv6s(h)
end
end
end
def add_software(h)
# for each node
h['sites'].each_pair do |site_uid, hs|
hs['clusters'].each_pair do |cluster_uid, hc|
hc['nodes'].each_pair do |node_uid, hn|
hn['software']['postinstall-version'] = h['software']['postinstall-version']
hn['software']['forced-deployment-timestamp'] = h['software']['forced-deployment-timestamp']
end
end
end
end
......@@ -3,4 +3,5 @@ sites: required_hash
network_equipments: optional_hash
vlans: required_hash
ipv6: required_hash
software: required_hash
disk_vendor_model_mapping: required_hash
......@@ -98,6 +98,8 @@ processor:
sensors: optional_hash
software:
standard-environment: string
postinstall-version: string
forced-deployment-timestamp: integer
status: optional_string
storage_devices:
<multi>:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment