Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_channel_arches(channel):
"""determine arches available in channel"""
chan = context.handlers.call('getChannel', channel, strict=True)
ret = {}
for host in context.handlers.call('listHosts', channelID=chan['id'], enabled=True):
for a in host['arches'].split():
ret[koji.canonArch(a)] = 1
return ret
def get_channel_arches(channel):
"""determine arches available in channel"""
chan = context.handlers.call('getChannel', channel, strict=True)
ret = {}
for host in context.handlers.call('listHosts', channelID=chan['id'], enabled=True):
for a in host['arches'].split():
ret[koji.canonArch(a)] = 1
return ret
def get_channel_arches(channel):
"""determine arches available in channel"""
chan = context.handlers.call('getChannel', channel, strict=True)
ret = {}
for host in context.handlers.call('listHosts', channelID=chan['id'], enabled=True):
for a in host['arches'].split():
ret[koji.canonArch(a)] = 1
return ret
maven_archives.append({'maven_info': maven_info,
'files': [os.path.join(dirpath, f) for f in filenames]})
if not maven_archives:
return
# We don't know which pom is the top-level pom, so we don't know what Maven
# metadata to associate with the build. So we make something up.
maven_build = {'group_id': buildinfo['name'], 'artifact_id': rpminfo['name'],
'version': '%(version)s-%(release)s' % buildinfo}
context.handlers.call('host.createMavenBuild', buildinfo, maven_build)
for entry in maven_archives:
maven_info = entry['maven_info']
for filepath in entry['files']:
if not context.handlers.call('getArchiveType', filename=filepath):
# unsupported archive type, skip it
continue
context.handlers.call('host.importArchive', filepath, buildinfo, 'maven', maven_info)
if len(poms) != 1:
continue
pom_info = koji.parse_pom(os.path.join(dirpath, poms[0]))
maven_info = koji.pom_to_maven_info(pom_info)
maven_archives.append({'maven_info': maven_info,
'files': [os.path.join(dirpath, f) for f in filenames]})
if not maven_archives:
return
# We don't know which pom is the top-level pom, so we don't know what Maven
# metadata to associate with the build. So we make something up.
maven_build = {'group_id': buildinfo['name'], 'artifact_id': rpminfo['name'],
'version': '%(version)s-%(release)s' % buildinfo}
context.handlers.call('host.createMavenBuild', buildinfo, maven_build)
for entry in maven_archives:
maven_info = entry['maven_info']
for filepath in entry['files']:
if not context.handlers.call('getArchiveType', filename=filepath):
# unsupported archive type, skip it
continue
context.handlers.call('host.importArchive', filepath, buildinfo, 'maven', maven_info)
if not maven_archives:
return
# We don't know which pom is the top-level pom, so we don't know what Maven
# metadata to associate with the build. So we make something up.
maven_build = {'group_id': buildinfo['name'], 'artifact_id': rpminfo['name'],
'version': '%(version)s-%(release)s' % buildinfo}
context.handlers.call('host.createMavenBuild', buildinfo, maven_build)
for entry in maven_archives:
maven_info = entry['maven_info']
for filepath in entry['files']:
if not context.handlers.call('getArchiveType', filename=filepath):
# unsupported archive type, skip it
continue
context.handlers.call('host.importArchive', filepath, buildinfo, 'maven', maven_info)