Skip to content

Commit e5363d6

Browse files
1ethanhansenmtarsel
authored andcommitted
Fixes mtarsel#59 - Format and add slack info
Formats the mismatched w/ dash slack message better and posts to slack if there are apps with internal mismatches. Signed-off-by: Ethan Hansen <1ethanhansen@gmail.com>
1 parent 9b029d8 commit e5363d6

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ generated_input.yaml
77
archives/
88
dash-charts.json
99
metrics.csv
10+
slackfile.txt
1011

1112
# Byte-compiled / optimized / DLL files
1213
__pycache__/

get-image-info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def main(args, start_time):
6161
dash_dict = get_dashboard_json()
6262
num_xtrnl = print_external_conflict_apps(app_list, dash_dict, sfile)
6363
num_bad = print_bad_apps(app_list)
64-
num_ntrnl = print_internal_conflict_apps(app_list)
64+
num_ntrnl = print_internal_conflict_apps(app_list, sfile)
6565
sfile.close()
6666
args_enabled = [key for key,value in vars(args).items() if value is True]
6767
if logging.getLogger().level == logging.DEBUG:

utils/teardown_utils.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,17 @@
1010
def print_external_conflict_apps(app_list, dash_dict, sfile):
1111
"""Prints out all of the app names that conflict with dashboard."""
1212
conflict_list = []
13-
i = 0
1413
print("\n==== CONFLICT WITH DASHBOARD ====\n")
1514
for app in app_list:
1615
if not app.matches_dashboard(dash_dict):
1716
conflict_list.append(app.name)
1817
print(app.name)
19-
i += 1
2018
if conflict_list != []:
2119
sfile.write("\n==== CONFLICT WITH DASHBOARD ====\n")
2220
for i in conflict_list:
23-
sfile.write(i)
24-
print("Total mismatched: {}".format(i))
25-
return i
21+
sfile.write(i + "\n")
22+
print("Total mismatched: {}".format(len(conflict_list)))
23+
return len(conflict_list)
2624

2725

2826
def print_bad_apps(app_list):
@@ -39,18 +37,22 @@ def print_bad_apps(app_list):
3937
return i
4038

4139

42-
def print_internal_conflict_apps(app_list):
40+
def print_internal_conflict_apps(app_list, sfile):
4341
""" Prints apps where the app's supported architectures are not
4442
the same as all of the sub-images' supported architectures.
4543
"""
46-
i = 0
44+
conflict_list = []
4745
print("\n==== APP ARCHS CONFLICT WITH IMAGE ARCHS ====\n")
4846
for app in app_list:
4947
if not app.archs_match:
48+
conflict_list.append(app.name)
5049
print(app.name)
51-
i +=1
52-
print("Total internally conflicting apps: {}".format(i))
53-
return i
50+
if conflict_list != []:
51+
sfile.write("\n==== APP ARCHS CONFLICT WITH IMAGE ARCHS ====\n")
52+
for i in conflict_list:
53+
sfile.write(i + "\n")
54+
print("Total internally conflicting apps: {}".format(len(conflict_list)))
55+
return len(conflict_list)
5456

5557

5658
def diff_last_files(sfile):

0 commit comments

Comments
 (0)