def _start_local_services_if_needed(self, master_url):
        """
        In the case that:

        - the master url is localhost
        - the slaves list is just localhost

        Start a master and slave service instance locally, if the master is not already running.

        :param master_url: service url (with port number)
        :type master_url: str
        """
        service_runner = ServiceRunner(master_url)
        if service_runner.is_master_up():
            return
        try:
            service_runner.run_master()
            service_runner.run_slave()
        except ServiceRunError as ex:
            self._logger.error(str(ex))
            sys.exit(1)
Example #2
0
    def _start_local_services_if_needed(self, master_url):
        """
        In the case that:

        - the master url is localhost
        - the slaves list is just localhost

        Start a master and slave service instance locally, if the master is not already running.

        :param master_url: service url (with port number)
        :type master_url: str
        """
        service_runner = ServiceRunner(master_url)
        if service_runner.is_master_up():
            return
        try:
            service_runner.run_master()
            service_runner.run_slave()
        except ServiceRunError as ex:
            self._logger.error(str(ex))
            sys.exit(1)