mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 10:48:02 +00:00 
			
		
		
		
	lf_check.py : updates to command arguments for subprocess and path setup
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
		| @@ -29,6 +29,7 @@ from json import load | ||||
| import configparser | ||||
| from pprint import * | ||||
| import subprocess | ||||
| from pathlib import Path | ||||
|      | ||||
|  | ||||
| CONFIG_FILE = os.getcwd() + '/py-scripts/sandbox/lf_check_config.ini'     | ||||
| @@ -94,16 +95,17 @@ class lf_check(): | ||||
|                         self.test_dict[test]['args'] = self.test_dict[test]['args'].replace(self.radio_dict[radio]["KEY"],'--radio {} --ssid {} --passwd {} --security {}' | ||||
|                         .format(self.radio_dict[radio]['RADIO'],self.radio_dict[radio]['SSID'],self.radio_dict[radio]['PASSWD'],self.radio_dict[radio]['SECURITY'])) | ||||
|                                              | ||||
|                 # Move  | ||||
|                 scripts_wd = Path(__file__).parents[1] | ||||
|                 print("file_wd {}".format(scripts_wd)) | ||||
|                 command = "{}/{}".format(scripts_wd,self.test_dict[test]['command']) | ||||
|                 cmd_args = "{}".format(self.test_dict[test]['args']) | ||||
|                 print("command: {} cmd_args {}".format(command,cmd_args)) | ||||
|  | ||||
|                 #print("test: {} enable: {} command: {} args: {}".format(self.test_dict[test],self.test_dict[test]['enabled'],self.test_dict[test]['command'],self.test_dict[test]['args'])) | ||||
|                 #print("enable: {} command: {} args: {}".format(self.test_dict[test]['enabled'],self.test_dict[test]['command'],self.test_dict[test]['args'])) | ||||
|                 command = "./{} {}".format(self.test_dict[test]['command'],self.test_dict[test]['args']) | ||||
|                 print("command: {}".format(command)) | ||||
|  | ||||
|                 try: | ||||
|                     process = subprocess.run([command], check= True, stdout=subprocess.PIPE, universal_newlines=True) | ||||
|                 except: | ||||
|                     print("exception on command: {}".format(command)) | ||||
|                 #try: | ||||
|                 process = subprocess.run([command, cmd_args], check= True, stdout=subprocess.PIPE, universal_newlines=True) | ||||
|                 #except: | ||||
|                 #    print("exception on command: {}".format(command)) | ||||
|  | ||||
|  | ||||
| def main(): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Chuck SmileyRekiere
					Chuck SmileyRekiere