Page MenuHomeVyOS Platform

ConfigError formatting issue
Not ApplicablePublicBUG

Description

Currently ConfigError is called everywhere as such:

raise ConfigError((
                f'static-host-mapping "{host}" address "{hostprops["address"]}"'
                f'already used in another static-host-mapping'))

This results in output looking like:

static-host-mapping "test2" address "10.0.10.100"already used in another static-host-mapping

[[system static-host-mapping]] failed

Given that there's a lot of code with the first pattern, the extra space probably needs to be inserted in the ConfigError object.

Details

Version
1.3
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Internal change (not visible to end users)

Event Timeline

kroy updated the task description. (Show Details)
kroy updated the task description. (Show Details)

No, the string concatenation is done by Python (these are not multiple arguments but one argument) so there's nothing ConfigError can do. It's simply a mistake (typo) on my part.

The reason I do it this way is to comply with the 80-column limit. Any strings separated by whitespace will be transparently concatenated by Python to one string, it requires adding extra braces around the multi-line string.

erkin set Issue type to Internal change (not visible to end users).Aug 29 2021, 2:01 PM
erkin removed a subscriber: Global Notifications.