Running in a virtual environment.
Set PANDEM_HOME to ps-data
The absolute path of ps-data is /home/user/sites/pandem2/pandem-source/ps-data
In storage.py line 76
def read_file(self, path): #absolute path here
if path.startswith('PANDEM_HOME'):
file_path = path
else :
file_path = os.path.join(os.getenv('PANDEM_HOME'), 'files', path)
if file_path.split('.')[-1] == "json":
with open(file_path, 'r') as f:
data_dict = json.load(f)
return data_dict
else :
with open(file_path, 'rb') as f:
bytes_data = BytesIO(f.read())
return bytes_data
the path being passed in is correct ps-data/files/source-definitions/medisys.json but its not the absolute path as the comment might suggest.
pandem home is being read correctly as - ps-data/
Its hitting the else section of this function and appending ps-data/files to the path leaving the path looking like this - ps-data/files/ps-data/files/source-definitions/medisys.json
Wondering is this a virtual environment issues.
Going to test setting PANDEM_HOME as PANDEM_HOME
Running in a virtual environment.
Set
PANDEM_HOMEtops-dataThe absolute path of ps-data is
/home/user/sites/pandem2/pandem-source/ps-dataIn
storage.pyline 76the path being passed in is correct
ps-data/files/source-definitions/medisys.jsonbut its not the absolute path as the comment might suggest.pandem home is being read correctly as -
ps-data/Its hitting the else section of this function and appending
ps-data/filesto the path leaving the path looking like this -ps-data/files/ps-data/files/source-definitions/medisys.jsonWondering is this a virtual environment issues.
Going to test setting
PANDEM_HOMEasPANDEM_HOME