def METHOD_NAME(self):
    databases_scope = False
    self.dbhost = "localhost"
    self.dbport = 5432
    self.dbname = "pulpcore"
    self.dbpasswd = ""
    # TODO: read also redis config (we dont expect much customisations)
    # TODO: read also db user (pulp)
    self.staticroot = "/var/lib/pulp/assets"
    self.uploaddir = "/var/lib/pulp/media/upload"
    def separate_value(line, sep=':'):
        # an auxiliary method to parse values from lines like:
        #       'HOST': 'localhost',
        val = line.split(sep)[1].lstrip().rstrip(',')
        if (val.startswith('"') and val.endswith('"')) or \
           (val.startswith('\'') and val.endswith('\'')):
            val = val[1:-1]
        return val
    try:
        # split the lines to "one option per line" format
        for line in open("/etc/pulp/settings.py").read() \
                .replace(',', ',\n').replace('{', '{\n') \
                .replace('}', '\n}').splitlines():
            # skip empty lines and lines with comments
            if not line or line[0] == '#':
                continue
            if line.startswith("DATABASES"):
                databases_scope = True
                continue
            # example HOST line to parse:
            #         'HOST': 'localhost',
            pattern = r"\s*['|\"]%s['|\"]\s*:\s*\S+"
            if databases_scope and match(pattern % 'HOST', line):
                self.dbhost = separate_value(line)
            if databases_scope and match(pattern % 'PORT', line):
                self.dbport = separate_value(line)
            if databases_scope and match(pattern % 'NAME', line):
                self.dbname = separate_value(line)
            if databases_scope and match(pattern % 'PASSWORD', line):
                self.dbpasswd = separate_value(line)
            # if line contains closing '}' database_scope end
            if databases_scope and '}' in line:
                databases_scope = False
            if line.startswith("STATIC_ROOT = "):
                self.staticroot = separate_value(line, sep='=')
            if line.startswith("CHUNKED_UPLOAD_DIR = "):
                self.uploaddir = separate_value(line, sep='=')
    except IOError:
        # fallback when the cfg file is not accessible
        pass
    # set the password to os.environ when calling psql commands to prevent
    # printing it in sos logs
    # we can't set os.environ directly now: other plugins can overwrite it
    self.env = {"PGPASSWORD": self.dbpasswd}