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
c740a310
Commit
c740a310
authored
Apr 03, 2016
by
Jérémie Gaidamour
Browse files
[dev] bug fix cocnerning the switch info
parent
bfac7760
Changes
1
Show whitespace changes
Inline
Side-by-side
dev/reference-api/reference-api.rb
View file @
c740a310
...
...
@@ -100,6 +100,8 @@ global_hash["sites"].each do |site_uid, site|
network
[
"weathermap"
]
||=
{}
# Change the format of linecard from Hash to Array
linecards_tmp
=
Marshal
.
load
(
Marshal
.
dump
(
network
[
"linecards"
]))
# bkp (deep_copy)
linecards_array
=
[]
network
[
"linecards"
].
each
do
|
linecard_index
,
linecard
|
ports
=
[]
...
...
@@ -110,7 +112,6 @@ global_hash["sites"].each do |site_uid, site|
linecard
[
"ports"
]
=
ports
.
map
{
|
p
|
p
||
{}}
linecards_array
[
linecard_index
]
=
linecard
end
linecards_tmp
=
network
[
"linecards"
]
# bkp
network
[
"linecards"
]
=
linecards_array
.
map
{
|
l
|
l
||
{}}
write_json
(
network_path
.
join
(
"
#{
network_uid
}
.json"
),
...
...
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