Closed t-ru closed 2 years ago
This exception isn't really due to enforcing mayor.minor.release
but mayor.minor
gets dynamically typed to float. I'll cast it to string to fix it. However, kiwi documentation states that version must consist of three parts (https://documentation.suse.com/kiwi/9/html/kiwi/image-description.html#image-description-elements, section 8.1.4.1). Said that, kiwi doesn't reject a version string consisting of two parts only, but I don't know whether there could be any side effects.
Actually, casting isn't necessary and wouldn't work properly for a version number like 2022.10
(the trailing 0 would be lost). Simply use version: "2022.03"
in your image definition.
version: 2022.10
results in:
Source Name Version Description
Traceback (most recent call last):
File "/usr/local/bin/keg", line 33, in <module>
sys.exit(load_entry_point('kiwi-keg==1.1.0', 'console_scripts', 'keg')())
File "/usr/local/lib/python3.8/site-packages/kiwi_keg-1.1.0-py3.8.egg/kiwi_keg/keg.py", line 132, in main
print('{:30s} {:30s} {:8s} {}'.format(image, spec['name'], spec['ver'], spec['desc']))
ValueError: Unknown format code 's' for object of type 'float'
version: "2022.10" works.
However, kiwi documentation states that version must consist of three parts (https://documentation.suse.com/kiwi/9/html/kiwi/image-description.html#image-description-elements, section 8.1.4.1). Said that, kiwi doesn't reject a version string consisting of two parts only, but I don't know whether there could be any side effects.
Is keg a tool for SUSE internal use only? Yes or no. If no, suggestions from the community should be taken into account instead of referring to documentation and saying "works as designed". The specification that the version must have 3 digits may sometimes fit. But it does not always fit. The specifications are not perfect. Specifications are living.
Source Name Version Description
Traceback (most recent call last):
File "/usr/local/bin/keg", line 33, in <module>
sys.exit(load_entry_point('kiwi-keg==1.1.0', 'console_scripts', 'keg')())
File "/usr/local/lib/python3.8/site-packages/kiwi_keg-1.1.0-py3.8.egg/kiwi_keg/keg.py", line 132, in main
print('{:30s} {:30s} {:8s} {}'.format(image, spec['name'], spec['ver'], spec['desc']))
ValueError: Unknown format code 's' for object of type 'float'
This Error message says: There is an error. But it says not in wich image definition. please implement an error message with which you can locate the error location in yaml
keg is a public project, so everybody's welcome to use it and participate. I quoted the kiwi
documentation as a heads-up, to point out that using a format other than x.y.z
isn't really supported by kiwi
, so using a different scheme would be an use-at-own-risk situation. It may work fine, I honestly don't know.
The error message isn't great. The list
functionality needs a bit of an overhaul anyway, since the output isn't all that nice. I'll look into better error handling at that opportunity. However, it doesn't change the fact that if you use a string in a YAML file that the YAML parser could interpret as something else (like 2022.03
as float), you'll have to use quotes.
Hello,
there is a bug in keg "list list-recipes"
image.yaml
"keg -r /home/admin/os-images/ --list-recipes" results in:
Change version to 2022.03.0 ... no error, okay. Change version to 2022.03.build-01 ... no error, okay.
Please change so that the version does not have to consist of 3 parts.
used keg version: 1.1.0 (cloned from github master)
Best regards Thomas