From 505b39612c4aaf62bcb53ba59c48ea2fdd396f31 Mon Sep 17 00:00:00 2001 From: Fredrik Eriksson Date: Fri, 12 Apr 2019 19:45:30 +0200 Subject: [PATCH] changed some loglevels --- sau/freebsd.py | 10 +++++----- sau/gentoo.py | 18 +++++++++--------- sau/services.py | 4 +--- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/sau/freebsd.py b/sau/freebsd.py index bf5c929..42a5ede 100644 --- a/sau/freebsd.py +++ b/sau/freebsd.py @@ -91,7 +91,7 @@ def system_upgrade(): if proc.returncode == 0: if out.endswith('No updates are available to install.\n'): - log.debug('No system updates are available') + log.info('No system updates are available') else: log.info('System updates installed:') for line in out.splitlines(): @@ -100,9 +100,9 @@ def system_upgrade(): else: log.warning('System upgrade failed (return code {}):'.format(proc.returncode)) for line in out.splitlines(): - log.info('stdout: {}'.format(line)) + log.warning('stdout: {}'.format(line)) for line in err.splitlines(): - log.info('stderr: {}'.format(line)) + log.warning('stderr: {}'.format(line)) return False def pkg_upgrade(): @@ -119,7 +119,7 @@ def pkg_upgrade(): err = err.decode('utf-8') if proc.returncode == 0 and not out and not err: - log.debug('No package upgrades available') + log.info('No package upgrades available') return False upgrades = [] @@ -143,7 +143,7 @@ def pkg_upgrade(): default_version_diff = conf.getint('default', 'min_version_diff', fallback=2) for pkg in upgrades: pkg['upgrade_level'] = sau.helpers.version_diff(pkg['version_new'], pkg['version_old']) - log.debug('pkg upgrade available {}'.format(pkg)) + log.info('pkg upgrade available {}'.format(pkg)) diff = conf.getint('packages', pkg['pkg'], fallback=default_version_diff) if diff >= pkg['upgrade_level']: log.debug('configured level {} >= pkg level {}'.format(diff, pkg['upgrade_level'])) diff --git a/sau/gentoo.py b/sau/gentoo.py index 61a2080..274acd9 100644 --- a/sau/gentoo.py +++ b/sau/gentoo.py @@ -223,11 +223,11 @@ def pkg_upgrade(): err = err.decode('utf-8') if proc.returncode != 0 or err: - log.error('emerge returned {}'.format(proc.returncode)) + log.warning('emerge returned {}'.format(proc.returncode)) for line in out.splitlines(): - log.error('stdout: {}'.format(line)) + log.warning('stdout: {}'.format(line)) for line in err.splitlines(): - log.error('stderr: {}'.format(line)) + log.warning('stderr: {}'.format(line)) else: log.info('upgrade complete') for line in out.splitlines(): @@ -245,11 +245,11 @@ def pkg_upgrade(): err = err.decode('utf-8') if proc.returncode != 0 or err: - log.error('preserved-rebuild returned {}'.format(proc.returncode)) + log.warning('preserved-rebuild returned {}'.format(proc.returncode)) for line in out.splitlines(): - log.error('stdout: {}'.format(line)) + log.warning('stdout: {}'.format(line)) for line in err.splitlines(): - log.error('stderr: {}'.format(line)) + log.warning('stderr: {}'.format(line)) else: log.info('preserved-rebuild complete') for line in out.splitlines(): @@ -267,11 +267,11 @@ def pkg_upgrade(): out = out.decode('utf-8') err = err.decode('utf-8') if proc.returncode != 0 or err: - log.error('depclean returned {}'.format(proc.returncode)) + log.warning('depclean returned {}'.format(proc.returncode)) for line in out.splitlines(): - log.error('stdout: {}'.format(line)) + log.warning('stdout: {}'.format(line)) for line in err.splitlines(): - log.error('stderr: {}'.format(line)) + log.warning('stderr: {}'.format(line)) else: log.info('depclean complete') for line in out.splitlines(): diff --git a/sau/services.py b/sau/services.py index c989f3b..bd110a6 100644 --- a/sau/services.py +++ b/sau/services.py @@ -31,8 +31,6 @@ def _get_deleted_open_files(proc): # has been deleted. try: for f in proc.open_files(): - if 'lvmetad' in f.path: - log.debug(f) if f.path and os.path.exists(f.path): continue else: @@ -69,7 +67,7 @@ def restart_services(): for proc in psutil.process_iter(): files = _get_deleted_open_files(proc) if files: - log.debug('{} has open deleted files'.format(proc)) + log.info('{} has open deleted files'.format(proc)) check_procs.add(proc) # wait before the second test