Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions CheckInGUI/PythonFiles/Data/DBSender.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ def get_usernames(self):
# Whether or not DB has passing results
def get_previous_test_results(self, full_id):

r = requests.post('{}/get_previous_test_results.py'.format(self.db_url), data={'full_id': str(full_id)})
try:
r = requests.post('{}/get_previous_test_results.py'.format(self.db_url), data={'full_id': str(full_id)}, timeout=10)
except requests.exceptions.RequestException as e:
logger.error("get_previous_test_results.py request failed (%s); treating board as having no prior results.", e)
return [], []
lines = r.text.split('\n')

try:
Expand All @@ -104,9 +108,10 @@ def get_previous_test_results(self, full_id):
end2 = lines.index("End2")
begin3 = lines.index("Begin3") + 1
end3 = lines.index("End3")
except:
logger.error("There was an issue with the web API script `get_previous_test_results.py`. There is likely a syntax error in an associated web API script.")
except ValueError:
logger.error("There was an issue with the web API script `get_previous_test_results.py` (no Begin/End markers in response); treating board as having no prior results.")
logger.debug(r.text)
return [], []

tests_run = []
outcomes = []
Expand Down
2 changes: 2 additions & 0 deletions CheckInGUI/PythonFiles/Data/DataHolder.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ def send_to_DB(self):
info_dict = {"full_id":self.get_full_ID(),"tester": self.data_dict['user_ID'], "test_type": test_name, "successful": self.data_dict["inspection_pass"], "comments": self.data_dict['comments']}
logger.debug(info_dict)

os.makedirs("{}/JSONFiles".format(PythonFiles.__path__[0]), exist_ok=True)

with open("{}/JSONFiles/storage.json".format(PythonFiles.__path__[0]), "w") as outfile:
json.dump(info_dict, outfile)

Expand Down
2 changes: 1 addition & 1 deletion Configs/WM_cfg.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
DBInfo:
admin: FactoryInserter
baseURL: http://128.186.110.114/Factory/mbDB
baseURL: http://phy-k619lf-a.hep.fsu.edu/Factory/mbDB
inserter: FactoryInserter
name: mbdb
reader: FactoryReadUser
Expand Down