Skip to content

Commit

Permalink
Sort interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Oct 18, 2018
1 parent b6dc532 commit b2d5836
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/network/lan_items_summary.rb
Expand Up @@ -138,43 +138,43 @@ def ifcfg_protocol(ifcfg)
# @return [String] interfaces configured with DHCP summary
def dhcp_summary
# TRANSLATORS: %s is the list of interfaces configured by DHCP
_("Configured with DHCP: %s") % LanItems.find_dhcp_ifaces.join(", ")
_("Configured with DHCP: %s") % LanItems.find_dhcp_ifaces.sort.join(", ")
end

# Return a summary of the interfaces configured statically
#
# @return [String] statically configured interfaces summary
def static_summary
# TRANSLATORS: %s is the list of interfaces configured by DHCP
_("Statically configured: %s") % LanItems.find_static_ifaces.join(", ")
_("Statically configured: %s") % LanItems.find_static_ifaces.sort.join(", ")
end

# Return a summary of the configured bridge interfaces
#
# @return [String] bridge configured interfaces summary
def bridge_summary
_("Bridges: %s") % bridges.map { |n| "#{n} (#{LanItems.bridge_slaves(n).join(", ")})" }
_("Bridges: %s") % bridges.map { |n| "#{n} (#{LanItems.bridge_slaves(n).sort.join(", ")})" }
end

# Return a summary of the configured bonding interfaces
#
# @return [String] bonding configured interfaces summary
def bonding_summary
_("Bonds: %s") % bonds.map { |n| "#{n} (#{LanItems.GetBondSlaves(n).join(", ")})" }
_("Bonds: %s") % bonds.map { |n| "#{n} (#{LanItems.GetBondSlaves(n).sort.join(", ")})" }
end

# Convenience method that obtains the list of bonding configured interfaces
#
# @return [Array<String>] bonding configured interface names
def bonds
LanItems.getNetworkInterfaces("bond")
LanItems.getNetworkInterfaces("bond").sort
end

# Convenience method that obtains the list of bridge configured interfaces
#
# @return [Array<String>] bridge configured interface names
def bridges
LanItems.getNetworkInterfaces("br")
LanItems.getNetworkInterfaces("br").sort
end
end
end

0 comments on commit b2d5836

Please sign in to comment.