Example #1
0
 def deep_check(self, sharename, repair_uri, mode):
     """Performs a deep recursive check on 'repair_uri'"""
     results = repair_share(sharename, repair_uri, mode, self.verbosity)
     if results is None:
         print('WARN: Received no results.')
         return
     for result in results:
         if json_list_is_valid(result.decode('utf8'), self.verbosity):
             status, self.unhealthy = parse_result(result.decode('utf8'),
                                     mode, self.unhealthy, self.verbosity)
Example #2
0
 def deep_check(self, sharename, repair_uri, mode):
     """Performs a deep recursive check on 'repair_uri'"""
     results = repair_share(sharename, repair_uri, mode, self.verbosity)
     if results is None:
         print('WARN: Received no results.')
         return
     for result in results:
         if json_list_is_valid(result.decode('utf8'), self.verbosity):
             status, self.unhealthy = parse_result(result.decode('utf8'),
                                                   mode, self.unhealthy,
                                                   self.verbosity)
Example #3
0
 def one_check(self, sharename, repair_uri, mode):
     """Performs a shallow repair on 'repair_uri'"""
     result = repair_share(sharename, repair_uri, mode, self.verbosity)
     if re.match(r'^HTTP\ Error\ 410:\ Gone$', result.decode('utf8')):
         status = 'not retrievable'
         self.unhealthy += 1
     elif json_list_is_valid(result.decode('utf8'), self.verbosity):
         status, self.unhealthy = parse_result(result.decode('utf8'), mode,
                                             self.unhealthy, self.verbosity)
     else:
         status = 'unknown: Errors occured. Check this file manually to investigate.'
     if self.verbosity > 1:
         print("  Status: %s" % status)
Example #4
0
 def one_check(self, sharename, repair_uri, mode):
     """Performs a shallow repair on 'repair_uri'"""
     result = repair_share(sharename, repair_uri, mode, self.verbosity)
     if re.match(r'^HTTP\ Error\ 410:\ Gone$', result.decode('utf8')):
         status = 'not retrievable'
         self.unhealthy += 1
     elif json_list_is_valid(result.decode('utf8'), self.verbosity):
         status, self.unhealthy = parse_result(result.decode('utf8'), mode,
                                               self.unhealthy,
                                               self.verbosity)
     else:
         status = 'unknown: Errors occured. Check this file manually to investigate.'
     if self.verbosity > 1:
         print("  Status: %s" % status)