summaryrefslogtreecommitdiff
path: root/python/vyos/util.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-11-26 07:39:45 +0100
committerGitHub <noreply@github.com>2021-11-26 07:39:45 +0100
commit1df8ba611f04c46d49f4cf70d6fa22cfef089392 (patch)
tree4d6ce5a6e4fbe0bba93336a75ac2d16dfe98fe5a /python/vyos/util.py
parentfed88cda4722024fdfcb5c2951f074fa6caf4d7c (diff)
parent6577c9725e74c564f23a87e1f91050900f258fe9 (diff)
downloadvyos-1x-1df8ba611f04c46d49f4cf70d6fa22cfef089392.tar.gz
vyos-1x-1df8ba611f04c46d49f4cf70d6fa22cfef089392.zip
Merge pull request #1080 from erkin/current
remote: T3356: Rewrite remote.py
Diffstat (limited to 'python/vyos/util.py')
-rw-r--r--python/vyos/util.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py
index 9aa1f98d2..d8e83ab8d 100644
--- a/python/vyos/util.py
+++ b/python/vyos/util.py
@@ -856,6 +856,20 @@ def make_incremental_progressbar(increment: float):
while True:
yield
+def begin(*args):
+ """
+ Evaluate arguments in order and return the result of the *last* argument.
+ For combining multiple expressions in one statement. Useful for lambdas.
+ """
+ return args[-1]
+
+def begin0(*args):
+ """
+ Evaluate arguments in order and return the result of the *first* argument.
+ For combining multiple expressions in one statement. Useful for lambdas.
+ """
+ return args[0]
+
def is_systemd_service_active(service):
""" Test is a specified systemd service is activated.
Returns True if service is active, false otherwise.