def is_oppia_server_already_running(): """Check if the ports are taken by any other processes. If any one of them is taken, it may indicate there is already one Oppia instance running. Returns: bool. Whether there is a running Oppia instance. """ for port in PORTS_USED_BY_OPPIA_PROCESSES: if common.is_port_in_use(port): print('There is already a server running on localhost:%s. ' 'Please terminate it before running the end-to-end tests. ' 'Exiting.' % port) return True return False
def is_oppia_server_already_running(): """Check if the ports are taken by any other processes. If any one of them is taken, it may indicate there is already one Oppia instance running. Returns: bool. Whether there is a running Oppia instance. """ for port in [OPPIA_SERVER_PORT, GOOGLE_APP_ENGINE_PORT]: if common.is_port_in_use(port): python_utils.PRINT( 'There is already a server running on localhost:%s.' 'Please terminate it before running the end-to-end tests.' 'Exiting.' % port) return True return False