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
ab3e7be2
Commit
ab3e7be2
authored
Mar 31, 2020
by
IMBERT Matthieu
Browse files
[gen] ipv6: fix network_adapter select + add code to fail on unhandled cases
parent
96d0404b
Pipeline
#133186
passed with stages
in 4 minutes and 43 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
lib/refrepo/input_loader.rb
View file @
ab3e7be2
...
@@ -114,8 +114,10 @@ def add_ipv6(h)
...
@@ -114,8 +114,10 @@ def add_ipv6(h)
hc
[
'nodes'
].
each_pair
do
|
node_uid
,
hn
|
hc
[
'nodes'
].
each_pair
do
|
node_uid
,
hn
|
# get IPv4
# get IPv4
ip4
=
nil
ip4
=
nil
num_main_interfaces
=
0
hn
[
'network_adapters'
].
each_pair
do
|
iface
,
nh
|
hn
[
'network_adapters'
].
each_pair
do
|
iface
,
nh
|
if
nh
[
'mountable'
]
==
true
and
nh
[
'interface'
]
==
'Ethernet'
if
nh
[
'mounted'
]
==
true
&&
nh
[
'interface'
]
==
'Ethernet'
&&
nh
[
'management'
]
==
false
num_main_interfaces
+=
1
# for mounted && ethernet interfaces only
# for mounted && ethernet interfaces only
ip4
=
nh
[
'ip'
]
ip4
=
nh
[
'ip'
]
if
not
ip4
.
nil?
if
not
ip4
.
nil?
...
@@ -132,6 +134,9 @@ def add_ipv6(h)
...
@@ -132,6 +134,9 @@ def add_ipv6(h)
# for all other cases, force no IPv6
# for all other cases, force no IPv6
nh
.
delete
(
'ip6'
)
nh
.
delete
(
'ip6'
)
end
end
if
num_main_interfaces
>
1
raise
"
#{
node_uid
}
.
#{
site_uid
}
: more than one interface with mounted == true && interface == 'Ethernet' && management == false"
end
end
end
end
end
end
end
...
...
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