Browse Source

Take suite name from Release file if it exist

devuan-deployment
Paul Gevers 1 year ago
parent
commit
85d10a27d2
No known key found for this signature in database GPG Key ID: 9C5C99EB05BD750A
2 changed files with 19 additions and 1 deletions
  1. +13
    -0
      britney2/inputs/suiteloader.py
  2. +6
    -1
      britney2/policies/autopkgtest.py

+ 13
- 0
britney2/inputs/suiteloader.py View File

@@ -113,6 +113,7 @@ class DebMirrorLikeSuiteContentLoader(SuiteContentLoader):
# - Load all sources before any of the binaries.
for suite in suites:
sources = self._read_sources(suite.path)
self._update_suite_name(suite)
suite.sources = sources
(suite.binaries, suite.provides_table) = self._read_binaries(suite, self._architectures)

@@ -133,6 +134,18 @@ class DebMirrorLikeSuiteContentLoader(SuiteContentLoader):
# building items/keys - by intern strings we reduce memory (considerably).
self._architectures = [sys.intern(arch) for arch in allarches]

def _update_suite_name(self, suite):
try:
release_file = read_release_file(suite.path)
except FileNotFoundError:
self.logger.info("The %s suite does not have a Release file, unable to update the name",
suite.name)
release_file = None

if release_file is not None:
suite.name = release_file['Suite']
self.logger.info("Using suite name from Release file: %s", release_file['Suite'])

def _check_release_file(self, target_suite, missing_config_msg):
try:
release_file = read_release_file(target_suite.path)


+ 6
- 1
britney2/policies/autopkgtest.py View File

@@ -150,6 +150,7 @@ class AutopkgtestPolicy(BasePolicy):
for src, data in suite.sources.items():
for trigger in data.testsuite_triggers:
self.testsuite_triggers.setdefault(trigger, set()).add(src)
target_suite_name = self.suite_info.target_suite.name

os.makedirs(self.state_dir, exist_ok=True)
self.read_pending_tests()
@@ -187,7 +188,8 @@ class AutopkgtestPolicy(BasePolicy):
# Blacklisted tests don't get a version
if res['version'] is None:
res['version'] = 'blacklisted'
(triggers, src, arch, ver, status, run_id, seen) = ([
(test_suite, triggers, src, arch, ver, status, run_id, seen) = ([
res['suite'],
res['trigger'],
res['package'],
res['arch'],
@@ -195,6 +197,9 @@ class AutopkgtestPolicy(BasePolicy):
res['status'],
str(res['run_id']),
round(calendar.timegm(time.strptime(res['updated_at'][0:-5], '%Y-%m-%dT%H:%M:%S')))])
if test_suite != target_suite_name:
# not requested for this target suite, so ignore
continue
if triggers is None:
# not requested for this policy, so ignore
continue


Loading…
Cancel
Save