1234567891011121314151617181920 |
- from Base import Base
- from Util import Strings
- class SwitchPort(Base):
- def __init__(self):
- Base.__init__(self)
- def get_vlan_id(self):
- """
- Obtain vlan id from property name
- :return: Returns id of the vlan or blank
- """
- data_compare = self.name.lower().split()
- index = Strings.index_value(data_compare, "vlan")
- if index >= 0:
- return data_compare[index + 1].strip()
- else:
- return ""
|