From db25d0a90781a3deb0a5ef4e288f14a307797e79 Mon Sep 17 00:00:00 2001 From: Matthieu Imbert <matthieu.imbert@inria.fr> Date: Wed, 22 Apr 2020 12:32:16 +0200 Subject: [PATCH] [ipv6] refactoring: rename var --- input/grid5000/ipv6.yaml | 2 +- lib/refrepo/input_loader.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/input/grid5000/ipv6.yaml b/input/grid5000/ipv6.yaml index 610223ec06..d5e99e7920 100644 --- a/input/grid5000/ipv6.yaml +++ b/input/grid5000/ipv6.yaml @@ -1,7 +1,7 @@ --- ipv6: prefix: '2001:660:4406' - site-indexes: + site_indexes: grenoble: 1 lille: 2 luxembourg: 3 diff --git a/lib/refrepo/input_loader.rb b/lib/refrepo/input_loader.rb index 4da43d7615..2bd96ebf76 100644 --- a/lib/refrepo/input_loader.rb +++ b/lib/refrepo/input_loader.rb @@ -163,7 +163,7 @@ def add_ipv6(h) ipv6_adapters.each_with_index do |(_iface, nah), idx| # compute and assign IPv6 based on IPv4 of the first adapter ip6 = h['ipv6']['prefix'] + ':' - ip6 += '%x' % h['ipv6']['site-indexes'][site_uid] + ip6 += '%x' % h['ipv6']['site_indexes'][site_uid] ip6 += '00:' ip6 += '%x' % ((ip4.split('.')[2].to_i & 0b1111) + 1) if idx > 0 @@ -200,7 +200,7 @@ def add_kavlan_ipv6s(h) hn['kavlan'][iface].each_key do |kvl| kvl_id = kvl.split('-')[1].to_i ip6 = h['ipv6']['prefix'] + ':' - ip6 += '%x' % h['ipv6']['site-indexes'][site_uid] + ip6 += '%x' % h['ipv6']['site_indexes'][site_uid] ip6 += '%x:' % (kvl_id + 0x80) ip6 += '%x' % ((ip4.split('.')[2].to_i & 0b1111) + 1) if idx > 0 -- GitLab