Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
def is_link_up(port):
	eth_link = "UNDEFINED"
	link_state = "UNDEFINED"

	leds = calnexGet("results/statusleds")
	if port == 0:
		eth_link = 'ethLink_0'
	else:
		eth_link = 'ethLink_1'

	for led in leds:
		if led['Name'] == ethLinketh_link:
			link_state = led['State']
	if link_state == 'Link':
		return True
	else:
		return False

def is_good_pkts(port):
	eth_pkts = "UNDEFINED"
	pkts_state = "UNDEFINED"

	leds = calnexGet("results/statusleds")
	if port == 0:
		eth_pkts = 'ethPkt_0'
	else:
		eth_pkts = 'ethPkt_1'

	for led in leds:
		if led['Name'] == eth_pkts:
			pkts_state = led['State']
	if pkts_state == 'GoodPackets':
		return True
	else:
		return False

...