summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configdict.py8
-rw-r--r--python/vyos/configverify.py18
-rw-r--r--python/vyos/flavor.py2
-rw-r--r--python/vyos/frrender.py2
-rw-r--r--python/vyos/ifconfig/bond.py4
-rw-r--r--python/vyos/ifconfig/bridge.py2
-rw-r--r--python/vyos/ifconfig/interface.py8
-rw-r--r--python/vyos/ifconfig/loopback.py4
-rw-r--r--python/vyos/ifconfig/pppoe.py6
-rw-r--r--python/vyos/ifconfig/section.py2
-rw-r--r--python/vyos/ifconfig/sstpc.py4
-rw-r--r--python/vyos/ifconfig/vxlan.py2
-rw-r--r--python/vyos/ifconfig/wireless.py2
-rw-r--r--python/vyos/ifconfig/wwan.py2
-rw-r--r--python/vyos/qos/base.py2
-rwxr-xr-xpython/vyos/template.py12
-rw-r--r--python/vyos/version.py2
17 files changed, 41 insertions, 41 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index 0603b42b8..e721942ca 100644
--- a/python/vyos/configdict.py
+++ b/python/vyos/configdict.py
@@ -340,7 +340,7 @@ def is_source_interface(conf, interface, intftype=None):
raise ValueError(f'Interface type "{type(intftype)}" must be either str or list!')
if not all(x in intftypes for x in intftype):
- raise ValueError(f'unknown interface type "{intftype}" or it can not '
+ raise ValueError(f'unknown interface type "{intftype}" or it cannot '
'have a source-interface')
for it in intftype:
@@ -547,7 +547,7 @@ def get_interface_dict(config, base, ifname='', recursive_defaults=True, with_pk
bridge = is_member(config, f'{ifname}.{vif}', 'bridge')
if bridge: dict['vif'][vif].update({'is_bridge_member' : bridge})
- # 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, 'vif', vif, 'dhcp-options'])
if dhcp: dict['vif'][vif].update({'dhcp_options_changed' : {}})
dhcpv6 = is_node_changed(config, base + [ifname, 'vif', vif, 'dhcpv6-options'])
@@ -575,7 +575,7 @@ def get_interface_dict(config, base, ifname='', recursive_defaults=True, with_pk
bridge = is_member(config, f'{ifname}.{vif_s}', 'bridge')
if bridge: dict['vif_s'][vif_s].update({'is_bridge_member' : bridge})
- # 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, 'vif-s', vif_s, 'dhcp-options'])
if dhcp: dict['vif_s'][vif_s].update({'dhcp_options_changed' : {}})
dhcpv6 = is_node_changed(config, base + [ifname, 'vif-s', vif_s, 'dhcpv6-options'])
@@ -605,7 +605,7 @@ def get_interface_dict(config, base, ifname='', recursive_defaults=True, with_pk
if bridge: dict['vif_s'][vif_s]['vif_c'][vif_c].update(
{'is_bridge_member' : bridge})
- # 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, 'vif-s', vif_s, 'vif-c', vif_c, 'dhcp-options'])
if dhcp: dict['vif_s'][vif_s]['vif_c'][vif_c].update({'dhcp_options_changed' : {}})
dhcpv6 = is_node_changed(config, base + [ifname, 'vif-s', vif_s, 'vif-c', vif_c, 'dhcpv6-options'])
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index 00cde7cdf..bb17c152c 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -128,9 +128,9 @@ def verify_bond_bridge_member(config):
if 'vrf' in config:
ifname = config['ifname']
if 'is_bond_member' in config:
- raise ConfigError(f'Can not add interface "{ifname}" to bond, it has a VRF assigned!')
+ raise ConfigError(f'Cannot add interface "{ifname}" to bond, it has a VRF assigned!')
if 'is_bridge_member' in config:
- raise ConfigError(f'Can not add interface "{ifname}" to bridge, it has a VRF assigned!')
+ raise ConfigError(f'Cannot add interface "{ifname}" to bridge, it has a VRF assigned!')
def verify_tunnel(config):
"""
@@ -167,11 +167,11 @@ def verify_tunnel(config):
if config['encapsulation'] in ['sit', 'gretap', 'ip6gretap']:
if 'source_interface' in config:
encapsulation = config['encapsulation']
- raise ConfigError(f'Option source-interface can not be used with ' \
+ raise ConfigError(f'Option source-interface cannot be used with ' \
f'encapsulation "{encapsulation}"!')
elif config['encapsulation'] == 'gre':
if 'source_address' in config and is_ipv6(config['source_address']):
- raise ConfigError('Can not use local IPv6 address is for mGRE tunnels')
+ raise ConfigError('Cannot use local IPv6 address is for mGRE tunnels')
def verify_mirror_redirect(config):
"""
@@ -181,12 +181,12 @@ def verify_mirror_redirect(config):
It makes no sense to mirror traffic back at yourself!
"""
if 'mirror' in config and 'redirect' in config:
- raise ConfigError('Mirror and redirect can not be enabled at the same time!')
+ raise ConfigError('Mirror and redirect cannot be enabled at the same time!')
if 'mirror' in config and 'qos' in config:
# XXX: support combination of limiting and mirror - this is an artificial
# limitation from the past
- raise ConfigError('Can not use QoS together with mirror!')
+ raise ConfigError('Cannot use QoS together with mirror!')
if 'mirror' in config:
for direction, mirror_interface in config['mirror'].items():
@@ -195,7 +195,7 @@ def verify_mirror_redirect(config):
'does not exist!')
if mirror_interface == config['ifname']:
- raise ConfigError(f'Can not mirror "{direction}" traffic back '\
+ raise ConfigError(f'Cannot mirror "{direction}" traffic back '\
'the originating interface!')
if 'redirect' in config:
@@ -322,7 +322,7 @@ def verify_source_interface(config):
# We do not allow sourcing other interfaces (e.g. tunnel) from dynamic interfaces
tmp = re.compile(dynamic_interface_pattern)
if tmp.match(src_ifname):
- raise ConfigError(f'Can not source "{ifname}" from dynamic interface "{src_ifname}"!')
+ raise ConfigError(f'Cannot source "{ifname}" from dynamic interface "{src_ifname}"!')
if not interface_exists(src_ifname):
raise ConfigError(f'Specified source-interface {src_ifname} does not exist')
@@ -339,7 +339,7 @@ def verify_source_interface(config):
if 'is_source_interface' in config:
tmp = config['is_source_interface']
- raise ConfigError(f'Can not use source-interface "{src_ifname}", it already ' \
+ raise ConfigError(f'Cannot use source-interface "{src_ifname}", it already ' \
f'belongs to interface "{tmp}"!')
def verify_dhcpv6(config):
diff --git a/python/vyos/flavor.py b/python/vyos/flavor.py
index a9dccf448..05e72be82 100644
--- a/python/vyos/flavor.py
+++ b/python/vyos/flavor.py
@@ -42,7 +42,7 @@ def get_flavor_data(fname=flavor_file):
file (str): path to the flavor file
Returns:
- dict: flavor data, if it can not be found and empty dict
+ dict: flavor data, if it cannot be found and empty dict
The optional ``file`` argument comes in handy in upgrade scripts
that need to retrieve information from images other than the running image.
diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py
index 27b8b8568..7c9a72c50 100644
--- a/python/vyos/frrender.py
+++ b/python/vyos/frrender.py
@@ -778,7 +778,7 @@ class FRRender:
return output
debug('FRR: START CONFIGURATION RENDERING')
- # we can not reload an empty file, thus we always embed the marker
+ # we cannot reload an empty file, thus we always embed the marker
output = '!\n'
# FRR profile configuration
diff --git a/python/vyos/ifconfig/bond.py b/python/vyos/ifconfig/bond.py
index ace84c6f2..5171f12ab 100644
--- a/python/vyos/ifconfig/bond.py
+++ b/python/vyos/ifconfig/bond.py
@@ -257,7 +257,7 @@ class BondIf(Interface):
"""
# As this function might also be called from update() of a VLAN interface
# we must check if the bond_arp_ip_target retrieval worked or not - as this
- # can not be set for a bond vif interface
+ # cannot be set for a bond vif interface
try:
return self.get_interface('bond_arp_ip_target')
except FileNotFoundError:
@@ -434,7 +434,7 @@ class BondIf(Interface):
# Some interface options can only be changed if the interface is
# administratively down
#
- # We can not move the upper "shutdown_required" code path here - as this
+ # We cannot move the upper "shutdown_required" code path here - as this
# would break initial bond creation and initial mode assignment during
# interface creation!
if self.get_admin_state() == 'down':
diff --git a/python/vyos/ifconfig/bridge.py b/python/vyos/ifconfig/bridge.py
index 5f184f221..f1cc7c0e0 100644
--- a/python/vyos/ifconfig/bridge.py
+++ b/python/vyos/ifconfig/bridge.py
@@ -361,7 +361,7 @@ class BridgeIf(Interface):
self.add_port(interface)
if not interface.startswith('wlan'):
- # always set private-vlan/port isolation - this can not be
+ # always set private-vlan/port isolation - this cannot be
# done when lower link is a wifi link, as it will trigger:
# RTNETLINK answers: Operation not supported
tmp = dict_search('isolated', interface_config)
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index 9cb76ee05..9d6b38fa9 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -355,7 +355,7 @@ class Interface(Control):
# In case a subclass does not define it, we use get to set the default to True
if self.config.get('create', True):
self._create()
- # If we can not connect to the interface then let the caller know
+ # If we cannot connect to the interface then let the caller know
# as the class could not be correctly initialised
else:
raise Exception(f'interface "{ifname}" not found!')
@@ -394,7 +394,7 @@ class Interface(Control):
# remove all assigned IP addresses from interface - this is a bit redundant
# as the kernel will remove all addresses on interface deletion, but we
- # can not delete ALL interfaces, see below.
+ # cannot delete ALL interfaces, see below.
#
# This will internally stop DHCP(v6) if running
self.flush_addrs()
@@ -1592,7 +1592,7 @@ class Interface(Control):
config_base = directories['dhcp6_client_dir']
config_file = f'{config_base}/dhcp6c.{self.ifname}.conf'
- script_file = f'/etc/wide-dhcpv6/dhcp6c.{self.ifname}.script' # can not live under /run b/c of noexec mount option
+ script_file = f'/etc/wide-dhcpv6/dhcp6c.{self.ifname}.script' # cannot live under /run b/c of noexec mount option
systemd_override_file = f'/run/systemd/system/dhcp6c@{self.ifname}.service.d/10-override.conf'
systemd_service = f'dhcp6c@{self.ifname}.service'
@@ -2159,7 +2159,7 @@ class VLANIf(Interface):
lower_interface = glob(f'/sys/class/net/{self.ifname}/lower*/flags')[0]
with open(lower_interface, 'r') as f:
flags = f.read()
- # If parent is not up - bail out as we can not bring up the VLAN.
+ # If parent is not up - bail out as we cannot bring up the VLAN.
# Flags are defined in kernel source include/uapi/linux/if.h
if not int(flags, 16) & 1:
return None
diff --git a/python/vyos/ifconfig/loopback.py b/python/vyos/ifconfig/loopback.py
index e2cf69a15..ef4b0033a 100644
--- a/python/vyos/ifconfig/loopback.py
+++ b/python/vyos/ifconfig/loopback.py
@@ -33,12 +33,12 @@ class LoopbackIf(Interface):
}
def _create(self):
- # we can not create this interface as it is managed by the Kernel
+ # we cannot create this interface as it is managed by the Kernel
pass
def remove(self):
"""
- Loopback interface can not be deleted from operating system. We can
+ Loopback interface cannot be deleted from operating system. We can
only remove all assigned IP addresses.
Example:
diff --git a/python/vyos/ifconfig/pppoe.py b/python/vyos/ifconfig/pppoe.py
index 7c4a6dfbb..0f0640159 100644
--- a/python/vyos/ifconfig/pppoe.py
+++ b/python/vyos/ifconfig/pppoe.py
@@ -71,15 +71,15 @@ class PPPoEIf(Interface):
super().remove()
def _create(self):
- # we can not create this interface as it is managed outside
+ # we cannot create this interface as it is managed outside
pass
def _delete(self):
- # we can not create this interface as it is managed outside
+ # we cannot create this interface as it is managed outside
pass
def del_addr(self, addr):
- # we can not create this interface as it is managed outside
+ # we cannot create this interface as it is managed outside
pass
def get_mac(self):
diff --git a/python/vyos/ifconfig/section.py b/python/vyos/ifconfig/section.py
index c3f803c76..63bbf84ee 100644
--- a/python/vyos/ifconfig/section.py
+++ b/python/vyos/ifconfig/section.py
@@ -130,7 +130,7 @@ class Section:
value *= 100
value += (ord(n) - ord('a'))
value += number
- # vlan are 16 bits, so this can not overflow
+ # vlan are 16 bits, so this cannot overflow
value = (value << 16) + vlan
value = (value << 16) + qinq
return value
diff --git a/python/vyos/ifconfig/sstpc.py b/python/vyos/ifconfig/sstpc.py
index e43a2f177..a84a44265 100644
--- a/python/vyos/ifconfig/sstpc.py
+++ b/python/vyos/ifconfig/sstpc.py
@@ -27,11 +27,11 @@ class SSTPCIf(Interface):
}
def _create(self):
- # we can not create this interface as it is managed outside
+ # we cannot create this interface as it is managed outside
pass
def _delete(self):
- # we can not create this interface as it is managed outside
+ # we cannot create this interface as it is managed outside
pass
def get_mac(self):
diff --git a/python/vyos/ifconfig/vxlan.py b/python/vyos/ifconfig/vxlan.py
index 974a53566..a72cb6201 100644
--- a/python/vyos/ifconfig/vxlan.py
+++ b/python/vyos/ifconfig/vxlan.py
@@ -181,7 +181,7 @@ class VXLANIf(Interface):
vni = vlan_config['vni']
# The following commands must be run one after another,
- # they can not be combined with linux 6.1 and iproute2 6.1
+ # they cannot be combined with linux 6.1 and iproute2 6.1
self._cmd(f'bridge vlan add dev {self.ifname} vid {vlan}')
self._cmd(f'bridge vlan add dev {self.ifname} vid {vlan} tunnel_info id {vni}')
diff --git a/python/vyos/ifconfig/wireless.py b/python/vyos/ifconfig/wireless.py
index 1026fcd57..cafd7d0b4 100644
--- a/python/vyos/ifconfig/wireless.py
+++ b/python/vyos/ifconfig/wireless.py
@@ -47,7 +47,7 @@ class WiFiIf(Interface):
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
+ # We cannot call add_to_bridge() until wpa_supplicant is running, thus
# we will remove the key from the config dict and react to this special
# case in this derived class.
# re-add ourselves to any bridge we might have fallen out of
diff --git a/python/vyos/ifconfig/wwan.py b/python/vyos/ifconfig/wwan.py
index ffd3d0a67..83a92639f 100644
--- a/python/vyos/ifconfig/wwan.py
+++ b/python/vyos/ifconfig/wwan.py
@@ -27,7 +27,7 @@ class WWANIf(Interface):
}
def _create(self):
- # we can not create this interface as it is managed by the Kernel
+ # we cannot create this interface as it is managed by the Kernel
pass
def remove(self):
diff --git a/python/vyos/qos/base.py b/python/vyos/qos/base.py
index 487249714..f77a6e020 100644
--- a/python/vyos/qos/base.py
+++ b/python/vyos/qos/base.py
@@ -199,7 +199,7 @@ class QoSBase:
speed = 1000
default_speed = speed
# Not all interfaces have valid entries in the speed file. PPPoE
- # interfaces have the appropriate speed file, but you can not read it:
+ # interfaces have the appropriate speed file, but you cannot read it:
# cat: /sys/class/net/pppoe7/speed: Invalid argument
try:
speed = read_file(f'/sys/class/net/{self._interface}/speed')
diff --git a/python/vyos/template.py b/python/vyos/template.py
index 9d309370e..8a624d989 100755
--- a/python/vyos/template.py
+++ b/python/vyos/template.py
@@ -124,12 +124,12 @@ def register_clever_function(name, func=None):
_CLEVER_FUNCTIONS[name] = func
return func
-def render_to_string(template, content, formater=None, location=None):
+def render_to_string(template, content, formatter=None, location=None):
"""Render a template from the template directory, raise on any errors.
:param template: the path to the template relative to the template folder
:param content: the dictionary of variables to put into rendering context
- :param formater:
+ :param formatter:
if given, it has to be a callable the rendered string is passed through
The parsed template files are cached, so rendering the same file multiple times
@@ -141,8 +141,8 @@ def render_to_string(template, content, formater=None, location=None):
"""
template = _get_environment(location).get_template(template)
rendered = template.render(content)
- if formater is not None:
- rendered = formater(rendered)
+ if formatter is not None:
+ rendered = formatter(rendered)
return rendered
@@ -150,7 +150,7 @@ def render(
destination,
template,
content,
- formater=None,
+ formatter=None,
permission=None,
user=None,
group=None,
@@ -171,7 +171,7 @@ def render(
# As we are opening the file with 'w', we are performing the rendering before
# calling open() to not accidentally erase the file if rendering fails
- rendered = render_to_string(template, content, formater, location)
+ rendered = render_to_string(template, content, formatter, location)
# Remove any trailing character and always add a new line at the end
rendered = rendered.rstrip() + "\n"
diff --git a/python/vyos/version.py b/python/vyos/version.py
index d62778c4b..4ba44f166 100644
--- a/python/vyos/version.py
+++ b/python/vyos/version.py
@@ -51,7 +51,7 @@ def get_version_data(fname=version_file):
file (str): path to the version file
Returns:
- dict: version data, if it can not be found and empty dict
+ dict: version data, if it cannot be found and empty dict
The optional ``file`` argument comes in handy in upgrade scripts
that need to retrieve information from images other than the running image.