aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-01-25 02:29:31 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2022-01-25 02:29:31 +0300
commitc1720c98a468c5856c29d06c2260d896b53aa160 (patch)
tree99b6e882006c15e1b34ee27e77d615020f2e41c9 /app.py
parenttest/test.sh: print curl output on failure (diff)
downloadlinux-status-c1720c98a468c5856c29d06c2260d896b53aa160.tar.gz
linux-status-c1720c98a468c5856c29d06c2260d896b53aa160.zip
app.py: don't query user info if no users
Diffstat (limited to 'app.py')
-rwxr-xr-xapp.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/app.py b/app.py
index 1ed34a0..67cdd6d 100755
--- a/app.py
+++ b/app.py
@@ -411,9 +411,11 @@ def systemd_users():
yield User(uid, user)
def show_users(users):
+ user_args = [user.name for user in users]
+ if not user_args:
+ return None
properties = 'UID', 'Name', 'RuntimePath'
prop_args = (arg for prop in properties for arg in ('-p', prop))
- user_args = (user.name for user in users)
output = Loginctl('show-user', *prop_args, '--value', *user_args).run().result()
lines = output.splitlines()
# Assuming that for muptiple users, the properties will be separated by