mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 18:58:01 +00:00 
			
		
		
		
	HTML and PDF report links on a single line in the Ghost report
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
		| @@ -360,10 +360,10 @@ class GhostRequest: | ||||
|                 if 'pdf' in file: | ||||
|                     url = 'http://%s/%s/%s/%s/%s/%s' % ( | ||||
|                         ghost_host, customer.strip('/'), testbed, test_run, target_folder, file) | ||||
|                     pdfs.append('PDF of results: <a href="%s">%s</a><br />' % (url, file)) | ||||
|                     pdfs.append('PDF of results: <a href="%s">%s</a>' % (url, file)) | ||||
|             if 'index.html' in files: | ||||
|                 url = 'http://%s/%s/%s/%s/%s' % ( | ||||
|                     ghost_host, customer.strip('/'), testbed, target_folder, 'index.html') | ||||
|                     ghost_host, customer.strip('/'), testbed, target_folder, target_folder) | ||||
|                 webpages.append('Results webpage: <a href="%s">Index of report</a><br />' % url) | ||||
|             scp_push.close() | ||||
|             self.upload_images(target_folder) | ||||
| @@ -471,13 +471,10 @@ class GhostRequest: | ||||
|         dut_table = dut_table + '</tbody></table>' | ||||
|         text = text + dut_table | ||||
|  | ||||
|         for pdf in pdfs: | ||||
|             print(pdf) | ||||
|             text = text + pdf | ||||
|  | ||||
|         for page in webpages: | ||||
|             print(page) | ||||
|             text = text + page | ||||
|         for article in zip(pdfs, webpages): | ||||
|             if self.debug: | ||||
|                 print(article) | ||||
|             text = text + article[0] + ' | ' + article[1] | ||||
|  | ||||
|         for image in images: | ||||
|             text = text + image | ||||
|   | ||||
							
								
								
									
										47
									
								
								py-scripts/cv_manager.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										47
									
								
								py-scripts/cv_manager.py
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,47 @@ | ||||
| #!/usr/bin/env python3 | ||||
|  | ||||
| import sys | ||||
| import os | ||||
| import argparse | ||||
|  | ||||
| if sys.version_info[0] != 3: | ||||
|     print("This script requires Python 3") | ||||
|     exit(1) | ||||
|  | ||||
| if 'py-json' not in sys.path: | ||||
|     sys.path.append(os.path.join(os.path.abspath('..'), 'py-json')) | ||||
|     sys.path.append(os.path.join(os.path.abspath('..'), 'py-dashboard')) | ||||
|  | ||||
| from cv_test_manager import cv_test | ||||
| from cv_test_manager import * | ||||
|  | ||||
|  | ||||
| class CVManager(cv_test): | ||||
|     def __init__(self, | ||||
|                  scenario=None, | ||||
|                  debug=False, | ||||
|                  lfclient_host='localhost'): | ||||
|         self.scenario = scenario | ||||
|         self.debug = debug | ||||
|         self.exit_on_error = False | ||||
|         self.lfclient_host = lfclient_host | ||||
|  | ||||
|     def apply_and_build_scenario(self): | ||||
|         self.apply_cv_scenario(self.scenario) | ||||
|         self.build_cv_scenario() | ||||
|  | ||||
| def main(): | ||||
|     parser = argparse.ArgumentParser(description='''This is a simple driver script to load a CV Scenario''') | ||||
|     parser.add_argument('--scenario', help='Scenario you wish to build') | ||||
|     parser.add_argument('--debug', help='Enable debugging', default=False, action="store_true") | ||||
|     parser.add_argument('--mgr', default='localhost') | ||||
|  | ||||
|     args = parser.parse_args() | ||||
|  | ||||
|     manager = CVManager(scenario=args.scenario, | ||||
|                         debug=args.debug, | ||||
|                         lfclient_host=args.mgr) | ||||
|     manager.apply_and_build_scenario() | ||||
|  | ||||
| if __name__ =="__main__": | ||||
|     main() | ||||
		Reference in New Issue
	
	Block a user
	 Matthew Stidham
					Matthew Stidham