changed auditor once mode
This commit is contained in:
@@ -65,18 +65,21 @@ class AccountAuditor(Daemon):
|
|||||||
"""Run the account audit once."""
|
"""Run the account audit once."""
|
||||||
self.logger.info('Begin account audit "once" mode')
|
self.logger.info('Begin account audit "once" mode')
|
||||||
begin = time.time()
|
begin = time.time()
|
||||||
try:
|
all_locs = audit_location_generator(self.devices,
|
||||||
location = ''
|
|
||||||
gen = audit_location_generator(self.devices,
|
|
||||||
account_server.DATADIR,
|
account_server.DATADIR,
|
||||||
mount_check=self.mount_check,
|
mount_check=self.mount_check,
|
||||||
logger=self.logger)
|
logger=self.logger)
|
||||||
while not location.endswith('.db'):
|
for path, device, partition in all_locs:
|
||||||
location, device, partition = gen.next()
|
self.account_audit(path)
|
||||||
except StopIteration:
|
if time.time() - reported >= 3600: # once an hour
|
||||||
self.logger.info('Nothing to audit')
|
self.logger.info(
|
||||||
else:
|
'Since %s: Account audits: %s passed audit, '
|
||||||
self.account_audit(location)
|
'%s failed audit' % (time.ctime(reported),
|
||||||
|
self.account_passes,
|
||||||
|
self.account_failures))
|
||||||
|
reported = time.time()
|
||||||
|
self.account_passes = 0
|
||||||
|
self.account_failures = 0
|
||||||
elapsed = time.time() - begin
|
elapsed = time.time() - begin
|
||||||
self.logger.info(
|
self.logger.info(
|
||||||
'Account audit "once" mode completed: %.02fs' % elapsed)
|
'Account audit "once" mode completed: %.02fs' % elapsed)
|
||||||
|
@@ -66,18 +66,21 @@ class ContainerAuditor(Daemon):
|
|||||||
"""Run the container audit once."""
|
"""Run the container audit once."""
|
||||||
self.logger.info('Begin container audit "once" mode')
|
self.logger.info('Begin container audit "once" mode')
|
||||||
begin = time.time()
|
begin = time.time()
|
||||||
try:
|
all_locs = audit_location_generator(self.devices,
|
||||||
location = ''
|
|
||||||
gen = audit_location_generator(self.devices,
|
|
||||||
container_server.DATADIR,
|
container_server.DATADIR,
|
||||||
mount_check=self.mount_check,
|
mount_check=self.mount_check,
|
||||||
logger=self.logger)
|
logger=self.logger)
|
||||||
while not location.endswith('.db'):
|
for path, device, partition in all_locs:
|
||||||
location, device, partition = gen.next()
|
self.container_audit(path)
|
||||||
except StopIteration:
|
if time.time() - reported >= 3600: # once an hour
|
||||||
self.logger.info('Nothing to audit')
|
self.logger.info(
|
||||||
else:
|
'Since %s: Container audits: %s passed audit, '
|
||||||
self.container_audit(location)
|
'%s failed audit' % (time.ctime(reported),
|
||||||
|
self.container_passes,
|
||||||
|
self.container_failures))
|
||||||
|
reported = time.time()
|
||||||
|
self.container_passes = 0
|
||||||
|
self.container_failures = 0
|
||||||
elapsed = time.time() - begin
|
elapsed = time.time() - begin
|
||||||
self.logger.info(
|
self.logger.info(
|
||||||
'Container audit "once" mode completed: %.02fs' % elapsed)
|
'Container audit "once" mode completed: %.02fs' % elapsed)
|
||||||
|
@@ -68,18 +68,21 @@ class ObjectAuditor(Daemon):
|
|||||||
"""Run the object audit once."""
|
"""Run the object audit once."""
|
||||||
self.logger.info('Begin object audit "once" mode')
|
self.logger.info('Begin object audit "once" mode')
|
||||||
begin = time.time()
|
begin = time.time()
|
||||||
try:
|
all_locs = audit_location_generator(self.devices,
|
||||||
location = ''
|
|
||||||
gen = audit_location_generator(self.devices,
|
|
||||||
object_server.DATADIR,
|
object_server.DATADIR,
|
||||||
mount_check=self.mount_check,
|
mount_check=self.mount_check,
|
||||||
logger=self.logger)
|
logger=self.logger)
|
||||||
while not location.endswith('.data'):
|
for path, device, partition in all_locs:
|
||||||
location, device, partition = gen.next()
|
self.object_audit(path, device, partition)
|
||||||
except StopIteration:
|
if time.time() - reported >= 3600: # once an hour
|
||||||
self.logger.info('Nothing to audit')
|
self.logger.info(
|
||||||
else:
|
'Since %s: Locally: %d passed audit, %d quarantined, '
|
||||||
self.object_audit(location, device, partition)
|
'%d errors' % (time.ctime(reported), self.passes,
|
||||||
|
self.quarantines, self.errors))
|
||||||
|
reported = time.time()
|
||||||
|
self.passes = 0
|
||||||
|
self.quarantines = 0
|
||||||
|
self.errors = 0
|
||||||
elapsed = time.time() - begin
|
elapsed = time.time() - begin
|
||||||
self.logger.info(
|
self.logger.info(
|
||||||
'Object audit "once" mode completed: %.02fs' % elapsed)
|
'Object audit "once" mode completed: %.02fs' % elapsed)
|
||||||
|
Reference in New Issue
Block a user