
From: Stephan Conrad <stephan.conrad@gmail.com> Signed-off-by: Stephan Conrad <stephan.conrad@gmail.com> --- src/wok/proxy.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wok/proxy.py b/src/wok/proxy.py index 574a3b3..f281522 100644 --- a/src/wok/proxy.py +++ b/src/wok/proxy.py @@ -50,11 +50,11 @@ def _create_proxy_config(options): user_proxy = None user_list = ('nginx', 'www-data', 'http') sys_users = [p.pw_name for p in pwd.getpwall()] - for user in user_list: - if user in sys_users: - user_proxy = user - break - + common_users = list(set(user_list) & set(sys_users)) + if len(common_users) == 0: + raise Exception("No common user found") + else: + user_proxy = common_users[0] config_dir = paths.conf_dir nginx_config_dir = paths.nginx_conf_dir cert = options.ssl_cert -- 2.6.3