def _parse_log_locations(
        self,
        json_path=None,
        var=None,
        is_var=True,
        isJson=True,
    ):
        """
        TODO

        The user can provide a list of logfiles in a container for us
        to maintain links to.
        """

        container = self
        logs = []  # list of maps {name:name,type:type}
        data = None
        try:
            if is_var:
                data = misc.GetProcessEnv(container.pid)[var]
            else:
                with open(json_path, 'r') as fp:
                    data = fp.read()
            if isJson:

                # remove double quotes around json

                if data.startswith('"'):
                    data = data[1:]
                if data.endswith('"'):
                    data = data[:-1]

                # json doesn't allow single quotes

                data = data.replace("'", '"')
                data = json.loads(data)
                self._log_locations_json_sanity_check(data)
                logs.extend(data['log_files'])
            else:
                log_locations = data.split(',')
                logs = [{'name': name.strip(), 'type': None}
                        for name in log_locations]
        except (KeyError, ValueError) as e:
            logger.debug('There is a problem with the env. variables: %s' % e)
        except (IOError, OSError) as e:
            logger.debug(e)
        return logs
dataset/ETHPy150Open cloudviz/agentless-system-crawler/crawler/dockercontainer.py/DockerContainer._parse_log_locations/original