def getHostPort(self): """ Returns the port used by the component link on the host. """ key = 'link-' + self.name + '-port' port = getComponentField(self.parent.name, key, 0) if not port: port = pickUnusedPort() setComponentField(self.parent.name, key, port) return port