Skip to content

Installation on Ubuntu 20.04 #3

Description

@carlostighe

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions