summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2026-06-29 15:58:23 +0100
committerGitHub <noreply@github.com>2026-06-29 15:58:23 +0100
commit772ccb06548fb1a65d8623ea545facb0bcabb97c (patch)
tree1b0c279456eeae262fa5815cff7045523bc4c166 /python
parent4a888ac808c29323d3adb3862d908e7cb2bfc592 (diff)
parent094928ba02bbabf3807ebe8f5ae77b957435d288 (diff)
downloadvyos-1x-772ccb06548fb1a65d8623ea545facb0bcabb97c.tar.gz
vyos-1x-772ccb06548fb1a65d8623ea545facb0bcabb97c.zip
Merge pull request #5298 from vyos/ci/T8490-typos-vyos-1x
ci: T8490: fix typos in comments, strings, and local identifiers
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/control.py6
-rw-r--r--python/vyos/ifconfig/operational.py2
-rw-r--r--python/vyos/logger.py16
-rw-r--r--python/vyos/range_regex.py6
-rw-r--r--python/vyos/utils/vti_updown_db.py12
5 files changed, 21 insertions, 21 deletions
diff --git a/python/vyos/ifconfig/control.py b/python/vyos/ifconfig/control.py
index 1ef42f981..03ab8959a 100644
--- a/python/vyos/ifconfig/control.py
+++ b/python/vyos/ifconfig/control.py
@@ -175,13 +175,13 @@ class Control(Section):
if convert:
value = convert(value)
- commited = self._write_sysfs(
+ committed = self._write_sysfs(
self._sysfs_set[name]['location'].format(**config), value)
- if not commited:
+ if not committed:
errmsg = self._sysfs_set.get('errormsg', '')
if errmsg:
raise TypeError(errmsg.format(**config))
- return commited
+ return committed
def get_interface(self, name):
if name in self._sysfs_get:
diff --git a/python/vyos/ifconfig/operational.py b/python/vyos/ifconfig/operational.py
index e60518948..caca40b3d 100644
--- a/python/vyos/ifconfig/operational.py
+++ b/python/vyos/ifconfig/operational.py
@@ -162,7 +162,7 @@ class Operational(Control):
stats[counter] = int(self.get_interface(counter))
return stats
- def formated_stats(self, indent=4):
+ def formatted_stats(self, indent=4):
tabs = []
stats = self.get_stats()
for rtx in self._stats_dir:
diff --git a/python/vyos/logger.py b/python/vyos/logger.py
index 207f95c1b..c9765b323 100644
--- a/python/vyos/logger.py
+++ b/python/vyos/logger.py
@@ -69,32 +69,32 @@ def getLogger(name=None, **kwargs):
def _syslog(**kwargs):
- formating = kwargs.get('format', SHORT)
+ formatting = kwargs.get('format', SHORT)
handler = handlers.SysLogHandler(
address=kwargs.get('address', '/dev/log'),
facility=kwargs.get('facility', 'syslog'),
)
- handler.setFormatter(logging.Formatter(formating))
+ handler.setFormatter(logging.Formatter(formatting))
return handler
def _stream(**kwargs):
- formating = kwargs.get('format', CLEAR)
+ formatting = kwargs.get('format', CLEAR)
handler = logging.StreamHandler(
stream=kwargs.get('stream', sys.stderr),
)
- handler.setFormatter(logging.Formatter(formating))
+ handler.setFormatter(logging.Formatter(formatting))
return handler
def _file(**kwargs):
- formating = kwargs.get('format', CLEAR)
+ formatting = kwargs.get('format', CLEAR)
handler = handlers.RotatingFileHandler(
filename=kwargs.get('filename', 1048576),
maxBytes=kwargs.get('maxBytes', 1048576),
backupCount=kwargs.get('backupCount', 3),
)
- handler.setFormatter(logging.Formatter(formating))
+ handler.setFormatter(logging.Formatter(formatting))
return handler
@@ -120,11 +120,11 @@ syslog = getLogger(
# testing
if __name__ == '__main__':
# from vyos.logger import getLogger
- formating = '%(asctime)s (%(filename)s) %(levelname)s: %(message)s'
+ formatting = '%(asctime)s (%(filename)s) %(levelname)s: %(message)s'
# syslog logger
# syslog=True if no 'address' field is provided
- syslog = getLogger(__name__ + '.1', syslog=True, format=formating)
+ syslog = getLogger(__name__ + '.1', syslog=True, format=formatting)
syslog.info('syslog test')
# steam logger
diff --git a/python/vyos/range_regex.py b/python/vyos/range_regex.py
index 81e9d2e7e..7ee9c6f08 100644
--- a/python/vyos/range_regex.py
+++ b/python/vyos/range_regex.py
@@ -34,9 +34,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 300-339: 3[0-3]\d
# 340-345: 34[0-5]
-def range_to_regex(inpt_range):
- if isinstance(inpt_range, str):
- range_list = inpt_range.split('-')
+def range_to_regex(input_range):
+ if isinstance(input_range, str):
+ range_list = input_range.split('-')
# Check input arguments
if len(range_list) == 2:
# The first element in range must be higher then the second
diff --git a/python/vyos/utils/vti_updown_db.py b/python/vyos/utils/vti_updown_db.py
index 390db5195..5453299e7 100644
--- a/python/vyos/utils/vti_updown_db.py
+++ b/python/vyos/utils/vti_updown_db.py
@@ -156,15 +156,15 @@ class VTIUpDownDB:
def setPersistentInterfaces(self, interface_list):
""" Updates the set of persistently up interfaces to match the given list """
- new_presistent_interfaces = set(interface_list)
- current_presistent_interfaces = set([ifspec for ifspec in self._ifspecs if ':' not in ifspec])
- added_presistent_interfaces = new_presistent_interfaces - current_presistent_interfaces
- removed_presistent_interfaces = current_presistent_interfaces - new_presistent_interfaces
+ new_persistent_interfaces = set(interface_list)
+ current_persistent_interfaces = set([ifspec for ifspec in self._ifspecs if ':' not in ifspec])
+ added_persistent_interfaces = new_persistent_interfaces - current_persistent_interfaces
+ removed_persistent_interfaces = current_persistent_interfaces - new_persistent_interfaces
- for interface in added_presistent_interfaces:
+ for interface in added_persistent_interfaces:
self.add(interface)
- for interface in removed_presistent_interfaces:
+ for interface in removed_persistent_interfaces:
self.remove(interface)
def commit(self, interface_dict_supplier):