Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 66084c63 authored by Alexandre MERLIN's avatar Alexandre MERLIN
Browse files

Add group storage wiki generator

parent 069d716a
Pipeline #189606 passed with stages
in 6 minutes and 13 seconds
......@@ -7,6 +7,7 @@ require 'refrepo/gen/wiki/generators/oar_properties'
require 'refrepo/gen/wiki/generators/site_hardware'
require 'refrepo/gen/wiki/generators/site_network'
require 'refrepo/gen/wiki/generators/status'
require 'refrepo/gen/wiki/generators/group_storage'
module RefRepo::Gen::Wiki
......@@ -30,6 +31,10 @@ module RefRepo::Gen::Wiki
'oar_properties' => {
:gen => OarPropertiesGenerator,
:page => 'OAR_Properties'
},
'group_storage' => {
:gen => GroupStorageGenerator,
:page => 'Group_Storage'
}
}
SITE_GENERATORS = {
......
# coding: utf-8
class GroupStorageGenerator < WikiGenerator
def initialize(page_name)
super(page_name)
end
def generate_content
table_columns = ["Site", "Server Name", "Size", "Link Speed", "Notes"]
table_data = []
global_hash = get_global_hash
# Loop over Grid'5000 sites
global_hash["sites"].sort.to_h.each { |site_uid, site_hash|
site_hash.fetch("servers").sort.to_h.each_value { |server_hash|
next unless server_hash['group_storage']
group_storage = server_hash['group_storage']
table_data << [
"[[#{site_uid.capitalize}:Hardware|#{site_uid.capitalize}]]",
"#{group_storage['name']}.#{site_uid}.grid5000.fr",
G5K.get_size(group_storage['size'], 'metric'),
G5K.get_rate(group_storage['rate']),
group_storage["comment"] || ""
]
}
}
# Sort by site and server name
table_data.sort_by! { |row|
[row[0], row[1]]
}
# Table construction
table_options = 'class="wikitable sortable" style="text-align: center;"'
@generated_content = MW.generate_table(table_options, table_columns, table_data)
@generated_content += MW.italic(MW.small(generated_date_string))
@generated_content += MW::LINE_FEED
end
end
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