def __parse_jeos_images(self):
        log = logging.getLogger('%s.%s' % (__name__, self.__class__.__name__))
        config_urls = self.configuration['jeos_config']
        # Expand directories from the config and url-ify files
        # Read inlist - replace directories with their contents
        nextlist = []
        for path in config_urls:
            if os.path.isdir(path):
                for filename in os.listdir(path):
                    fullname = os.path.join(path, filename)
                    if os.path.isfile(fullname):
                        nextlist.append(fullname)
            else:
                nextlist.append(path)

        # Read nextlist - replace files with file:// URLs
        finalist = []
        for path in nextlist:
            if os.path.isfile(path):
                finalist.append("file://" + path)
            else:
                finalist.append(path)

        for url in finalist:
            try:
                filehandle = urlopen(str(url))
                line = filehandle.readline().strip()
            except:
                log.warning("Failed to open JEOS URL (%s)" % url)
                continue
            line_number = 1

            while line:
                # Lines that start with '#' are a comment
                if line[0] == "#":
                    pass
                # Lines that are zero length are whitespace
                elif len(line.split()) == 0:
                    pass
                else:
                    image_detail = line.split(":")
                    if len(image_detail) >= 6:
                        self.__add_jeos_image(image_detail)
                    else:
                        log.warning("Failed to parse line %d in JEOS config (%s):\n%s" % (line_number, url, line))

                line = filehandle.readline()
                line_number += 1

            filehandle.close()
dataset/ETHPy150Open redhat-imaging/imagefactory/imgfac/ApplicationConfiguration.py/ApplicationConfiguration.__parse_jeos_images/original