From 4d0c5c848fda305055b71abf63ccd18478586694 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Mon, 18 May 2020 17:41:35 +0100 Subject: flake8: T2475: fix a number of issue reported by flake8 --- python/vyos/component_versions.py | 2 +- python/vyos/dicts.py | 3 +++ python/vyos/validate.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/vyos/component_versions.py b/python/vyos/component_versions.py index ec54a1576..90b458aae 100644 --- a/python/vyos/component_versions.py +++ b/python/vyos/component_versions.py @@ -51,7 +51,7 @@ def get_component_versions_from_file(config_file_name='/opt/vyatta/etc/config/co """ f = open(config_file_name, 'r') for line_in_config in f: - component_version = return_version(line_in_config) + component_version = get_component_version(line_in_config) if component_version: return component_version raise ValueError("no config string in file:", config_file_name) diff --git a/python/vyos/dicts.py b/python/vyos/dicts.py index 79cab4a08..b12cda40f 100644 --- a/python/vyos/dicts.py +++ b/python/vyos/dicts.py @@ -15,6 +15,9 @@ # along with this program. If not, see . +from vyos import ConfigError + + class FixedDict(dict): """ FixedDict: A dictionnary not allowing new keys to be created after initialisation. diff --git a/python/vyos/validate.py b/python/vyos/validate.py index e083604c5..6304fa8de 100644 --- a/python/vyos/validate.py +++ b/python/vyos/validate.py @@ -205,7 +205,7 @@ def assert_number(n): def assert_positive(n, smaller=0): assert_number(n) if int(n) < smaller: - raise ValueError(f'{n} is smaller than {limit}') + raise ValueError(f'{n} is smaller than {smaller}') def assert_mtu(mtu, min=68, max=9000): -- cgit v1.2.3