mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 18:58:01 +00:00 
			
		
		
		
	port_probe.py : removed exception when looking for NSS on tx and rx ,check
string first before parsing. Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
		| @@ -88,13 +88,12 @@ class ProbePort(LFCliBase): | ||||
|             self.tx_mhz = 20 | ||||
|             print("HT: tx_mhz {tx_mhz}".format(tx_mhz=self.tx_mhz)) | ||||
|  | ||||
|         try: | ||||
|         tx_mcs = [x.strip('\t') for x in text if 'tx bitrate' in x][0].split(':')[1].strip('\t') | ||||
|         self.tx_mcs = int(tx_mcs.split('MCS')[1].strip(' ').split(' ')[0]) | ||||
|         print("self.tx_mcs {tx_mcs}".format(tx_mcs=self.tx_mcs)) | ||||
|             try: | ||||
|         if 'NSS' in text: | ||||
|             self.tx_nss = [x.strip('\t') for x in text if 'tx bitrate' in x][0].split('NSS')[1].strip(' ') | ||||
|             except BaseException: | ||||
|         else: | ||||
|             # nss is not present need to derive from MCS for HT | ||||
|             if 0 <= self.tx_mcs <= 7: | ||||
|                 self.tx_nss = 1 | ||||
| @@ -109,9 +108,6 @@ class ProbePort(LFCliBase): | ||||
|         print("tx_mbit {tx_mbit}".format(tx_mbit=self.tx_mbit)) | ||||
|         self.calculated_data_rate_tx_HT() | ||||
|  | ||||
|         except IndexError as error: | ||||
|             print(error) | ||||
|  | ||||
|         rx_bitrate = [x for x in text if 'rx bitrate' in x][0].replace('\t', ' ') | ||||
|         print("rx_bitrate {rx_bitrate}".format(rx_bitrate=rx_bitrate)) | ||||
|         self.rx_bitrate = rx_bitrate.split(':')[-1].strip(' ') | ||||
| @@ -126,13 +122,12 @@ class ProbePort(LFCliBase): | ||||
|         else: | ||||
|             self.rx_mhz = 20 | ||||
|  | ||||
|         try: | ||||
|         rx_mcs = [x.strip('\t') for x in text if 'rx bitrate' in x][0].split(':')[1].strip('\t') | ||||
|         self.rx_mcs = int(rx_mcs.split('MCS')[1].strip(' ').split(' ')[0]) | ||||
|         print("self.rx_mcs {rx_mcs}".format(rx_mcs=self.rx_mcs)) | ||||
|             try: | ||||
|         if 'NSS' in text: | ||||
|             self.rx_nss = [x.strip('\t') for x in text if 'rx bitrate' in x][0].split('NSS')[1].strip(' ') | ||||
|             except BaseException: | ||||
|         else: | ||||
|             # nss is not present need to derive from MCS for HT | ||||
|             if 0 <= self.rx_mcs <= 7: | ||||
|                 self.rx_nss = 1 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Chuck SmileyRekiere
					Chuck SmileyRekiere