Exemplo n.º 1
0
 def compare_qr_code(self):
     ret, md5sum_download = Util.get_md5sum(self.download_file_name)
     if ret == 'ok':
         ret, md5sum_current = Util.get_md5sum(self.qr_code_path)
         if md5sum_current == md5sum_download:
             self.logger.info('two png is same!!')
             return True
     self.logger.info('two png not same!!' + str(md5sum_download) + ' : ' +
                      str(md5sum_current))
     return False
Exemplo n.º 2
0
    def check_md5(self):
        filename = self.res_path + self.download_file_name
        md5sum = self.json_request['md5']
        ret, md5sum_get = Util.get_md5sum(filename)

        if ret == 'ok':
            if md5sum == md5sum_get:
                self.logger.info('check sum pass!!')
                result_status = Update_status_pass
            else:
                self.logger.info('md5 checksum fail , target is ' + str(md5sum) + ' the calc is ' + str(md5sum_get))
                result_status = Update_status_ng
        else:
            self.logger.warning(str(ret))
            result_status = Update_status_ng

        self.send_result_status(Update_md5, result_status)