libvirt: improve error msg for host key value

The error message is unclear, omitting the key for the data in host
definition.

Test Plan:
PASS  regresion
PASS  unit test of code path

Story: 2010816
Task: 48636

Change-Id: I90ca410c252f9ce14b8dd4c13affb592eac88d85
Signed-off-by: Michel Thebeau <michel.thebeau@windriver.com>
This commit is contained in:
Michel Thebeau 2023-08-16 09:40:59 -04:00 committed by Michel Thebeau
parent 286f233a4b
commit 4079553a32

View File

@ -135,8 +135,8 @@ def host_key_validate(data, field, value):
errnum += 1 errnum += 1
elif key in ('cpu', 'mem'): elif key in ('cpu', 'mem'):
if not isinstance(item, int): if not isinstance(item, int):
print('%s is not valid for %s' % print('%s is not valid for %s in %s' %
(item, field), file=sys.stderr) (item, key, field), file=sys.stderr)
errnum += 1 errnum += 1
return errnum return errnum