Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Sep 8, 2016
1 parent 20e4070 commit 5985954
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/include/network/routines.rb
Expand Up @@ -686,17 +686,21 @@ def RunAndRead(command)
# @param Shell command to run
# @return whether command execution succeeds
def Run(command)
ret = SCR.Execute(path(".target.bash"), command) == 0
ret = SCR.Execute(path(".target.bash"), command).zero?

Builtins.y2error("Run <%1>: Command execution failed.", command) if !ret

ret
end
# TODO: end

# Return list of all interfaces present in the system (not only configured ones as NetworkInterfaces::List does).
# Return list of all interfaces present in the system.
#
# It means all interfaces which exists in the system at the time.
# /sys filesystem is used for checking that.
#
# @return [Array] of interface names.
# FIXME: rename e.g. to sys_interfaces
def GetAllInterfaces
result = RunAndRead("ls /sys/class/net")

Expand Down
5 changes: 4 additions & 1 deletion src/modules/LanItems.rb
Expand Up @@ -848,7 +848,10 @@ def GetNetcardNames
GetDeviceNames(GetNetcardInterfaces())
end

# get list of all configurations for "netcard" macro in NetworkInterfaces module
# Get list of all configured interfaces
#
# return [Array] list of strings - interface names (eth0, ...)
# FIXME: rename e.g. to configured_interfaces
def getNetworkInterfaces
configurations = NetworkInterfaces.FilterDevices("netcard")
devtypes = NetworkInterfaces.CardRegex["netcard"].to_s.split("|")
Expand Down

0 comments on commit 5985954

Please sign in to comment.