changed some loglevels

This commit is contained in:
Fredrik Eriksson 2019-04-12 19:45:30 +02:00
parent 2818e57023
commit 505b39612c
No known key found for this signature in database
GPG Key ID: 8825C73A0FD1502A
3 changed files with 15 additions and 17 deletions

View File

@ -91,7 +91,7 @@ def system_upgrade():
if proc.returncode == 0: if proc.returncode == 0:
if out.endswith('No updates are available to install.\n'): 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: else:
log.info('System updates installed:') log.info('System updates installed:')
for line in out.splitlines(): for line in out.splitlines():
@ -100,9 +100,9 @@ def system_upgrade():
else: else:
log.warning('System upgrade failed (return code {}):'.format(proc.returncode)) log.warning('System upgrade failed (return code {}):'.format(proc.returncode))
for line in out.splitlines(): for line in out.splitlines():
log.info('stdout: {}'.format(line)) log.warning('stdout: {}'.format(line))
for line in err.splitlines(): for line in err.splitlines():
log.info('stderr: {}'.format(line)) log.warning('stderr: {}'.format(line))
return False return False
def pkg_upgrade(): def pkg_upgrade():
@ -119,7 +119,7 @@ def pkg_upgrade():
err = err.decode('utf-8') err = err.decode('utf-8')
if proc.returncode == 0 and not out and not err: if proc.returncode == 0 and not out and not err:
log.debug('No package upgrades available') log.info('No package upgrades available')
return False return False
upgrades = [] upgrades = []
@ -143,7 +143,7 @@ def pkg_upgrade():
default_version_diff = conf.getint('default', 'min_version_diff', fallback=2) default_version_diff = conf.getint('default', 'min_version_diff', fallback=2)
for pkg in upgrades: for pkg in upgrades:
pkg['upgrade_level'] = sau.helpers.version_diff(pkg['version_new'], pkg['version_old']) 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) diff = conf.getint('packages', pkg['pkg'], fallback=default_version_diff)
if diff >= pkg['upgrade_level']: if diff >= pkg['upgrade_level']:
log.debug('configured level {} >= pkg level {}'.format(diff, pkg['upgrade_level'])) log.debug('configured level {} >= pkg level {}'.format(diff, pkg['upgrade_level']))

View File

@ -223,11 +223,11 @@ def pkg_upgrade():
err = err.decode('utf-8') err = err.decode('utf-8')
if proc.returncode != 0 or err: 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(): for line in out.splitlines():
log.error('stdout: {}'.format(line)) log.warning('stdout: {}'.format(line))
for line in err.splitlines(): for line in err.splitlines():
log.error('stderr: {}'.format(line)) log.warning('stderr: {}'.format(line))
else: else:
log.info('upgrade complete') log.info('upgrade complete')
for line in out.splitlines(): for line in out.splitlines():
@ -245,11 +245,11 @@ def pkg_upgrade():
err = err.decode('utf-8') err = err.decode('utf-8')
if proc.returncode != 0 or err: 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(): for line in out.splitlines():
log.error('stdout: {}'.format(line)) log.warning('stdout: {}'.format(line))
for line in err.splitlines(): for line in err.splitlines():
log.error('stderr: {}'.format(line)) log.warning('stderr: {}'.format(line))
else: else:
log.info('preserved-rebuild complete') log.info('preserved-rebuild complete')
for line in out.splitlines(): for line in out.splitlines():
@ -267,11 +267,11 @@ def pkg_upgrade():
out = out.decode('utf-8') out = out.decode('utf-8')
err = err.decode('utf-8') err = err.decode('utf-8')
if proc.returncode != 0 or err: 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(): for line in out.splitlines():
log.error('stdout: {}'.format(line)) log.warning('stdout: {}'.format(line))
for line in err.splitlines(): for line in err.splitlines():
log.error('stderr: {}'.format(line)) log.warning('stderr: {}'.format(line))
else: else:
log.info('depclean complete') log.info('depclean complete')
for line in out.splitlines(): for line in out.splitlines():

View File

@ -31,8 +31,6 @@ def _get_deleted_open_files(proc):
# has been deleted. # has been deleted.
try: try:
for f in proc.open_files(): for f in proc.open_files():
if 'lvmetad' in f.path:
log.debug(f)
if f.path and os.path.exists(f.path): if f.path and os.path.exists(f.path):
continue continue
else: else:
@ -69,7 +67,7 @@ def restart_services():
for proc in psutil.process_iter(): for proc in psutil.process_iter():
files = _get_deleted_open_files(proc) files = _get_deleted_open_files(proc)
if files: if files:
log.debug('{} has open deleted files'.format(proc)) log.info('{} has open deleted files'.format(proc))
check_procs.add(proc) check_procs.add(proc)
# wait before the second test # wait before the second test