diff --git a/brewtils/models.py b/brewtils/models.py index ed482c72..8af1baf0 100644 --- a/brewtils/models.py +++ b/brewtils/models.py @@ -1209,7 +1209,7 @@ def __init__( status=None, max_instances=None, timeout=None, - replication_id=None, + replication=None, ): self.id = id self.name = name @@ -1226,7 +1226,7 @@ def __init__( self.status = status self.max_instances = max_instances self.timeout = timeout - self.replication_id = replication_id + self.replication = replication def __str__(self): return "%s: %s" % (self.name, self.id) diff --git a/brewtils/schemas.py b/brewtils/schemas.py index 0fcc99bd..96a633c2 100644 --- a/brewtils/schemas.py +++ b/brewtils/schemas.py @@ -545,7 +545,7 @@ class JobSchema(BaseSchema): status = fields.Str(allow_none=True) max_instances = fields.Int(allow_none=True) timeout = fields.Int(allow_none=True) - replication_id = fields.Str(allow_none=True) + replication = fields.Nested("ReplicationSchema", allow_none=True) class JobExportInputSchema(BaseSchema): diff --git a/brewtils/test/comparable.py b/brewtils/test/comparable.py index ba733765..c03f92c0 100644 --- a/brewtils/test/comparable.py +++ b/brewtils/test/comparable.py @@ -333,6 +333,7 @@ def assert_job_equal(obj1, obj2, do_raise=False): deep_fields={ "trigger": partial(assert_trigger_equal, do_raise=True), "request_template": partial(assert_request_template_equal, do_raise=True), + "replication": partial(assert_replication_equal, do_raise=True), }, do_raise=do_raise, ) diff --git a/brewtils/test/fixtures.py b/brewtils/test/fixtures.py index a7db6e51..11183db5 100644 --- a/brewtils/test/fixtures.py +++ b/brewtils/test/fixtures.py @@ -566,7 +566,7 @@ def bg_role(legacy_role_dict): @pytest.fixture -def job_dict(ts_epoch, request_template_dict, date_trigger_dict): +def job_dict(ts_epoch, request_template_dict, date_trigger_dict, replication_dict): """A date job represented as a dictionary.""" return { "name": "job_name", @@ -584,7 +584,7 @@ def job_dict(ts_epoch, request_template_dict, date_trigger_dict): "status": "RUNNING", "max_instances": 3, "timeout": 30, - "replication_id": "123", + "replication": replication_dict, } @@ -642,12 +642,13 @@ def job_dict_for_import(job_dict): @pytest.fixture -def bg_job(job_dict, ts_dt, bg_request_template, bg_date_trigger): +def bg_job(job_dict, ts_dt, bg_request_template, bg_date_trigger, bg_replication): """A job as a model.""" dict_copy = copy.deepcopy(job_dict) dict_copy["next_run_time"] = ts_dt dict_copy["trigger"] = bg_date_trigger dict_copy["request_template"] = bg_request_template + dict_copy["replication"] = bg_replication return Job(**dict_copy) @@ -658,6 +659,7 @@ def bg_cron_job(cron_job_dict, bg_request_template, bg_cron_trigger, ts_dt): dict_copy["next_run_time"] = ts_dt dict_copy["trigger"] = bg_cron_trigger dict_copy["request_template"] = bg_request_template + dict_copy["replication"] = bg_replication return Job(**dict_copy) @@ -668,6 +670,7 @@ def bg_interval_job(interval_job_dict, bg_request_template, bg_interval_trigger, dict_copy["next_run_time"] = ts_dt dict_copy["trigger"] = bg_interval_trigger dict_copy["request_template"] = bg_request_template + dict_copy["replication"] = bg_replication return Job(**dict_copy)