Skip to content

Commit

Permalink
Fixes #59 - Format and add slack info
Browse files Browse the repository at this point in the history
Formats the mismatched w/ dash slack message better and posts to slack if
there are apps with internal mismatches.

Signed-off-by: Ethan Hansen <[email protected]>
  • Loading branch information
1ethanhansen authored and mtarsel committed Aug 14, 2019
1 parent 9b029d8 commit e5363d6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ generated_input.yaml
archives/
dash-charts.json
metrics.csv
slackfile.txt

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
2 changes: 1 addition & 1 deletion get-image-info.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def main(args, start_time):
dash_dict = get_dashboard_json()
num_xtrnl = print_external_conflict_apps(app_list, dash_dict, sfile)
num_bad = print_bad_apps(app_list)
num_ntrnl = print_internal_conflict_apps(app_list)
num_ntrnl = print_internal_conflict_apps(app_list, sfile)
sfile.close()
args_enabled = [key for key,value in vars(args).items() if value is True]
if logging.getLogger().level == logging.DEBUG:
Expand Down
22 changes: 12 additions & 10 deletions utils/teardown_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@
def print_external_conflict_apps(app_list, dash_dict, sfile):
"""Prints out all of the app names that conflict with dashboard."""
conflict_list = []
i = 0
print("\n==== CONFLICT WITH DASHBOARD ====\n")
for app in app_list:
if not app.matches_dashboard(dash_dict):
conflict_list.append(app.name)
print(app.name)
i += 1
if conflict_list != []:
sfile.write("\n==== CONFLICT WITH DASHBOARD ====\n")
for i in conflict_list:
sfile.write(i)
print("Total mismatched: {}".format(i))
return i
sfile.write(i + "\n")
print("Total mismatched: {}".format(len(conflict_list)))
return len(conflict_list)


def print_bad_apps(app_list):
Expand All @@ -39,18 +37,22 @@ def print_bad_apps(app_list):
return i


def print_internal_conflict_apps(app_list):
def print_internal_conflict_apps(app_list, sfile):
""" Prints apps where the app's supported architectures are not
the same as all of the sub-images' supported architectures.
"""
i = 0
conflict_list = []
print("\n==== APP ARCHS CONFLICT WITH IMAGE ARCHS ====\n")
for app in app_list:
if not app.archs_match:
conflict_list.append(app.name)
print(app.name)
i +=1
print("Total internally conflicting apps: {}".format(i))
return i
if conflict_list != []:
sfile.write("\n==== APP ARCHS CONFLICT WITH IMAGE ARCHS ====\n")
for i in conflict_list:
sfile.write(i + "\n")
print("Total internally conflicting apps: {}".format(len(conflict_list)))
return len(conflict_list)


def diff_last_files(sfile):
Expand Down

0 comments on commit e5363d6

Please sign in to comment.