Skip to content

Commit

Permalink
correct pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
k-winters committed Jan 22, 2025
1 parent 66ba7cd commit cfc4943
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
6 changes: 3 additions & 3 deletions scubagoggles/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _run_reporter(self):
settings_data = json.load(file)
tenant_info = settings_data['tenant_info']
tenant_domain = tenant_info['domain']
tenant_ID = tenant_info['ID']
tenant_id = tenant_info['ID']
tenant_name = tenant_info['topLevelOU']
successful_calls = set(settings_data['successful_calls'])
unsuccessful_calls = set(settings_data['unsuccessful_calls'])
Expand Down Expand Up @@ -277,7 +277,7 @@ def _run_reporter(self):
timestamp_zulu = timestamp_utc.strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z'

report_metadata = {
'TenantId': tenant_ID,
'TenantId': tenant_id,
'DisplayName': tenant_name,
'DomainName': tenant_domain,
'ProductSuite': 'GWS',
Expand All @@ -296,7 +296,7 @@ def _run_reporter(self):
products_bar.set_description('Creating the HTML and JSON Report '
f'for {product}...')
reporter = Reporter(product,
tenant_ID,
tenant_id,
tenant_name,
tenant_domain,
main_report_name,
Expand Down
11 changes: 6 additions & 5 deletions scubagoggles/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,17 +416,18 @@ def get_tenant_info(self) -> dict:
"""
Gets the high-level tenant info using the directory API
"""
tenantID = ''
try:
response = self._services['directory'].customers().get(customerKey = self._customer_id).execute()
tenant_ID = response.get('id')
tenant_id = ''
try:
response = self._services['directory'].customers().get(
customerKey = self._customer_id).execute()
tenant_id = response.get('id')

primary_domain = 'Error Retrieving'
for domain in self.list_domains():
if domain['isPrimary']:
primary_domain = domain['domainName']
return {
'ID' : tenant_ID,
'ID' : tenant_id,
'domain': primary_domain,
'topLevelOU': self._top_ou
}
Expand Down
18 changes: 11 additions & 7 deletions scubagoggles/reporter/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Reporter:
# pylint: disable-next=too-many-positional-arguments
def __init__(self,
product: str,
tenant_ID: str,
tenant_id: str,
tenant_name: str,
tenant_domain: str,
main_report_name: str,
Expand All @@ -46,7 +46,7 @@ def __init__(self,
"""Reporter class initialization
:param product: name of product being tested
:param tenant_ID: Unique ID of GWS Customer
:param tenant_id: Unique ID of GWS Customer
:param tenant_name: Customer name
:param tenant_domain: The primary domain of the GWS org
:param main_report_name: Name of the main report HTML file.
Expand All @@ -63,7 +63,7 @@ def __init__(self,
"""

self._product = product
self._tenant_ID = tenant_ID
self._tenant_id = tenant_id
self._tenant_name = tenant_name
self._tenant_domain = tenant_domain
self._main_report_name = main_report_name
Expand Down Expand Up @@ -186,8 +186,10 @@ def build_front_page_html(cls, fragments: list, tenant_info: dict) -> str:
+ ' ' + time.tzname[time.daylight])

meta_data = ('<table style = "text-align:center;">'
'<tr><th>Customer Name</th><th>Customer Domain</th><th>Customer ID</th><th>Report Date</th></tr>'
f'<tr><td>{tenant_info["topLevelOU"]}</td><td>{tenant_info["domain"]}</td><td>{tenant_info["ID"]}</td><td>{report_date}'
'<tr><th>Customer Name</th><th>Customer Domain</th>'
'<th>Customer ID</th><th>Report Date</th></tr>'
f'<tr><td>{tenant_info["topLevelOU"]}</td><td>{tenant_info["domain"]}</td>'
f'<td>{tenant_info["ID"]}</td><td>{report_date}'
'</td></tr></table>')

html = html.replace('{{TENANT_DETAILS}}', meta_data)
Expand Down Expand Up @@ -311,9 +313,11 @@ def _build_report_html(self, fragments: list) -> str:
report_date = (now.strftime('%m/%d/%Y %H:%M:%S')
+ ' ' + time.tzname[time.daylight])
meta_data = (f'<table style = "text-align:center;">'
'<tr><th>Customer Name</th><th>Customer Domain</th><th>Cusomter ID</th><th>Report Date</th>'
'<tr><th>Customer Name</th><th>Customer Domain</th>'
'<th>Cusomter ID</th><th>Report Date</th>'
'<th>Baseline Version</th><th>Tool Version</th></tr>'
f'<tr><td>{self._tenant_name}</td><td>{self._tenant_domain}</td><td>{self._tenant_ID}</td><td>{report_date}</td>'
f'<tr><td>{self._tenant_name}</td><td>{self._tenant_domain}</td>'
f'<td>{self._tenant_id}</td><td>{report_date}</td>'
f'<td>{Version.suffix}</td><td>{Version.current}</td></tr>'
'</table>')

Expand Down

0 comments on commit cfc4943

Please sign in to comment.