Example #1
0
def measureRun():
	for srcg in hosts.getGroups():
		for dstg in hosts.getGroups():
			if not srcg == dstg:
				try:
					src = hosts.getBest(srcg)
					dst = hosts.getBest(dstg)
					(loss, delay_avg, delay_stddev) = ifaceutil.ping(src, dst.name, 500, 300)
					link = get(srcg, dstg)
					link.adapt(loss, delay_avg, delay_stddev) 
				except PhysicalLink.DoesNotExist: # pylint: disable-msg=E1101
					PhysicalLink.objects.create(src_group=srcg, dst_group=dstg, loss=loss, delay_avg=delay_avg, delay_stddev=delay_stddev) # pylint: disable-msg=E1101
				except fault.Fault:
					pass
Example #2
0
def measureRun():
	for srcg in hosts.getGroups():
		for dstg in hosts.getGroups():
			if not srcg == dstg:
				src = hosts.getBest(srcg)
				dst = hosts.getBest(dstg)
				try:
					(loss, delay_avg, delay_stddev) = ifaceutil.ping(src, dst.name, 500, 300)
					try:
						link = get(srcg, dstg)
						link.adapt(loss, delay_avg, delay_stddev)
					except PhysicalLink.DoesNotExist: # pylint: disable-msg=E1101
						PhysicalLink.objects.create(src_group=srcg, dst_group=dstg, loss=loss, delay_avg=delay_avg, delay_stddev=delay_stddev) # pylint: disable-msg=E1101
				except:
					try:
						link = get(srcg, dstg)
						link.adaptFail()
					except PhysicalLink.DoesNotExist: # pylint: disable-msg=E1101
						pass #not creating a record if first contact is a fail