Commit e0a0607b authored by IMBERT Matthieu's avatar IMBERT Matthieu
Browse files

[gen] fix for failed valid:schema check

parent 4b211848
Pipeline #131697 passed with stages
in 4 minutes and 10 seconds
{
"ipv6": {
"site-indexes": {
"grenoble": 1,
"lille": 2,
"luxembourg": 3,
"lyon": 4,
"nancy": 5,
"nantes": 6,
"rennes": 7,
"sophia": 8
}
},
"type": "grid",
"uid": "grid5000"
}
\ No newline at end of file
ipv6:
site-indexes:
grenoble: 1
lille: 2
luxembourg: 3
lyon: 4
nancy: 5
nantes: 6
rennes: 7
sophia: 8
......@@ -107,6 +107,17 @@ def add_kavlan_ips(h)
end
end
$ipv6_site_indexes = {
'grenoble' => 1,
'lille' => 2,
'luxembourg' => 3,
'lyon' => 4,
'nancy' => 5,
'nantes' => 6,
'rennes' => 7,
'sophia' => 8,
}
def add_ipv6(h)
# for each node
h['sites'].each_pair do |site_uid, hs|
......@@ -121,7 +132,7 @@ def add_ipv6(h)
if not ip4.nil?
# compute and assign IPv6 based on IPv4
ip6 = '2001:660:4406:'
ip6 += '%x' % h['ipv6']['site-indexes'][site_uid]
ip6 += '%x' % $ipv6_site_indexes[site_uid]
ip6 += '00:'
ip6 += '%x::' % ((ip4.split('.')[2].to_i & 0b1111) + 1)
ip6 += '%x' % (ip4.split('.')[3].to_i)
......
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