backend/satellite_tools/spacewalk-data-fsck | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
New commits:
commit bd35b1d6ee482bfd455df63f08fccf641004f36c
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Jan 26 13:55:06 2011 +0100
Report errors even when not -v was specified.
diff --git a/backend/satellite_tools/spacewalk-data-fsck
b/backend/satellite_tools/spacewalk-data-fsck
index 2c3d3be..0e6b934 100755
--- a/backend/satellite_tools/spacewalk-data-fsck
+++ b/backend/satellite_tools/spacewalk-data-fsck
@@ -112,7 +112,7 @@ def check_db_vs_disk(options):
def check_disk_exists(abs_path):
ret = 0
if not os.path.isfile(abs_path):
- log(1, "File missing: %s" % abs_path)
+ log(0, "File missing: %s" % abs_path)
ret = 1
return ret
@@ -120,7 +120,7 @@ def check_disk_size(abs_path, size):
file_size = os.stat(abs_path)[stat.ST_SIZE]
ret = 0
if file_size != size:
- log(1, "File size mismatch: %s (%s vs. %s)" % (abs_path, size,
file_size))
+ log(0, "File size mismatch: %s (%s vs. %s)" % (abs_path, size,
file_size))
ret = 1
return ret
@@ -150,7 +150,7 @@ def check_disk_nevrao(abs_path, row):
for key in ('org_id', 'checksum_prefix', 'name',
'evr', 'arch', 'checksum',
'basename'):
if file[key] != row[key]:
- log(1, "File path mismatch: %s (%s: %s vs. %s)" % (abs_path, key,
row[key],
+ log(0, "File path mismatch: %s (%s: %s vs. %s)" % (abs_path, key,
row[key],
file[key]))
ret = 1
return ret
@@ -164,7 +164,7 @@ def check_disk_checksum(abs_path, checksum_type, checksum):
file_checksum = None
ret = 0
if file_checksum != checksum:
- log(1, "File checksum mismatch: %s (%s: %s vs. %s)" %
+ log(0, "File checksum mismatch: %s (%s: %s vs. %s)" %
(abs_path, checksum_type, checksum, file_checksum))
ret = 1
return ret
@@ -211,7 +211,7 @@ def check_disk_vs_db(disk_content=None, db_content=None):
def not_in_db(path, options):
if options.remove:
- log(1, "Removed file missing in db: %s" % (path))
+ log(0, "Removed file missing in db: %s" % (path))
os.unlink(path)
dirname = os.path.dirname(path)
while dirname != CFG.MOUNT_POINT:
@@ -224,11 +224,14 @@ def not_in_db(path, options):
raise e
dirname = os.path.dirname(dirname)
else:
- log(1, "File missing in db: %s" % (path))
+ log(0, "File missing in db: %s" % (path))
def log(level, *args):
log_debug(level, *args)
- if options.verbose >= level:
+ verbose = options.verbose
+ if not verbose:
+ verbose = 0
+ if verbose >= level:
print (', '.join(map(lambda i: str(i), args)))
if __name__ == '__main__':