Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
grid5000
reference-repository
Commits
5f775556
Commit
5f775556
authored
Apr 22, 2020
by
IMBERT Matthieu
Committed by
LOUP David
Nov 12, 2020
Browse files
[ipv6] refactoring: rename var
parent
908e1c30
Changes
2
Hide whitespace changes
Inline
Side-by-side
input/grid5000/ipv6.yaml
View file @
5f775556
---
ipv6
:
prefix
:
'
2001:660:4406'
site
-
indexes
:
site
_
indexes
:
grenoble
:
1
lille
:
2
luxembourg
:
3
...
...
lib/refrepo/input_loader.rb
View file @
5f775556
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment