Commit 5773c103 authored by Samuel GAIST's avatar Samuel GAIST Committed by André Anjos

[utils][commands][scheduler] Change port for address as parameter

The broker might be on another machine.
parent b79bec25
......@@ -82,12 +82,12 @@ class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
"--port",
"-p",
type=int,
dest="port",
default=5555,
help="Port of the broker",
"--broker-address",
"-b",
type=str,
dest="broker_address",
default="tcp://localhost:5555",
help="Address of the broker",
)
parser.add_argument(
"--interval",
......@@ -102,8 +102,9 @@ class Command(BaseCommand):
signal.signal(signal.SIGTERM, self.__signal_handler)
signal.signal(signal.SIGINT, self.__signal_handler)
broker_address = "tcp://localhost:{}".format(options["port"])
client = BeatComputationClient(broker_address, options["verbosity"] >= 2)
client = BeatComputationClient(
options["broker_address"], options["verbosity"] >= 2
)
# client.timeout = 100
running_job_splits = []
......
......@@ -63,9 +63,9 @@ def start_worker(worker_name, broker_address, prefix, cache, verbosity=0):
)
def start_scheduler(port, verbosity=0):
def start_scheduler(broker_address, verbosity=0):
db.connections.close_all()
call_command("scheduler", port=port, verbosity=verbosity)
call_command("scheduler", broker_address=broker_address, verbosity=verbosity)
class WorkerRegistration(TransactionTestCase):
......@@ -183,7 +183,7 @@ class TestSchedulerBase(TransactionTestCase, BackendUtilitiesMixin):
verbosity = self.command_verbosity
self.scheduler = multiprocessing.Process(
target=start_scheduler, args=(self.port, verbosity)
target=start_scheduler, args=(self.broker_address, verbosity)
)
self.scheduler.start()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment