summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/ifconfig.py29
1 files changed, 5 insertions, 24 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index 749bc6a1a..86e2084d3 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -261,36 +261,17 @@ class Interface:
else:
raise ValueError("Value out of range")
- @property
- def ifalias(self):
- """
- Get/set interface alias name
-
- Example:
-
- >>> from vyos.ifconfig import Interface
- >>> Interface('eth0').ifalias
- ''
- """
- return self._read_sysfs('/sys/class/net/{}/ifalias'
- .format(self._ifname))
-
- @ifalias.setter
- def ifalias(self, ifalias=None):
+ def set_alias(self, ifalias=None):
"""
- Get/set interface alias name
+ Set interface alias name used by e.g. SNMP
Example:
>>> from vyos.ifconfig import Interface
- >>> Interface('eth0').ifalias = 'VyOS upstream interface'
- >>> Interface('eth0').ifalias
- 'VyOS upstream interface'
+ >>> Interface('eth0').set_alias('VyOS upstream interface')
- to clear interface alias e.g. delete it use:
+ to clear alias e.g. delete it use:
- >>> Interface('eth0').ifalias = ''
- >>> Interface('eth0').ifalias
- ''
+ >>> Interface('eth0').set_ifalias('')
"""
if not ifalias:
# clear interface alias