diff --git a/chef/cookbooks/barclamp/libraries/barclamp_library.rb b/chef/cookbooks/barclamp/libraries/barclamp_library.rb index 95eed4f083..c480dc2f74 100644 --- a/chef/cookbooks/barclamp/libraries/barclamp_library.rb +++ b/chef/cookbooks/barclamp/libraries/barclamp_library.rb @@ -69,7 +69,13 @@ def self.sort_ifs(map, bus_order) answer = map.sort{|a,b| aindex = Barclamp::Inventory.bus_index(bus_order, a[1]["path"]) bindex = Barclamp::Inventory.bus_index(bus_order, b[1]["path"]) - aindex == bindex ? a[0] <=> b[0] : aindex <=> bindex + if aindex != bindex + aindex <=> bindex + elsif a[1]["path"] != b[1]["path"] + a[1]["path"] <=> b[1]["path"] + else + a[0] <=> b[0] + end } answer.map! { |x| x[0] } end diff --git a/crowbar_framework/app/models/node_object.rb b/crowbar_framework/app/models/node_object.rb index ddbe7fbd49..8c06cffd80 100644 --- a/crowbar_framework/app/models/node_object.rb +++ b/crowbar_framework/app/models/node_object.rb @@ -927,7 +927,13 @@ def sort_ifs answer = map.sort{|a,b| aindex = bus_index(bus_order, a[1]["path"]) bindex = bus_index(bus_order, b[1]["path"]) - aindex == bindex ? a[0] <=> b[0] : aindex <=> bindex + if aindex != bindex + aindex <=> bindex + elsif a[1]["path"] != b[1]["path"] + a[1]["path"] <=> b[1]["path"] + else + a[0] <=> b[0] + end } answer.map! { |x| x[0] } end