From 268fd402bcc4d1917d2cc7f7ce47fb4994eafc2e Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Tue, 21 Nov 2023 18:50:01 -0700 Subject: [PATCH] Make logs slightly quieter during scheduling Particularly in non-verbose mode. Signed-off-by: Zack Cerza --- teuthology/repo_utils.py | 6 ++---- teuthology/suite/run.py | 7 +------ teuthology/suite/util.py | 11 +++++------ 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/teuthology/repo_utils.py b/teuthology/repo_utils.py index 03321fbf1..ca0785bfd 100644 --- a/teuthology/repo_utils.py +++ b/teuthology/repo_utils.py @@ -121,8 +121,6 @@ def enforce_repo_state(repo_url, dest_path, branch, commit=None, remove_on_error set_remote(dest_path, repo_url) fetch_branch(dest_path, branch) touch_file(sentinel) - else: - log.info("%s was just updated or references a specific commit; assuming it is current", dest_path) if commit and os.path.exists(repo_reset): return @@ -277,7 +275,7 @@ def fetch_branch(repo_path, branch, shallow=True): GitError for other errors """ validate_branch(branch) - log.info("Fetching %s from origin", branch) + log.info("Fetching %s from origin", repo_path.split("/")[-1]) args = ['git', 'fetch'] if shallow: args.extend(['--depth', '1']) @@ -314,7 +312,7 @@ def reset_repo(repo_url, dest_path, branch, commit=None): else: reset_branch = 'origin/%s' % branch reset_ref = commit or reset_branch - log.info('Resetting repo at %s to %s', dest_path, reset_ref) + log.debug('Resetting repo at %s to %s', dest_path, reset_ref) # This try/except block will notice if the requested branch doesn't # exist, whether it was cloned or fetched. try: diff --git a/teuthology/suite/run.py b/teuthology/suite/run.py index 509c8061c..d08b750b9 100644 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@ -487,9 +487,7 @@ class Run(object): flavor = util.get_install_task_flavor(full_job_config) version = util.package_version_for_hash(sha1, flavor, os_type, os_version, self.args.machine_type) - if version: - log.debug(f"Found {version} for {os_type} {os_version} {flavor}") - else: + if not version: jobs_missing_packages.append(job) log.error(f"Packages for os_type '{os_type}', flavor {flavor} and " f"ceph hash '{sha1}' not found") @@ -668,9 +666,6 @@ Note: If you still want to go ahead, use --job-threshold 0''' dry_run=self.args.dry_run, ) - if self.args.dry_run: - log.debug("Base job config:\n%s" % self.base_config) - with open(base_yaml_path, 'w+b') as base_yaml: base_yaml.write(str(self.base_config).encode()) diff --git a/teuthology/suite/util.py b/teuthology/suite/util.py index 8d0af8e90..a4f0efa60 100644 --- a/teuthology/suite/util.py +++ b/teuthology/suite/util.py @@ -245,11 +245,10 @@ def package_version_for_hash(hash, flavor='default', distro='rhel', ), ) - if bp.distro == CONTAINER_DISTRO and bp.flavor == CONTAINER_FLAVOR: - log.info('container build %s, checking for build_complete' % bp.distro) - if not bp.build_complete: - log.info('build not complete') - return None + if (bp.distro == CONTAINER_DISTRO and bp.flavor == CONTAINER_FLAVOR and + not bp.build_complete): + log.info("Container build incomplete") + return None try: return bp.version @@ -329,7 +328,7 @@ def teuthology_schedule(args, verbose, dry_run, log_prefix='', stdin=None): printable_args.append("'%s'" % item) else: printable_args.append(item) - log.info('{0}{1}'.format( + log.debug('{0} command: {1}'.format( log_prefix, ' '.join(printable_args), )) -- 2.47.3