Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def show_offload(interface, args = None):
try:
sg = ethtool.get_sg(interface) and "on" or "off"
except IOError:
sg = "not supported"
try:
tso = ethtool.get_tso(interface) and "on" or "off"
except IOError:
tso = "not supported"
try:
ufo = ethtool.get_ufo(interface) and "on" or "off"
except IOError:
ufo = "not supported"
try:
gso = ethtool.get_gso(interface) and "on" or "off"
except IOError:
gso = "not supported"
printtab("scatter-gather: %s" % sg)
printtab("tcp segmentation offload: %s" % tso)
printtab("udp fragmentation offload: %s" % ufo)