|
22 | 22 | from getpass import getpass |
23 | 23 | from collections import defaultdict |
24 | 24 | from datetime import datetime |
| 25 | +import inspect |
25 | 26 | import warnings |
26 | 27 | import time |
27 | 28 | import pexpect |
|
65 | 66 |
|
66 | 67 |
|
67 | 68 | class syntheticMaintPValidate: |
68 | | - def __init__(self, name, description): |
| 69 | + def __init__(self, func, name, description): |
| 70 | + self.function_name = func |
69 | 71 | self.name = name |
70 | 72 | self.description = description |
71 | 73 | self.reason = "" |
@@ -118,7 +120,7 @@ def writeResult(self): |
118 | 120 | Write the results of the syntheticMaintPValidate object to a file. |
119 | 121 | :return: None |
120 | 122 | """ |
121 | | - filename = self.name + '.json' |
| 123 | + filename = self.function_name + '.json' |
122 | 124 | path = "cx-preupgrade-validation-results" |
123 | 125 | if not os.path.isdir(path): |
124 | 126 | os.mkdir(path) |
@@ -1094,8 +1096,9 @@ def print_result(title, result, msg='', |
1094 | 1096 | unformatted_headers=None, unformatted_data=None, |
1095 | 1097 | recommended_action='', |
1096 | 1098 | doc_url='', |
1097 | | - adjust_title=False): |
1098 | | - synth = syntheticMaintPValidate(title, "") |
| 1099 | + adjust_title=False, |
| 1100 | + func="test"): |
| 1101 | + synth = syntheticMaintPValidate(func, title, "") |
1099 | 1102 | if result in [FAIL_O, FAIL_UF, ERROR, MANUAL, POST]: |
1100 | 1103 | # TODO: deal with unformatted data and headers |
1101 | 1104 | synth.updateFailureDetails( |
@@ -4687,7 +4690,7 @@ def fc_ex_model_check(index, total_checks, tversion, **kwargs): |
4687 | 4690 | if data: |
4688 | 4691 | result = FAIL_O |
4689 | 4692 |
|
4690 | | - print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) |
| 4693 | + print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url, func=inspect.currentframe().f_code.co_name) |
4691 | 4694 | return result |
4692 | 4695 |
|
4693 | 4696 |
|
|
0 commit comments