Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def parse_isolist(self, isolist_path):
log.debug('Parsing isolist=%s' % isolist_path)
isolist = ConfigParser.ConfigParser()
isolist.read(isolist_path)
distros = []
for distro in isolist.sections():
log.debug(' Adding distro %s' % distro)
kargs = dict(isolist.items(distro))
kargs['backend'] = self
distros.append(Distro(**kargs))
#order is lost in configparser, use the ordering attribute
def compfunc(x, y):
if x.ordering == y.ordering:
return 0
elif x.ordering > y.ordering:
return 1
else:
return -1
distros.sort(compfunc)
return distros
def parse_isolist(self, isolist_path):
log.debug('Parsing isolist=%s' % isolist_path)
isolist = ConfigParser.ConfigParser()
isolist.read(isolist_path)
distros = []
for distro in isolist.sections():
log.debug(' Adding distro %s' % distro)
kargs = dict(isolist.items(distro))
kargs['backend'] = self
distros.append(Distro(**kargs))
#order is lost in configparser, use the ordering attribute
def compfunc(x, y):
if x.ordering == y.ordering:
return 0
elif x.ordering > y.ordering:
return 1
else:
return -1
distros.sort(compfunc)
return distros
def parse_isolist(self, isolist_path):
log.debug('Parsing isolist=%s' % isolist_path)
isolist = ConfigParser.ConfigParser()
isolist.read(isolist_path)
distros = []
for distro in isolist.sections():
log.debug(' Adding distro %s' % distro)
kargs = dict(isolist.items(distro))
kargs['backend'] = self
distros.append(Distro(**kargs))
#order is lost in configparser, use the ordering attribute
def compfunc(x, y):
if x.ordering == y.ordering:
return 0
elif x.ordering > y.ordering:
return 1
else:
return -1
distros.sort(compfunc)
return distros