fix to keyError

This commit is contained in:
Matthew Gaughan 2023-11-08 13:17:01 -06:00
parent 6fe0bc5000
commit ef138afac9

View File

@ -55,7 +55,11 @@ def get_everything(manifest_path, early_cutoff):
try: try:
config = yaml.safe_load(stream) config = yaml.safe_load(stream)
#below lines will probably need to be refactored as tasks expand #below lines will probably need to be refactored as tasks expand
try:
vcs_path = config['Upstream_VCS'] vcs_path = config['Upstream_VCS']
except:
print('error with the keys, i guess')
return
print("------------------") print("------------------")
#print(vcs_path) return #print(vcs_path) return
try: try:
@ -74,7 +78,7 @@ def get_everything(manifest_path, early_cutoff):
largest_object[repo_path]['ghs_obj'] = ghs.main(vcs_path, early_cutoff) largest_object[repo_path]['ghs_obj'] = ghs.main(vcs_path, early_cutoff)
#print(ghs_obj["time_cleaned_comm"]) #print(ghs_obj["time_cleaned_comm"])
repo_uri_list = repo_path.split('/') repo_uri_list = repo_path.split('/')
with open('/data/users/mgaughan/kkex_data_110823_2/' + repo_uri_list[-2] + '_' + repo_uri_list[-1] + '_result.json', 'w') as data_path: with open('/data/users/mgaughan/kkex_data_110823_3/' + repo_uri_list[-2] + '_' + repo_uri_list[-1] + '_result.json', 'w') as data_path:
json.dump(largest_object[repo_path], data_path) json.dump(largest_object[repo_path], data_path)
except yaml.YAMLError as err: except yaml.YAMLError as err: