ServicePort.py 659 B

1234567891011121314151617181920212223242526
  1. from Base import Base
  2. from Util import Strings
  3. class ServicePort(Base):
  4. # Contains object id created to database to table profile
  5. idDataBaseProfile = 0
  6. number = None
  7. gemport = None
  8. vlan = None
  9. type = None
  10. def __init__(self):
  11. Base.__init__(self)
  12. def get_service_port(self):
  13. """
  14. Get the service-port number
  15. :return: Return the service-port number or blank
  16. """
  17. data_compare = self.name.lower().split()
  18. index = Strings.index_value(data_compare, "service-port")
  19. if index >= 0:
  20. return data_compare[index + 1].strip()
  21. else:
  22. return ""