Skip to content

Commit d4451e8

Browse files
committed
*: stop indirecting st_size through a string
1 parent 7e9999e commit d4451e8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/cmd-koji-upload

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,12 @@ class Build(_Build):
283283
log.debug(f" * EXCLUDING: {msg}")
284284
continue
285285

286-
fsize = '{}'.format(os.stat(lpath).st_size)
287286
log.debug(" * calculating checksum")
288287
self._found_files[lpath] = {
289288
"local_path": lpath,
290289
"upload_path": upload_path,
291290
"md5": md5sum_file(lpath),
292-
"size": int(fsize)
291+
"size": os.stat(lpath).st_size
293292
}
294293
log.debug(f" * size is {self._found_files[lpath]['size']}")
295294
log.debug(f" * md5 is {self._found_files[lpath]['md5']}")

src/cosalib/build.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,15 +453,14 @@ def get_artifact_meta(self, fname=None):
453453
:param fname: name of file to get metadata for
454454
:type fname: str
455455
"""
456-
fsize = '{}'.format(os.stat(self.image_path).st_size)
457456
if fname is None:
458457
fname = self.image_name
459458
fpath = os.path.join(self.build_dir, fname)
460459
log.info(f"Calculating metadata for {fname}")
461460
return {
462461
"path": fname,
463462
"sha256": sha256sum_file(fpath),
464-
"size": int(fsize)
463+
"size": os.stat(self.image_path).st_size
465464
}
466465

467466
def get_artifacts(self):

0 commit comments

Comments
 (0)