From daaddab038c86094f5bcca964c1e723468cdacf3 Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Sat, 8 May 2021 23:36:36 +0100 Subject: [PATCH] propagate return value from @deploy decorator e.g. this allows writing code like: @deploy def ripgrep(**kwargs): return apt.packages('ripgrep', **kwargs) res = ripgrep() if res.changed: # do something else --- pyinfra/api/deploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyinfra/api/deploy.py b/pyinfra/api/deploy.py index d805ebb55..85cdca64d 100644 --- a/pyinfra/api/deploy.py +++ b/pyinfra/api/deploy.py @@ -139,6 +139,6 @@ def decorated_func(*args, **kwargs): data=deploy_data, deploy_op_order=deploy_op_order, ): - func(*args, **kwargs) + return func(*args, **kwargs) return decorated_func