Lines Matching refs:tmp_cache_file
83 def _wait_for_other_download(self, tmp_cache_file): argument
87 current_size = tmp_cache_file.stat().st_size
98 new_size = tmp_cache_file.stat().st_size
109 self.log.debug("Time out while waiting for %s!", tmp_cache_file)
126 tmp_cache_file = self.cache_file.with_suffix(".download")
130 with tmp_cache_file.open("xb") as dst:
139 fsize = tmp_cache_file.stat().st_size
145 tmp_cache_file.unlink()
151 tmp_cache_file)
152 if self._wait_for_other_download(tmp_cache_file):
156 tmp_cache_file)
157 tmp_cache_file.unlink()
160 tmp_cache_file.unlink()
171 tmp_cache_file.unlink()
174 if not os.path.exists(tmp_cache_file):
179 os.setxattr(str(tmp_cache_file), "user.qemu-asset-url",
181 os.setxattr(str(tmp_cache_file), "user.qemu-asset-hash",
184 self.log.debug("Unable to set xattr on %s: %s", tmp_cache_file, e)
187 if not self._check(tmp_cache_file):
188 tmp_cache_file.unlink()
190 tmp_cache_file.replace(self.cache_file)