From 70694055ddf37f0f52592329c70ef6140979e16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Wed, 23 Aug 2017 10:00:20 +0200 Subject: [PATCH] Changed log (refs #22279). --- tests/test_partitions.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/test_partitions.py b/tests/test_partitions.py index ba81f825..0e891e32 100755 --- a/tests/test_partitions.py +++ b/tests/test_partitions.py @@ -51,7 +51,7 @@ def get_swap_gbytes(): swap = l.split('SwapTotal:')[1].strip() swap_kbytes, unit = swap.split(' ') if unit != 'kB': - print('Warning, unexpected unit %s' % unit) + print('Warning, unexpected unit %s.' % unit) swap_gbytes = int(round(int(swap_kbytes) / (1024 * 1024))) return swap_gbytes @@ -87,7 +87,7 @@ def check_allocation(dev): unallocated = max_size - total_size unallocated_gbytes = to_gbytes(unallocated) if unallocated_gbytes > 1: - print('Warning, %s GB are unallocated on %s' % (unallocated_gbytes, root_dev)) + print('Warning, %s GB are unallocated on %s.' % (unallocated_gbytes, root_dev)) return False return True @@ -107,37 +107,37 @@ def check_path(p): name = mount_point dev, fstype, psize, available = get_path(mount_point) if fstype not in p.get('recommended_types'): - print('Warning, partition of %s fs type not recommended %s(current: %s, recommended: %s)%s' % (name, YELLOW, fstype, p['recommended_types'], DEF)) + print('Warning, partition of %s fs type not recommended %s(current: %s, recommended: %s)%s.' % (name, YELLOW, fstype, p['recommended_types'], DEF)) warning = True if 'nfs' not in dev: warning = not check_allocation(dev) min_available_gbytes = p.get('min_available_gbytes') if min_available_gbytes and available < min_available_gbytes: - print('Partition of %s has less than %s GB available (%s GB available)' % (mount_point, min_available_gbytes, available)) + print('Partition of %s has less than %s GB available %s(%s GB available)%s.' % (name, min_available_gbytes, RED, available, DEF)) error = True else: - print('Partition of %s is OK (%s GB available)' % (name, available)) + print('Partition of %s is OK (%s GB available).' % (name, available)) else: - print('%s not found, cannot check' % mount_point) + print('%s not found, cannot check.' % mount_point) elif p.get('type') == 'swap': name = 'swap' psize = get_swap_gbytes() if psize and psize < p['min_size_gbytes']: - print('%s is smaller than the minimum required size %s(%s GB < %s GB)%s' % (name, RED, psize, p['min_size_gbytes'], DEF)) + print('Partition of %s is smaller than the minimum required size %s(%s GB < %s GB)%s.' % (name, RED, psize, p['min_size_gbytes'], DEF)) error = True for p in paths: check_path(p) if error: - print('Errors found') + print('Errors found.') code = 1 elif warning: - print('Some warnings were found') + print('Some warnings were found.') code = 2 else: - print(GREEN + 'All ok' + DEF) + print(GREEN + 'All OK.' + DEF) code = 0 sys.exit(code) -- GitLab