Commit c740a310 authored by Jérémie Gaidamour's avatar Jérémie Gaidamour
Browse files

[dev] bug fix cocnerning the switch info

parent bfac7760
...@@ -100,6 +100,8 @@ global_hash["sites"].each do |site_uid, site| ...@@ -100,6 +100,8 @@ global_hash["sites"].each do |site_uid, site|
network["weathermap"] ||= {} network["weathermap"] ||= {}
# Change the format of linecard from Hash to Array # Change the format of linecard from Hash to Array
linecards_tmp = Marshal.load(Marshal.dump(network["linecards"])) # bkp (deep_copy)
linecards_array = [] linecards_array = []
network["linecards"].each do |linecard_index, linecard| network["linecards"].each do |linecard_index, linecard|
ports = [] ports = []
...@@ -110,7 +112,6 @@ global_hash["sites"].each do |site_uid, site| ...@@ -110,7 +112,6 @@ global_hash["sites"].each do |site_uid, site|
linecard["ports"] = ports.map{|p| p || {}} linecard["ports"] = ports.map{|p| p || {}}
linecards_array[linecard_index] = linecard linecards_array[linecard_index] = linecard
end end
linecards_tmp = network["linecards"] # bkp
network["linecards"] = linecards_array.map{|l| l || {}} network["linecards"] = linecards_array.map{|l| l || {}}
write_json(network_path.join("#{network_uid}.json"), write_json(network_path.join("#{network_uid}.json"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment