Revert "Gather available offloading modes"

Closes-bug: #1471856
This reverts commit 5686432eff1b011f2eb4272014dd17dd92ed6ff3.
Change-Id: Ie575bea40ff1c289d1b256879db60ab320e411fd
This commit is contained in:
Evgeniy L 2015-07-06 16:30:47 +00:00
parent 5026a43264
commit 39d4b921e5
1 changed files with 0 additions and 66 deletions

66
agent
View File

@ -114,15 +114,6 @@ class McollectiveConfig
end
end
class Offloading
def initialize(name, sub)
@name, @sub = name, sub
end
def to_json(options = {})
{'name' => @name, 'state' => nil, 'sub' => @sub}.to_json()
end
end
class NodeAgent
def initialize(logger, url=nil)
@ -202,38 +193,6 @@ class NodeAgent
interfaces
end
# transform input array into array of the objects
# Example:
# [{
# "state":null,
# "sub":[
# {
# "state":null,
# "sub":[],
# "name":"tx-checksum-ipv6"
# },
# ...........
# ],
# "name":"tx-checksumming"
# },
# {
# "state":null,
# "sub":[],
# "name":"generic-segmentation-offload"
# },
# .............
# ]
def _parse_offloading(offloading_arr)
return [] if offloading_arr.empty?
inner = []
current = offloading_arr.shift()
while offloading_arr.any? && offloading_arr.first().start_with?("\t") do
inner << offloading_arr.shift()[1..-1]
end
res = _parse_offloading(offloading_arr)
res << Offloading.new(current, _parse_offloading(inner))
end
def _detailed
detailed_meta = {
:system => _system_info,
@ -279,31 +238,6 @@ class NodeAgent
int_meta[:netmask] = addrinfo[:netmask] if addrinfo[:netmask]
end
end
begin
# this stuff will put all non-fixed offloading mode into array
# collect names of non-fixed offloading modes
# Example of ethtool -k ethX output:
# tx-checksumming: on
# tx-checksum-ipv4: on
# tx-checksum-ip-generic: off [fixed]
# tx-checksum-ipv6: on
# tx-checksum-fcoe-crc: off [fixed]
# tx-checksum-sctp: on
# scatter-gather: on
# tx-scatter-gather: on
# tx-scatter-gather-fraglist: off [fixed]
# generic-segmentation-offload: on
offloading_data = `ethtool -k #{int}`.split("\n").reject { |offloading|
offloading.include?("Features for") ||
offloading.include?("fixed")
}.map { |offloading|
offloading.split(':')[0]
}
# transform raw data into array of objects
int_meta[:offloading_modes] = _parse_offloading(offloading_data)
rescue
int_meta[:offloading_modes] = nil
end
detailed_meta[:interfaces] << int_meta
end
rescue Exception => e