osbuild-mpp: fix float correction

I mistakenly thought the .strip('.0') would strip off just '.0` but
in reality it strips off all instances of `.` or `0` on the end so
'4075520.0'.strip('.0') => '407552', which is clearly wrong.

This is a fixup for 5207e92.
This commit is contained in:
Dusty Mabe 2024-01-14 22:44:38 -05:00 committed by Simon de Vlieger
parent 7d73c0e741
commit d50705249a

View file

@ -1288,7 +1288,7 @@ class ManifestFile:
# some math that ended up converting the value to a
# float. Just trim it off in that case.
if res.endswith('.0'):
res = res.strip('.0')
res = res[0:-2]
res = int(res)
elif res_type == "json":
res = json.loads(res)