mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 18:58:01 +00:00 
			
		
		
		
	Clean up redundant directories and add library to update_dependencies
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
		| @@ -220,7 +220,6 @@ class GhostRequest: | |||||||
|                      testbed='Unknown Testbed', |                      testbed='Unknown Testbed', | ||||||
|                      test_run=None, |                      test_run=None, | ||||||
|                      target_folders=list(), |                      target_folders=list(), | ||||||
|                      grafana_dashboard=None, |  | ||||||
|                      grafana_token=None, |                      grafana_token=None, | ||||||
|                      grafana_host=None, |                      grafana_host=None, | ||||||
|                      grafana_port=3000, |                      grafana_port=3000, | ||||||
| @@ -251,6 +250,8 @@ class GhostRequest: | |||||||
|             print(files) |             print(files) | ||||||
|             for file in files: |             for file in files: | ||||||
|                 if os.path.isdir(parent_folder + '/' + file) is True: |                 if os.path.isdir(parent_folder + '/' + file) is True: | ||||||
|  |                     if os.path.exists(file): | ||||||
|  |                         shutil.rmtree(file) | ||||||
|                     shutil.copytree(parent_folder + '/' + file, file) |                     shutil.copytree(parent_folder + '/' + file, file) | ||||||
|                     target_folders.append(file) |                     target_folders.append(file) | ||||||
|             print('Target folders: %s' % target_folders) |             print('Target folders: %s' % target_folders) | ||||||
|   | |||||||
| @@ -18,8 +18,9 @@ EXAMPLE 2: ./ghost_profile.py --ghost_token TOKEN | |||||||
| --ghost_host 192.168.100.147 --server 192.168.93.51 --user_pull lanforge --password_pull lanforge --customer candela | --ghost_host 192.168.100.147 --server 192.168.93.51 --user_pull lanforge --password_pull lanforge --customer candela | ||||||
| --testbed heather --user_push matt --password_push "amount%coverage;Online" --kpi_to_ghost app | --testbed heather --user_push matt --password_push "amount%coverage;Online" --kpi_to_ghost app | ||||||
| --folders /home/lanforge/html-reports/wifi-capacity-2021-06-14-10-42-29 --grafana_token TOKEN | --folders /home/lanforge/html-reports/wifi-capacity-2021-06-14-10-42-29 --grafana_token TOKEN | ||||||
| --grafana_host 192.168.100.201 --grafana_dashboard 'Stidmatt-02' | --grafana_host 192.168.100.201 | ||||||
|  |  | ||||||
|  | this scripts uses pyjwt. If you get the issue module 'jwt' has no attribute 'encode', run this: pip3 uninstall jwt pyjwt && pip install pyjwt | ||||||
|  Matthew Stidham |  Matthew Stidham | ||||||
|  Copyright 2021 Candela Technologies Inc |  Copyright 2021 Candela Technologies Inc | ||||||
|     License: Free to distribute and modify. LANforge systems must be licensed. |     License: Free to distribute and modify. LANforge systems must be licensed. | ||||||
| @@ -73,7 +74,6 @@ class UseGhost(GhostRequest): | |||||||
|             customer, |             customer, | ||||||
|             testbed, |             testbed, | ||||||
|             test_run, |             test_run, | ||||||
|             grafana_dashboard, |  | ||||||
|             grafana_token, |             grafana_token, | ||||||
|             grafana_host, |             grafana_host, | ||||||
|             grafana_port, |             grafana_port, | ||||||
| @@ -93,7 +93,6 @@ class UseGhost(GhostRequest): | |||||||
|                                  testbed, |                                  testbed, | ||||||
|                                  test_run, |                                  test_run, | ||||||
|                                  target_folders, |                                  target_folders, | ||||||
|                                  grafana_dashboard, |  | ||||||
|                                  grafana_token, |                                  grafana_token, | ||||||
|                                  grafana_host, |                                  grafana_host, | ||||||
|                                  grafana_port, |                                  grafana_port, | ||||||
| @@ -136,7 +135,6 @@ def main(): | |||||||
|     optional.add_argument('--customer') |     optional.add_argument('--customer') | ||||||
|     optional.add_argument('--testbed') |     optional.add_argument('--testbed') | ||||||
|     optional.add_argument('--test_run', default=None) |     optional.add_argument('--test_run', default=None) | ||||||
|     optional.add_argument('--grafana_dashboard') |  | ||||||
|     optional.add_argument('--grafana_token', default=None) |     optional.add_argument('--grafana_token', default=None) | ||||||
|     optional.add_argument('--grafana_host', default=None) |     optional.add_argument('--grafana_host', default=None) | ||||||
|     optional.add_argument('--grafana_port', default=3000) |     optional.add_argument('--grafana_port', default=3000) | ||||||
| @@ -181,7 +179,6 @@ def main(): | |||||||
|                   args.customer, |                   args.customer, | ||||||
|                   args.testbed, |                   args.testbed, | ||||||
|                   args.test_run, |                   args.test_run, | ||||||
|                   args.grafana_dashboard, |  | ||||||
|                   args.grafana_token, |                   args.grafana_token, | ||||||
|                   args.grafana_host, |                   args.grafana_host, | ||||||
|                   args.grafana_port, |                   args.grafana_port, | ||||||
|   | |||||||
| @@ -14,12 +14,13 @@ import subprocess | |||||||
| def main(): | def main(): | ||||||
|     print("Installing Script Python3 Dependencies") |     print("Installing Script Python3 Dependencies") | ||||||
|     packages = ['pandas', 'plotly', 'numpy', 'cryptography', 'paramiko', 'bokeh','pyarrow', 'websocket-client', 'xlsxwriter',\ |     packages = ['pandas', 'plotly', 'numpy', 'cryptography', 'paramiko', 'bokeh','pyarrow', 'websocket-client', 'xlsxwriter',\ | ||||||
|          'pyshark', 'influxdb', 'influxdb-client', 'matplotlib', 'pdfkit', 'pip-search', 'pyserial', 'pexpect-serial' ,'scp'] |          'pyshark', 'influxdb', 'influxdb-client', 'matplotlib', 'pdfkit', 'pip-search', 'pyserial', 'pexpect-serial' ,'scp', 'pyjwt'] | ||||||
|     packages_installed = [] |     packages_installed = [] | ||||||
|     packages_failed =[] |     packages_failed =[] | ||||||
|  |     subprocess.call("pip3 uninstall jwt", shell=True) | ||||||
|     for package in packages: |     for package in packages: | ||||||
|         command = "pip3 install {} >/tmp/pip3-stdout 2>/tmp/pip3-stderr".format(package) |         command = "pip3 install {} >/tmp/pip3-stdout 2>/tmp/pip3-stderr".format(package) | ||||||
|         res = subprocess.call(command, shell = True) |         res = subprocess.call(command, shell=True) | ||||||
|         if res == 0: |         if res == 0: | ||||||
|             #print("Package {} install SUCCESS Returned Value: {} ".format(package, res)) |             #print("Package {} install SUCCESS Returned Value: {} ".format(package, res)) | ||||||
|             packages_installed.append(package) |             packages_installed.append(package) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Matthew Stidham
					Matthew Stidham