d2657174ce
The function osa_toolkit.generate._add_container_hosts contains a bug in the code used to check if provided hostnames have exceeded their max allowed length. The logic used to perform this check depends on the `is_metal` flag within each container's properties. Unfortunately the `is_metal` flag is accessed within the `properties` dictionary using bracket notation rather than the safer `dict.get` method, causing a `KeyError` to be raised when a host's properties dictionary does not contain the `is_metal` flag. It is not expected that a `KeyError` would be raised in the function if hostnames have exceeded their max length. It is instead expected that a `SystemExit` exception would be raised warning the user of their invalid hostname(s). This bug will impacts deployments where hostnames actually do exceed the max allowed length due to the short circuit logic used in the if-elif tree. Closes-Bug: #1886905 Change-Id: Ic1acfea71f27f94e277aa443f0a53ef16b4eb417 |
||
---|---|---|
.. | ||
__init__.py | ||
dictutils.py | ||
filesystem.py | ||
generate.py | ||
ip.py | ||
manage.py | ||
tools.py |