GhostRequest: Cleanup whitespace

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
Matthew Stidham
2021-12-06 11:37:26 -08:00
parent 29e5f81078
commit ecea4c13a4

View File

@@ -208,7 +208,6 @@ class GhostRequest:
def custom_post(self, def custom_post(self,
folder, folder,
authors,
title='custom'): title='custom'):
self.upload_images(folder) self.upload_images(folder)
head = '''This is a custom post created via a script''' head = '''This is a custom post created via a script'''
@@ -219,11 +218,9 @@ class GhostRequest:
text=head) text=head)
def kpi_to_ghost(self, def kpi_to_ghost(self,
authors,
folders, folders,
parent_folder=None, parent_folder=None,
title=None, title=None,
server_pull=None,
ghost_host=None, ghost_host=None,
port=22, port=22,
user_push=None, user_push=None,
@@ -231,13 +228,12 @@ class GhostRequest:
customer=None, customer=None,
testbed=None, testbed=None,
test_run=None, test_run=None,
target_folders=list(), target_folders=None,
grafana_token=None, grafana_token=None,
grafana_host=None, grafana_host=None,
grafana_port=3000, grafana_port=3000,
grafana_datasource='InfluxDB', grafana_datasource='InfluxDB',
grafana_bucket=None): grafana_bucket=None):
global dut_hw, dut_sw, dut_model, dut_serial
now = datetime.now() now = datetime.now()
@@ -444,7 +440,7 @@ class GhostRequest:
# create Grafana Dashboard # create Grafana Dashboard
target_files = [] target_files = []
for folder in target_folders: for folder in target_folders:
target_file=folder.split('/')[-1] + '/kpi.csv' target_file = folder.split('/')[-1] + '/kpi.csv'
try: try:
open(target_file) open(target_file)
target_files.append(target_file) target_files.append(target_file)
@@ -506,7 +502,8 @@ class GhostRequest:
Influx Host: %s<br /> Influx Host: %s<br />
Influx Port: %s<br /> Influx Port: %s<br />
Influx Organization: %s<br /> Influx Organization: %s<br />
Influx Bucket: %s<br />''' % (influx_error, self.influx_host, self.influx_port, self.influx_org, self.influx_bucket) Influx Bucket: %s<br />''' % (
influx_error, self.influx_host, self.influx_port, self.influx_org, self.influx_bucket)
raw_test_tags = list() raw_test_tags = list()
test_tag_table = '' test_tag_table = ''
@@ -528,8 +525,8 @@ class GhostRequest:
else: else:
column_name = column column_name = column
dut_table_columns += ( dut_table_columns += (
'<tr><td style="border-color: gray; border-style: solid; border-width: 1px; ">%s</td><td colspan="3" style="border-color: gray; border-style: solid; border-width: 1px; ">%s</td></tr>' % ( '<tr><td style="border-color: gray; border-style: solid; border-width: 1px; ">%s</td><td colspan="3" style="border-color: gray; border-style: solid; border-width: 1px; ">%s</td></tr>' %
column_name, duts[column]) (column_name, duts[column])
) )
dut_table = '<table width="700px" border="1" cellpadding="2" cellspacing="0" ' \ dut_table = '<table width="700px" border="1" cellpadding="2" cellspacing="0" ' \