Bug 8452 - hiveconf getters raise exceptions for empty values
Summary: hiveconf getters raise exceptions for empty values
Status: CLOSED WONTFIX
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Misc (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.18.0
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-20 09:01 CET by Samuel Mannehed
Modified: 2024-11-26 13:37 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Samuel Mannehed cendio 2024-11-20 09:01:58 CET
Given a hiveconf parameter that is configured like this:
> [/my/empty/]
> param=
When the code uses get_integer() with the default value of 0:
> param = self.hive.get_integer("/my/empty/param", 0)
.. it will give a BadIntegerFormat error:
>   File "/opt/thinlinc/modules/thinlinc/hiveconf.py", line 221, in get_integer
>     raise BadIntegerFormat()
> thinlinc.hiveconf.BadIntegerFormat
It feels like the sane approach would simply be to return the default value.
Comment 2 Pierre Ossman cendio 2024-11-26 13:37:58 CET
An empty value for an integer field is likely an error, so it might be dangerous to just silently ignore that.

This is part of a more general issue of how we should deal with bad configuration. This is something that needs to be dealt with on a higher level where we have more information on how crucial a setting is, and if we can fall back to something else or not.

Note You need to log in before you can comment on or make changes to this bug.