diff --git a/brewtils/models.py b/brewtils/models.py index 53e9f09c..344c5c64 100644 --- a/brewtils/models.py +++ b/brewtils/models.py @@ -1406,24 +1406,44 @@ def scheduler_kwargs(self): class FileTrigger(BaseModel): schema = "FileTriggerSchema" - def __init__(self, pattern=None, path=None, recursive=None): + def __init__( + self, + pattern=None, + path=None, + recursive=None, + create=None, + modify=None, + move=None, + delete=None, + ): self.pattern = pattern self.path = path self.recursive = recursive + self.create = create + self.modify = modify + self.move = move + self.delete = delete def __str__(self): return repr(self) def __repr__(self): - return "" % ( + return ( + "" + ) % ( self.pattern, self.path, self.recursive, + self.create, + self.modify, + self.move, + self.delete, ) @property def scheduler_attributes(self): - return ["pattern", "path", "recursive"] + return ["pattern", "path", "recursive", "create", "modify", "move", "delete"] @property def scheduler_kwargs(self): @@ -1433,6 +1453,10 @@ def scheduler_kwargs(self): "pattern": self.pattern, "path": self.path, "recursive": self.recursive, + "create": self.create, + "modify": self.modify, + "move": self.move, + "delete": self.delete, } ) diff --git a/brewtils/schemas.py b/brewtils/schemas.py index 33b3bdc7..02155e79 100644 --- a/brewtils/schemas.py +++ b/brewtils/schemas.py @@ -489,6 +489,10 @@ class FileTriggerSchema(BaseSchema): pattern = fields.Str(allow_none=True) path = fields.Str(allow_none=True) recursive = fields.Bool(allow_none=True) + create = fields.Bool(allow_none=True) + modify = fields.Bool(allow_none=True) + move = fields.Bool(allow_none=True) + delete = fields.Bool(allow_none=True) class ConnectionSchema(BaseSchema): diff --git a/brewtils/test/fixtures.py b/brewtils/test/fixtures.py index 084417bd..95f41a30 100644 --- a/brewtils/test/fixtures.py +++ b/brewtils/test/fixtures.py @@ -783,6 +783,10 @@ def file_trigger_dict(): "path": "./input", "pattern": "*", "recursive": False, + "create": True, + "modify": False, + "move": False, + "delete": False, } diff --git a/test/models_test.py b/test/models_test.py index 93c6b863..366e2c94 100644 --- a/test/models_test.py +++ b/test/models_test.py @@ -572,6 +572,10 @@ def test_schedule_kwargs_default(self, bg_file_trigger): "path": "./input", "pattern": "*", "recursive": False, + "create": True, + "modify": False, + "move": False, + "delete": False, } @@ -642,8 +646,14 @@ def test_scheduler_kwargs( ), ( lazy_fixture("bg_file_trigger"), - "", - "", + ( + "" + ), + ( + "" + ), ), ( lazy_fixture("bg_interval_trigger"),