From bb2aee1e58c1cd30087b935798060e6bf3c698c8 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Fri, 20 Mar 2026 18:41:24 +0200 Subject: T8410: Fix typos and mistakes for operational and configuration commands Fix typos and mistakes in the commands and comments No functional changes --- python/vyos/accel_ppp_util.py | 4 ++-- python/vyos/config.py | 6 +++--- python/vyos/config_mgmt.py | 2 +- python/vyos/configdep.py | 2 +- python/vyos/configdict.py | 8 ++++---- python/vyos/configdiff.py | 4 ++-- python/vyos/configsession.py | 2 +- python/vyos/configsource.py | 8 ++++---- python/vyos/configtree.py | 4 ++-- python/vyos/configverify.py | 4 ++-- python/vyos/debug.py | 2 +- python/vyos/defaults.py | 2 +- python/vyos/ethtool.py | 8 ++++---- python/vyos/frrender.py | 12 ++++++------ python/vyos/ifconfig/bond.py | 14 +++++++------- python/vyos/ifconfig/bridge.py | 4 ++-- python/vyos/ifconfig/control.py | 6 +++--- python/vyos/ifconfig/ethernet.py | 8 ++++---- python/vyos/ifconfig/interface.py | 18 +++++++++--------- python/vyos/ifconfig/loopback.py | 4 ++-- python/vyos/ifconfig/tunnel.py | 2 +- python/vyos/ifconfig/vxlan.py | 4 ++-- python/vyos/ifconfig/wireguard.py | 4 ++-- python/vyos/ifconfig/wireless.py | 4 ++-- python/vyos/ipsec.py | 2 +- python/vyos/kea.py | 4 ++-- python/vyos/system/compat.py | 2 +- python/vyos/system/disk.py | 4 ++-- python/vyos/utils/assertion.py | 2 +- python/vyos/utils/auth.py | 2 +- python/vyos/utils/dict.py | 4 ++-- python/vyos/utils/network.py | 2 +- python/vyos/utils/process.py | 4 ++-- python/vyos/utils/system.py | 2 +- python/vyos/utils/vti_updown_db.py | 2 +- python/vyos/vpp/control_host.py | 2 +- python/vyos/vyconf_session.py | 2 +- python/vyos/xml_ref/definition.py | 2 +- python/vyos/xml_ref/generate_cache.py | 2 +- python/vyos/xml_ref/generate_op_cache.py | 4 ++-- 40 files changed, 89 insertions(+), 89 deletions(-) (limited to 'python') diff --git a/python/vyos/accel_ppp_util.py b/python/vyos/accel_ppp_util.py index 85e8a964c..844bc56e5 100644 --- a/python/vyos/accel_ppp_util.py +++ b/python/vyos/accel_ppp_util.py @@ -130,7 +130,7 @@ def verify_accel_ppp_authentication(config, local_users=True): Common helper function which must be used by all Accel-PPP services based on get_config_dict() """ - # vertify auth settings + # verify auth settings if local_users and dict_search("authentication.mode", config) == "local": if ( dict_search("authentication.local_users", config) is None @@ -173,7 +173,7 @@ def verify_accel_ppp_authentication(config, local_users=True): user_config = config["authentication"]["interface"][interface] if "mac" not in user_config: raise ConfigError( - f'Users MAC addreses are not configured for interface "{interface}"') + f'Users MAC addresses are not configured for interface "{interface}"') if dict_search('authentication.radius.dynamic_author.server', config): if not dict_search('authentication.radius.dynamic_author.key', config): diff --git a/python/vyos/config.py b/python/vyos/config.py index 0476d7945..827246d05 100644 --- a/python/vyos/config.py +++ b/python/vyos/config.py @@ -53,7 +53,7 @@ VyOS has two distinct modes: operational mode and configuration mode. When a use the CLI is in the operational mode. In this mode, only the running (effective) config is accessible for reading. When a user enters the "configure" command, a configuration session is setup. Every config session -has its *proposed* (or *session*) config built on top of the current running config. When changes are commited, if commit succeeds, +has its *proposed* (or *session*) config built on top of the current running config. When changes are committed, if commit succeeds, the proposed config is merged into the running config. In configuration mode, "base" functions like `exists`, `return_value` return values from the session config, @@ -259,7 +259,7 @@ class Config(object): def session_changed(self): """ Returns: - True if the config session has uncommited changes, False otherwise. + True if the config session has uncommitted changes, False otherwise. """ return self._config_source.session_changed() @@ -544,7 +544,7 @@ class Config(object): Note: This function is safe to use in operational mode. In configuration mode, - it ignores uncommited changes. + it ignores uncommitted changes. """ if self._running_config is None: return False diff --git a/python/vyos/config_mgmt.py b/python/vyos/config_mgmt.py index ec29f82b7..e1e38b26f 100644 --- a/python/vyos/config_mgmt.py +++ b/python/vyos/config_mgmt.py @@ -841,7 +841,7 @@ def run(): rollback = subparsers.add_parser('rollback', help='Rollback to earlier config') rollback.add_argument('--rev', type=int, help='Revision number for rollback') rollback.add_argument( - '-y', dest='no_prompt', action='store_true', help='Excute without prompt' + '-y', dest='no_prompt', action='store_true', help='Execute without prompt' ) rollback_soft = subparsers.add_parser( diff --git a/python/vyos/configdep.py b/python/vyos/configdep.py index 04de66493..f1dd7895a 100644 --- a/python/vyos/configdep.py +++ b/python/vyos/configdep.py @@ -186,7 +186,7 @@ def graph_from_dependency_dict(d: dict) -> dict: for k in list(d): g[k] = set() # add the dependencies for every sub-case; should there be cases - # that are mutally exclusive in the future, the graphs will be + # that are mutually exclusive in the future, the graphs will be # distinguished for el in list(d[k]): g[k] |= set(d[k][el]) diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index b16c3cf1d..0603b42b8 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -430,7 +430,7 @@ def get_interface_dict(config, base, ifname='', recursive_defaults=True, with_pk """ Common utility function to retrieve and mangle the interfaces configuration from the CLI input nodes. All interfaces have a common base where value - retrival is identical. This function must be used whenever possible when + retrieval is identical. This function must be used whenever possible when working on the interfaces node! Return a dictionary with the necessary interface config keys. @@ -489,14 +489,14 @@ def get_interface_dict(config, base, ifname='', recursive_defaults=True, with_pk bond = is_member(config, ifname, 'bonding') if bond: dict.update({'is_bond_member' : bond}) - # Check if any DHCP options changed which require a client restat + # Check if any DHCP options changed which require a client restart dhcp = is_node_changed(config, base + [ifname, 'dhcp-options']) if dhcp: dict.update({'dhcp_options_changed' : {}}) dhcpv6 = is_node_changed(config, base + [ifname, 'dhcpv6-options']) if dhcpv6: dict.update({'dhcpv6_options_changed' : {}}) # Some interfaces come with a source_interface which must also not be part - # of any other bond or bridge interface as it is exclusivly assigned as the + # of any other bond or bridge interface as it is exclusively assigned as the # Kernels "lower" interface to this new "virtual/upper" interface. if 'source_interface' in dict: # Check if source interface is member of another bridge @@ -666,7 +666,7 @@ def get_accel_dict(config, base, chap_secrets, with_pki=False): """ Common utility function to retrieve and mangle the Accel-PPP configuration from different CLI input nodes. All Accel-PPP services have a common base - where value retrival is identical. This function must be used whenever + where value retrieval is identical. This function must be used whenever possible when working with Accel-PPP services! Return a dictionary with the necessary interface config keys. diff --git a/python/vyos/configdiff.py b/python/vyos/configdiff.py index 5e21a16e5..b7c3ef7c6 100644 --- a/python/vyos/configdiff.py +++ b/python/vyos/configdiff.py @@ -263,7 +263,7 @@ class ConfigDiff(object): to provide full dict; for example, Diff.MERGE will expand dict['merge'] into dict under value - no_detaults=False: if expand_nodes & Diff.MERGE, do not merge default + no_defaults=False: if expand_nodes & Diff.MERGE, do not merge default values to ret['merge'] recursive: if true, use config_tree diff algorithm provided by diff_tree class @@ -343,7 +343,7 @@ class ConfigDiff(object): to provide full dict; for example, Diff.MERGE will expand dict['merge'] into dict under value - no_detaults=False: if expand_nodes & Diff.MERGE, do not merge default + no_defaults=False: if expand_nodes & Diff.MERGE, do not merge default values to ret['merge'] recursive: if true, use config_tree diff algorithm provided by diff_tree class diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py index 62ce34b22..8fee8eca1 100644 --- a/python/vyos/configsession.py +++ b/python/vyos/configsession.py @@ -219,7 +219,7 @@ class ConfigSession(object): ) if output: print( - 'cli-shell-api teardownSession output for sesion {0}: {1}'.format( + 'cli-shell-api teardownSession output for session {0}: {1}'.format( self.__session_id, output ), file=sys.stderr, diff --git a/python/vyos/configsource.py b/python/vyos/configsource.py index 33852a182..b54f6283a 100644 --- a/python/vyos/configsource.py +++ b/python/vyos/configsource.py @@ -51,7 +51,7 @@ class ConfigSource: def session_changed(self): """ Returns: - True if the config session has uncommited changes, False otherwise. + True if the config session has uncommitted changes, False otherwise. """ raise NotImplementedError(f"function not available for {type(self)}") @@ -198,7 +198,7 @@ class ConfigSourceSession(ConfigSource): def session_changed(self): """ Returns: - True if the config session has uncommited changes, False otherwise. + True if the config session has uncommitted changes, False otherwise. """ try: self._run(self._make_command('sessionChanged', '')) @@ -245,7 +245,7 @@ class ConfigSourceSession(ConfigSource): # FIXUP: by default, showConfig will give you a diff # if there are uncommitted changes. # The config parser obviously cannot work with diffs, - # so we need to supress diff production using appropriate + # so we need to suppress diff production using appropriate # options for getting either running (active) # or proposed (working) config. if effective: @@ -364,7 +364,7 @@ class ConfigSourceVyconfSession(ConfigSource): def session_changed(self): """ Returns: - True if the config session has uncommited changes, False otherwise. + True if the config session has uncommitted changes, False otherwise. """ try: return self._vyconf_session.session_changed() diff --git a/python/vyos/configtree.py b/python/vyos/configtree.py index afe1d7fe4..61ef6428c 100644 --- a/python/vyos/configtree.py +++ b/python/vyos/configtree.py @@ -282,8 +282,8 @@ class ConfigTree(object): """Set new entry in VyOS configuration. path: configuration path e.g. 'system dns forwarding listen-address' value: value to be added to node, e.g. '172.18.254.201' - replace: True: current occurance will be replaced - False: new value will be appended to current occurances - use + replace: True: current occurrence will be replaced + False: new value will be appended to current occurrences - use this for adding values to a multi node """ diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py index 6e2fd1618..00cde7cdf 100644 --- a/python/vyos/configverify.py +++ b/python/vyos/configverify.py @@ -33,7 +33,7 @@ dynamic_interface_pattern = r'(ppp|pppoe|sstpc|l2tp|ipoe)[0-9]+' def verify_mtu(config): """ Common helper function used by interface implementations to perform - recurring validation if the specified MTU can be used by the underlaying + recurring validation if the specified MTU can be used by the underlying hardware. """ from vyos.ifconfig import Interface @@ -456,7 +456,7 @@ def verify_common_route_maps(config): # XXX: This function is called in combination with a previous call to: # tmp = conf.get_config_dict(['policy']) - see protocols_ospf.py as example. # We should NOT call this with the key_mangling option as this would rename - # route-map hypens '-' to underscores '_' and one could no longer distinguish + # route-map hyphens '-' to underscores '_' and one could no longer distinguish # what should have been the "proper" route-map name, as foo-bar and foo_bar # are two entire different route-map instances! for route_map in ['route-map', 'route_map']: diff --git a/python/vyos/debug.py b/python/vyos/debug.py index 1a6924ef5..3b71693ab 100644 --- a/python/vyos/debug.py +++ b/python/vyos/debug.py @@ -64,7 +64,7 @@ def enabled(flag): - command: print command run with result Having the flag setup on the filesystem is required to have - debuging at boot time, however, setting the flag via environment + debugging at boot time, however, setting the flag via environment does not require a seek to the filesystem and is more efficient it can be done on the shell on via .bashrc for the user diff --git a/python/vyos/defaults.py b/python/vyos/defaults.py index c584ddd77..6aa93ebed 100644 --- a/python/vyos/defaults.py +++ b/python/vyos/defaults.py @@ -52,7 +52,7 @@ systemd_services = { } internal_ports = { - 'certbot_haproxy' : 65080, # Certbot running behing haproxy + 'certbot_haproxy' : 65080, # Certbot running behind haproxy } config_files = { diff --git a/python/vyos/ethtool.py b/python/vyos/ethtool.py index ea3ed0b7c..79db25324 100644 --- a/python/vyos/ethtool.py +++ b/python/vyos/ethtool.py @@ -34,9 +34,9 @@ _drivers_without_bonding_support = _drivers_without_mac_change + [] class Ethtool: """ - Class is used to retrive and cache information about an ethernet adapter + Class is used to retrieve and cache information about an ethernet adapter """ - # dictionary containing driver featurs, it will be populated on demand and + # dictionary containing driver features, it will be populated on demand and # the content will look like: # [{'esp-hw-offload': {'active': False, 'fixed': True, 'requested': False}, # 'esp-tx-csum-hw-offload': {'active': False, @@ -79,7 +79,7 @@ class Ethtool: if driver: self._driver_name = driver.group(1) - # Build a dictinary of supported link-speed and dupley settings. + # Build a dictionary of supported link-speed and dupley settings. # [ { # "ifname": "eth0", # "supported-ports": [ "TP" ], @@ -187,7 +187,7 @@ class Ethtool: def check_speed_duplex(self, speed, duplex): """ Check if the passed speed and duplex combination is supported by - the underlaying network adapter. """ + the underlying network adapter. """ if isinstance(speed, int): speed = str(speed) if speed != 'auto' and not speed.isdigit(): diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py index 1aed31f96..ff69f8266 100644 --- a/python/vyos/frrender.py +++ b/python/vyos/frrender.py @@ -14,7 +14,7 @@ # along with this library. If not, see . """ -Helper class attached to vyos-configd to interfact between our CLI configuration +Helper class attached to vyos-configd to interact between our CLI configuration and FRR. Class will render one full FRR configuration and apply this via frr-reload.py, if the configuration has no errors. @@ -102,7 +102,7 @@ def get_frrender_dict(conf: Config, argv=None) -> dict: def dict_helper_ospf_defaults(ospf, path): # We have gathered the dict representation of the CLI, but there are default - # options which we need to update into the dictionary retrived. + # options which we need to update into the dictionary retrieved. default_values = conf.get_config_defaults(path, key_mangling=('-', '_'), get_first_key=True, recursive=True) @@ -140,7 +140,7 @@ def get_frrender_dict(conf: Config, argv=None) -> dict: def dict_helper_ospfv3_defaults(ospfv3, path): # We have gathered the dict representation of the CLI, but there are default - # options which we need to update into the dictionary retrived. + # options which we need to update into the dictionary retrieved. default_values = conf.get_config_defaults(path, key_mangling=('-', '_'), get_first_key=True, recursive=True) @@ -168,7 +168,7 @@ def get_frrender_dict(conf: Config, argv=None) -> dict: def dict_helper_pim_defaults(pim, path): # We have gathered the dict representation of the CLI, but there are default - # options which we need to update into the dictionary retrived. + # options which we need to update into the dictionary retrieved. default_values = conf.get_config_defaults(path, key_mangling=('-', '_'), get_first_key=True, recursive=True) @@ -510,7 +510,7 @@ def get_frrender_dict(conf: Config, argv=None) -> dict: bgp_vrf_path = ['vrf', 'name', vrf_name, 'protocols', 'bgp'] if 'bgp' in vrf_config.get('protocols', []): # We have gathered the dict representation of the CLI, but there are default - # options which we need to update into the dictionary retrived. + # options which we need to update into the dictionary retrieved. default_values = conf.get_config_defaults(bgp_vrf_path, key_mangling=('-', '_'), get_first_key=True, recursive=True) @@ -818,7 +818,7 @@ class FRRender: output += inline_helper(vrf_config['protocols']) - # remove any accidently added empty newline to not confuse FRR + # remove any accidentally added empty newline to not confuse FRR output = os.linesep.join([s for s in output.splitlines() if s]) if '!!' in output: diff --git a/python/vyos/ifconfig/bond.py b/python/vyos/ifconfig/bond.py index ea38b9c42..ace84c6f2 100644 --- a/python/vyos/ifconfig/bond.py +++ b/python/vyos/ifconfig/bond.py @@ -405,9 +405,9 @@ class BondIf(Interface): return self.set_interface('bond_system_mac', mac) def update(self, config): - """ General helper function which works on a dictionary retrived by + """ General helper function which works on a dictionary retrieved by get_config_dict(). It's main intention is to consolidate the scattered - interface setup code and provide a single point of entry when workin + interface setup code and provide a single point of entry when working on any interface. """ # Use ref-counting function to place an interface into admin down state. @@ -435,7 +435,7 @@ class BondIf(Interface): # administratively down # # We can not move the upper "shutdown_required" code path here - as this - # would break initial bond creation and inital mode assignment during + # would break initial bond creation and initial mode assignment during # interface creation! if self.get_admin_state() == 'down': # Bonding policy/mode - default value, always present @@ -460,10 +460,10 @@ class BondIf(Interface): # result in the following exception: OSError: [Errno 22] Invalid argument. # # We remove ALL addresses prior to adding new ones, this will remove - # addresses manually added by the user too - but as we are limited to 16 adresses + # addresses manually added by the user too - but as we are limited to 16 addresses # from the kernel side this looks valid to me. We won't run into an error - # when a user added manual adresses which would result in having more - # then 16 adresses in total. + # when a user added manual addresses which would result in having more + # then 16 addresses in total. arp_tgt_addr = list(map(str, self.get_arp_ip_target().split())) for addr in arp_tgt_addr: self.set_arp_ip_target('-' + addr) @@ -503,7 +503,7 @@ class BondIf(Interface): self.set_mac(tmp_if.get_mac()) is_first = False - # Assign underlaying interface to logical bond + # Assign underlying interface to logical bond self.add_port(interface) bond_members.append(interface) diff --git a/python/vyos/ifconfig/bridge.py b/python/vyos/ifconfig/bridge.py index ba06e3757..6b5f49778 100644 --- a/python/vyos/ifconfig/bridge.py +++ b/python/vyos/ifconfig/bridge.py @@ -273,9 +273,9 @@ class BridgeIf(Interface): return self.set_interface('vlan_protocol', map[protocol]) def update(self, config): - """ General helper function which works on a dictionary retrived by + """ General helper function which works on a dictionary retrieved by get_config_dict(). It's main intention is to consolidate the scattered - interface setup code and provide a single point of entry when workin + interface setup code and provide a single point of entry when working on any interface. """ # Set ageing time diff --git a/python/vyos/ifconfig/control.py b/python/vyos/ifconfig/control.py index 3cf3297b4..1ef42f981 100644 --- a/python/vyos/ifconfig/control.py +++ b/python/vyos/ifconfig/control.py @@ -33,13 +33,13 @@ class Control(Section): ifname = None def __init__(self, **kargs): - # some commands (such as operation comands - show interfaces, etc.) + # some commands (such as operation commands - show interfaces, etc.) # need to query the interface statistics. If the interface # code is used and the debugging is enabled, the screen output # will include both the command but also the debugging for that command - # to prevent this, debugging can be explicitely disabled + # to prevent this, debugging can be explicitly disabled - # if debug is not explicitely disabled the the config, enable it + # if debug is not explicitly disabled the the config, enable it self.debug = '' if kargs.get('debug', True) and debug.enabled('ifconfig'): self.debug = 'ifconfig' diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py index fb29c018c..c70190e38 100644 --- a/python/vyos/ifconfig/ethernet.py +++ b/python/vyos/ifconfig/ethernet.py @@ -244,7 +244,7 @@ class EthernetIf(Interface): cmd += f' speed {speed} duplex {duplex} autoneg off' return self._cmd(cmd) except PermissionError: - # Some NICs do not tell that they don't suppport settings speed/duplex, + # Some NICs do not tell that they don't support settings speed/duplex, # but they do not actually support it either. # In that case it's probably better to ignore the error # than end up with a broken config. @@ -450,7 +450,7 @@ class EthernetIf(Interface): cmd = f'ethtool --set-ring {ifname} {rx_tx} {size}' output, code = self._popen(cmd) # ethtool error codes: - # 80 - value already setted + # 80 - value already set # 81 - does not possible to set value if code and code != 80: print(f'could not set "{rx_tx}" ring-buffer for {ifname}') @@ -550,9 +550,9 @@ class EthernetIf(Interface): self._cmd(f'/sbin/devlink dev eswitch set pci/{addr} mode legacy') def update(self, config): - """General helper function which works on a dictionary retrived by + """General helper function which works on a dictionary retrieved by get_config_dict(). It's main intention is to consolidate the scattered - interface setup code and provide a single point of entry when workin + interface setup code and provide a single point of entry when working on any interface.""" # disable ethernet flow control (pause frames) diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index c49f497fc..febd68f44 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -498,7 +498,7 @@ class Interface(Control): def get_mac(self): """ - Get current interface MAC (Media Access Contrl) address used. + Get current interface MAC (Media Access Control) address used. Example: >>> from vyos.ifconfig import Interface @@ -554,7 +554,7 @@ class Interface(Control): def set_mac(self, mac): """ - Set interface MAC (Media Access Contrl) address to given value. + Set interface MAC (Media Access Control) address to given value. Example: >>> from vyos.ifconfig import Interface @@ -572,7 +572,7 @@ class Interface(Control): self.set_interface('mac', mac) - # Turn an interface to the 'up' state if it was changed to 'down' by this fucntion + # Turn an interface to the 'up' state if it was changed to 'down' by this function if prev_state == 'up': self.set_admin_state('up') @@ -1528,7 +1528,7 @@ class Interface(Control): render(systemd_override_file, 'dhcp-client/override.conf.j2', self.config) render(dhclient_config_file, 'dhcp-client/ipv4.j2', self.config) - # Reload systemd unit definitons as some options are dynamically generated + # Reload systemd unit definitions as some options are dynamically generated self._cmd('systemctl daemon-reload') # When the DHCP client is restarted a brief outage will occur, as @@ -1543,7 +1543,7 @@ class Interface(Control): if is_systemd_service_active(systemd_service): self._cmd(f'systemctl stop {systemd_service}') - # Smoketests occationally fail if the lease is not removed from the Kernel fast enough: + # Smoketests occasionally fail if the lease is not removed from the Kernel fast enough: # AssertionError: 2 unexpectedly found in {17: [{'addr': '52:54:00:00:00:00', # 'broadcast': 'ff:ff:ff:ff:ff:ff'}], 2: [{'addr': '192.0.2.103', 'netmask': '255.255.255.0', # @@ -1587,7 +1587,7 @@ class Interface(Control): render(config_file, 'dhcp-client/ipv6.j2', config) render(script_file, 'dhcp-client/dhcp6c-script.j2', config, permission=0o755) - # Reload systemd unit definitons as some options are dynamically generated + # Reload systemd unit definitions as some options are dynamically generated self._cmd('systemctl daemon-reload') # We must ignore any return codes. This is required to enable @@ -1610,7 +1610,7 @@ class Interface(Control): # Please refer to the document for details # - https://man7.org/linux/man-pages/man8/tc.8.html # - https://man7.org/linux/man-pages/man8/tc-mirred.8.html - # Depening if we are the source or the target interface of the port + # Depending if we are the source or the target interface of the port # mirror we need to setup some variables. # Don't allow for netns yet @@ -1744,9 +1744,9 @@ class Interface(Control): os.unlink(wpa_supplicant_conf) def update(self, config): - """ General helper function which works on a dictionary retrived by + """ General helper function which works on a dictionary retrieved by get_config_dict(). It's main intention is to consolidate the scattered - interface setup code and provide a single point of entry when workin + interface setup code and provide a single point of entry when working on any interface. """ if self.debug: diff --git a/python/vyos/ifconfig/loopback.py b/python/vyos/ifconfig/loopback.py index f4fc2c906..e2cf69a15 100644 --- a/python/vyos/ifconfig/loopback.py +++ b/python/vyos/ifconfig/loopback.py @@ -56,9 +56,9 @@ class LoopbackIf(Interface): self.del_addr(addr) def update(self, config): - """ General helper function which works on a dictionary retrived by + """ General helper function which works on a dictionary retrieved by get_config_dict(). It's main intention is to consolidate the scattered - interface setup code and provide a single point of entry when workin + interface setup code and provide a single point of entry when working on any interface. """ address = config.get('address', []) diff --git a/python/vyos/ifconfig/tunnel.py b/python/vyos/ifconfig/tunnel.py index f96364161..eb8fcdd1f 100644 --- a/python/vyos/ifconfig/tunnel.py +++ b/python/vyos/ifconfig/tunnel.py @@ -161,7 +161,7 @@ class TunnelIf(Interface): return self.set_interface('multicast', enable) def update(self, config): - """ General helper function which works on a dictionary retrived by + """ General helper function which works on a dictionary retrieved by get_config_dict(). It's main intention is to consolidate the scattered interface setup code and provide a single point of entry when workin on any interface. """ diff --git a/python/vyos/ifconfig/vxlan.py b/python/vyos/ifconfig/vxlan.py index 0f55acf10..974a53566 100644 --- a/python/vyos/ifconfig/vxlan.py +++ b/python/vyos/ifconfig/vxlan.py @@ -190,9 +190,9 @@ class VXLANIf(Interface): self._cmd(f'bridge vni add dev {self.ifname} vni {vni}') def update(self, config): - """ General helper function which works on a dictionary retrived by + """ General helper function which works on a dictionary retrieved by get_config_dict(). It's main intention is to consolidate the scattered - interface setup code and provide a single point of entry when workin + interface setup code and provide a single point of entry when working on any interface. """ # call base class last diff --git a/python/vyos/ifconfig/wireguard.py b/python/vyos/ifconfig/wireguard.py index c4e70056c..fb576bac0 100644 --- a/python/vyos/ifconfig/wireguard.py +++ b/python/vyos/ifconfig/wireguard.py @@ -266,9 +266,9 @@ class WireGuardIf(Interface): return public_keys def update(self, config): - """General helper function which works on a dictionary retrived by + """General helper function which works on a dictionary retrieved by get_config_dict(). It's main intention is to consolidate the scattered - interface setup code and provide a single point of entry when workin + interface setup code and provide a single point of entry when working on any interface.""" # Wireguard base command is identical for every peer diff --git a/python/vyos/ifconfig/wireless.py b/python/vyos/ifconfig/wireless.py index 69fd87347..1026fcd57 100644 --- a/python/vyos/ifconfig/wireless.py +++ b/python/vyos/ifconfig/wireless.py @@ -42,9 +42,9 @@ class WiFiIf(Interface): self._cmd(cmd) def update(self, config): - """ General helper function which works on a dictionary retrived by + """ General helper function which works on a dictionary retrieved by get_config_dict(). It's main intention is to consolidate the scattered - interface setup code and provide a single point of entry when workin + interface setup code and provide a single point of entry when working on any interface. """ # We can not call add_to_bridge() until wpa_supplicant is running, thus diff --git a/python/vyos/ipsec.py b/python/vyos/ipsec.py index 81f3d0812..0d03f8cf9 100644 --- a/python/vyos/ipsec.py +++ b/python/vyos/ipsec.py @@ -65,7 +65,7 @@ def get_vici_sas_by_name(ike_name: str, tunnel: str) -> list: Find installed SAs by IKE_SA name and/or CHILD_SA name and return list with SASs info. If tunnel is not None return a list contained only - CHILD_SAs wich names equal tunnel value. + CHILD_SAs which names equal tunnel value. :param ike_name: IKE SA name :type ike_name: str :param tunnel: CHILD SA name diff --git a/python/vyos/kea.py b/python/vyos/kea.py index a8b38d999..c950a0d67 100644 --- a/python/vyos/kea.py +++ b/python/vyos/kea.py @@ -79,7 +79,7 @@ def _format_hex_string(in_str): def _find_list_of_dict_index(lst, key='ip', value=''): """ Find the index entry of list of dict matching the dict value - Exampe: + Example: % lst = [{'ip': '192.0.2.1'}, {'ip': '192.0.2.2'}] % _find_list_of_dict_index(lst, key='ip', value='192.0.2.2') % 1 @@ -658,7 +658,7 @@ def kea_get_server_leases(config, inet, vrf_name, pools=[], state=[], origin=Non now = datetime.now(timezone.utc) if lease['valid-lft'] > 0 and lease['expire_time'] > now: - # substraction gives us a timedelta object which can't be formatted + # subtraction gives us a timedelta object which can't be formatted # with strftime so we use str(), split gets rid of the microseconds data_lease['remaining'] = str(lease['expire_time'] - now).split('.')[0] diff --git a/python/vyos/system/compat.py b/python/vyos/system/compat.py index 23a34d38a..f4a50b237 100644 --- a/python/vyos/system/compat.py +++ b/python/vyos/system/compat.py @@ -179,7 +179,7 @@ def prune_vyos_versions(root_dir: str = '') -> None: def update_cfg_ver(root_dir:str = '') -> int: - """Get minumum version of image-tools across all installed images + """Get minimum version of image-tools across all installed images Args: root_dir (str): an optional path to the root directory diff --git a/python/vyos/system/disk.py b/python/vyos/system/disk.py index 268a3b195..7ae9a15bb 100644 --- a/python/vyos/system/disk.py +++ b/python/vyos/system/disk.py @@ -50,7 +50,7 @@ def find_persistence() -> str: """Find a mountpoint for persistence storage Returns: - str: Path where 'persistance' pertition is mounted, Empty if not found + str: Path where 'persistence' pertition is mounted, Empty if not found """ mounted_partitions = disk_partitions() for partition in mounted_partitions: @@ -77,7 +77,7 @@ def parttable_create(drive_path: str, root_size: int) -> None: -n3:0:+{root_size_text}K -t3:8300 {drive_path}' run(command) - # update partitons in kernel + # update partitions in kernel sync() run(f'partx -u {drive_path}') diff --git a/python/vyos/utils/assertion.py b/python/vyos/utils/assertion.py index aa0614743..35baa556b 100644 --- a/python/vyos/utils/assertion.py +++ b/python/vyos/utils/assertion.py @@ -57,7 +57,7 @@ def assert_mac(m, test_all_zero=True): split = m.split(':') size = len(split) - # a mac address consits out of 6 octets + # a mac address consists out of 6 octets if size != 6: raise ValueError(f'wrong number of MAC octets ({size}): {m}') diff --git a/python/vyos/utils/auth.py b/python/vyos/utils/auth.py index f9551419f..7123bd0a5 100644 --- a/python/vyos/utils/auth.py +++ b/python/vyos/utils/auth.py @@ -28,7 +28,7 @@ from vyos.utils.process import cmd # Minimum UID used when adding system users MIN_USER_UID: int = 1000 -# Maximim UID used when adding system users +# Maximum UID used when adding system users MAX_USER_UID: int = 59999 # List of local user accounts that must be preserved SYSTEM_USER_SKIP_LIST: frozenset = { diff --git a/python/vyos/utils/dict.py b/python/vyos/utils/dict.py index 5d41900b6..3fcda902f 100644 --- a/python/vyos/utils/dict.py +++ b/python/vyos/utils/dict.py @@ -187,7 +187,7 @@ def dict_search_args(dict_object, *path): return dict_object def dict_search_recursive(dict_object, key, path=[]): - """ Traverse a dictionary recurisvely and return the value of the key + """ Traverse a dictionary recursively and return the value of the key we are looking for. Thankfully copied from https://stackoverflow.com/a/19871956 @@ -380,7 +380,7 @@ def check_mutually_exclusive_options(d, keys, required=False): class FixedDict(dict): """ - FixedDict: A dictionnary not allowing new keys to be created after initialisation. + FixedDict: A dictionary not allowing new keys to be created after initialisation. >>> f = FixedDict(**{'count':1}) >>> f['count'] = 2 diff --git a/python/vyos/utils/network.py b/python/vyos/utils/network.py index de283e546..366433146 100644 --- a/python/vyos/utils/network.py +++ b/python/vyos/utils/network.py @@ -178,7 +178,7 @@ def get_interface_address(interface): def get_interface_namespace(interface: str): """ - Returns wich netns the interface belongs to + Returns which netns the interface belongs to """ # Bail out early if netns does not exist tmp = cmd(f'ip --json netns ls') diff --git a/python/vyos/utils/process.py b/python/vyos/utils/process.py index 74546a172..94d6670dc 100644 --- a/python/vyos/utils/process.py +++ b/python/vyos/utils/process.py @@ -56,7 +56,7 @@ def popen(command, flag='', shell=None, input=None, timeout=None, env=None, - STDOUT, send the data to be merged with stdout - DEVNULL, discard the output decode: specify the expected text encoding (utf-8, ascii, ...) - the default is explicitely utf-8 which is python's own default + the default is explicitly utf-8 which is python's own default vrf: run command in a VRF context netns: run command in the named network namespace buffered: define how process output shall be presented to stdout @@ -69,7 +69,7 @@ def popen(command, flag='', shell=None, input=None, timeout=None, env=None, """ # airbag must be left as an import in the function as otherwise we have a - # a circual import dependency + # a circular import dependency from vyos import debug from vyos import airbag diff --git a/python/vyos/utils/system.py b/python/vyos/utils/system.py index e2197daf2..578537544 100644 --- a/python/vyos/utils/system.py +++ b/python/vyos/utils/system.py @@ -80,7 +80,7 @@ def sysctl_apply(sysctl_dict: dict[str, str], revert: bool = True) -> bool: return True def find_device_file(device): - """ Recurively search /dev for the given device file and return its full path. + """ Recursively search /dev for the given device file and return its full path. If no device file was found 'None' is returned """ from fnmatch import fnmatch diff --git a/python/vyos/utils/vti_updown_db.py b/python/vyos/utils/vti_updown_db.py index 0587b48e8..2931df86c 100644 --- a/python/vyos/utils/vti_updown_db.py +++ b/python/vyos/utils/vti_updown_db.py @@ -111,7 +111,7 @@ class VTIUpDownDB: """ Removes a matching entry from the DB. - If no matching entry can be fonud, the operation returns successfully. + If no matching entry can be found, the operation returns successfully. """ ifspec = f"{interface}:{connection}:{protocol}" if (connection is not None and protocol is not None) else interface if ifspec in self._ifspecs: diff --git a/python/vyos/vpp/control_host.py b/python/vyos/vpp/control_host.py index 9808c9418..707f56740 100644 --- a/python/vyos/vpp/control_host.py +++ b/python/vyos/vpp/control_host.py @@ -420,7 +420,7 @@ def get_eth_mac(iface_name: str) -> str: def xdp_remove(iface_name: str) -> None: - """Remove XDP BPF program from an interfce + """Remove XDP BPF program from an interface Args: iface_name (str): name of an interface diff --git a/python/vyos/vyconf_session.py b/python/vyos/vyconf_session.py index 5748ab2dd..91e51338c 100644 --- a/python/vyos/vyconf_session.py +++ b/python/vyos/vyconf_session.py @@ -111,7 +111,7 @@ class VyconfSession: def exit_config_mode(self): if self.session_changed(): - return 'Uncommited changes', Errnum.UNCOMMITED_CHANGES + return 'Uncommitted changes', Errnum.UNCOMMITED_CHANGES out = vyconf_client.send_request('exit_configuration_mode', token=self.__token) return self.output(out), out.status diff --git a/python/vyos/xml_ref/definition.py b/python/vyos/xml_ref/definition.py index 015e7ee6e..cee762b02 100644 --- a/python/vyos/xml_ref/definition.py +++ b/python/vyos/xml_ref/definition.py @@ -104,7 +104,7 @@ class Xml: if self.exists(path): if self.is_valueless(path) or not self.is_leaf(path): # It's a complete path for a valueless node - # or a path to an empy non-leaf node + # or a path to an empty non-leaf node return (path, None) else: raise ValueError(f'Path "{path}" needs a value or children') diff --git a/python/vyos/xml_ref/generate_cache.py b/python/vyos/xml_ref/generate_cache.py index f0a3ec35b..daea50dc9 100755 --- a/python/vyos/xml_ref/generate_cache.py +++ b/python/vyos/xml_ref/generate_cache.py @@ -52,7 +52,7 @@ def non_trivial(s): return s def main(): - parser = ArgumentParser(description='generate and save dict from xml defintions') + parser = ArgumentParser(description='generate and save dict from xml definitions') parser.add_argument('--xml-dir', type=str, required=True, help='transcluded xml interface-definition directory') parser.add_argument('--internal-cache', type=str, required=True, diff --git a/python/vyos/xml_ref/generate_op_cache.py b/python/vyos/xml_ref/generate_op_cache.py index 1c183fc8c..ca939f550 100755 --- a/python/vyos/xml_ref/generate_op_cache.py +++ b/python/vyos/xml_ref/generate_op_cache.py @@ -89,7 +89,7 @@ def translate_command(s: str, pos: list[str]) -> str: s = translate_exec(s) s = translate_position(s, pos) - # If there are any untranslated occurences of '_place_holder_", + # If there are any untranslated occurrences of "_place_holder_", # it means the command is incorrect, # e.g., it references "$6" when it only has five words. if re.search(r'_place_holder_', s): @@ -317,7 +317,7 @@ def main(): # pylint: disable=global-statement global CHECK_XML_CONSISTENCY - parser = ArgumentParser(description='generate dict from xml defintions') + parser = ArgumentParser(description='generate dict from xml definitions') parser.add_argument( '--xml-dir', type=str, -- cgit v1.2.3