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
64cd7c68
Commit
64cd7c68
authored
Sep 21, 2017
by
Lucas Nussbaum
Browse files
[dev] Add more info to each link
parent
ae97ad31
Changes
1
Hide whitespace changes
Inline
Side-by-side
generators/input-validators/check-network-description.rb
View file @
64cd7c68
...
...
@@ -78,7 +78,7 @@ def check_network_description(options)
if
mynetnodes
.
length
==
1
# on n'en a trouvé qu'un seul, c'est donc forcément le bon
mynetnodes
.
first
[
'found'
]
+=
1
links
<<
{
'nicknames'
=>
[
eq
[
'uid'
],
mynetnodes
.
first
[
'nickname'
]
].
sort
,
'switch'
=>
eq
[
'uid'
],
'target'
=>
mynetnodes
.
first
[
'nickname'
],
'rate'
=>
port
[
'rate'
]
||
lc
[
'rate'
]
}
links
<<
{
'nicknames'
=>
[
eq
[
'uid'
],
mynetnodes
.
first
[
'nickname'
]
].
sort
,
'switch'
=>
eq
[
'uid'
],
'target'
=>
mynetnodes
.
first
[
'nickname'
],
'rate'
=>
port
[
'rate'
]
||
lc
[
'rate'
]
,
'target_node'
=>
mynetnodes
.
first
[
'uid'
],
'port'
=>
mynetnodes
.
first
[
'port'
]
}
elsif
mynetnodes
.
length
>
1
# il y en a plusieurs...
if
port
[
'port'
].
nil?
...
...
@@ -91,7 +91,7 @@ def check_network_description(options)
if
mynetnodes
.
length
==
1
# on n'en a trouvé qu'un seul, c'est donc forcément le bon
mynetnodes
.
first
[
'found'
]
+=
1
links
<<
{
'nicknames'
=>
[
eq
[
'uid'
],
mynetnodes
.
first
[
'nickname'
]
].
sort
,
'switch'
=>
eq
[
'uid'
],
'target'
=>
mynetnodes
.
first
[
'nickname'
],
'rate'
=>
port
[
'rate'
]
||
lc
[
'rate'
]
}
links
<<
{
'nicknames'
=>
[
eq
[
'uid'
],
mynetnodes
.
first
[
'nickname'
]
].
sort
,
'switch'
=>
eq
[
'uid'
],
'target'
=>
mynetnodes
.
first
[
'nickname'
],
'rate'
=>
port
[
'rate'
]
||
lc
[
'rate'
]
,
'target_node'
=>
mynetnodes
.
first
[
'uid'
],
'port'
=>
mynetnodes
.
first
[
'port'
]
}
elsif
mynetnodes
.
length
>
1
puts
"ERROR: port specification matches several network nodes. port=
#{
port
}
; network nodes matched=
#{
mynetnodes
}
"
ok
=
false
...
...
@@ -111,7 +111,7 @@ def check_network_description(options)
if
mynetnodes
.
length
==
1
# on n'en a trouvé qu'un seul, c'est donc forcément le bon
mynetnodes
.
first
[
'found'
]
+=
1
links
<<
{
'nicknames'
=>
[
eq
[
'uid'
],
mynetnodes
.
first
[
'nickname'
]
].
sort
,
'switch'
=>
eq
[
'uid'
],
'target'
=>
mynetnodes
.
first
[
'nickname'
],
'rate'
=>
port
[
'rate'
]
||
lc
[
'rate'
]
}
links
<<
{
'nicknames'
=>
[
eq
[
'uid'
],
mynetnodes
.
first
[
'nickname'
]
].
sort
,
'switch'
=>
eq
[
'uid'
],
'target'
=>
mynetnodes
.
first
[
'nickname'
],
'rate'
=>
port
[
'rate'
]
||
lc
[
'rate'
]
,
'target_node'
=>
mynetnodes
.
first
[
'uid'
],
'port'
=>
mynetnodes
.
first
[
'port'
]
}
elsif
mynetnodes
.
length
>
1
puts
"ERROR: port specification matches several network nodes. port=
#{
port
}
; network nodes matched=
#{
mynetnodes
}
"
ok
=
false
...
...
@@ -124,7 +124,7 @@ def check_network_description(options)
mynetnodes
=
netnodes
.
select
{
|
n
|
n
.
values_at
(
'kind'
,
'uid'
,
'port'
)
==
port
.
values_at
(
'kind'
,
'uid'
,
'port'
)
}
if
mynetnodes
.
length
==
1
mynetnodes
.
first
[
'found'
]
+=
1
links
<<
{
'nicknames'
=>
[
eq
[
'uid'
],
mynetnodes
.
first
[
'nickname'
]
].
sort
,
'switch'
=>
eq
[
'uid'
],
'target'
=>
mynetnodes
.
first
[
'nickname'
],
'rate'
=>
port
[
'rate'
]
||
lc
[
'rate'
]
}
links
<<
{
'nicknames'
=>
[
eq
[
'uid'
],
mynetnodes
.
first
[
'nickname'
]
].
sort
,
'switch'
=>
eq
[
'uid'
],
'target'
=>
mynetnodes
.
first
[
'nickname'
],
'rate'
=>
port
[
'rate'
]
||
lc
[
'rate'
]
,
'target_node'
=>
mynetnodes
.
first
[
'uid'
],
'port'
=>
mynetnodes
.
first
[
'port'
]
}
else
puts
"ERROR: this port is connected to a node that does not exist:
#{
port
}
"
ok
=
false
...
...
@@ -134,7 +134,7 @@ def check_network_description(options)
mynetnodes
=
netnodes
.
select
{
|
n
|
n
.
values_at
(
'kind'
,
'uid'
)
==
port
.
values_at
(
'kind'
,
'uid'
)
}
if
mynetnodes
.
length
==
1
mynetnodes
.
first
[
'found'
]
+=
1
links
<<
{
'nicknames'
=>
[
eq
[
'uid'
],
mynetnodes
.
first
[
'nickname'
]
].
sort
,
'switch'
=>
eq
[
'uid'
],
'target'
=>
mynetnodes
.
first
[
'nickname'
],
'rate'
=>
port
[
'rate'
]
||
lc
[
'rate'
]
}
links
<<
{
'nicknames'
=>
[
eq
[
'uid'
],
mynetnodes
.
first
[
'nickname'
]
].
sort
,
'switch'
=>
eq
[
'uid'
],
'target'
=>
mynetnodes
.
first
[
'nickname'
],
'rate'
=>
port
[
'rate'
]
||
lc
[
'rate'
]
,
'target_node'
=>
mynetnodes
.
first
[
'uid'
],
'port'
=>
mynetnodes
.
first
[
'port'
]
}
else
puts
"ERROR: this port is connected to a switch or router that does not exist:
#{
port
}
"
ok
=
false
...
...
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