[Kimchi-devel] [PATCH 2/2] Change the code like suggested by Aline Manera

stephan.conrad at gmail.com stephan.conrad at gmail.com
Thu Dec 3 17:11:34 UTC 2015


From: Stephan Conrad <stephan.conrad at gmail.com>

Signed-off-by: Stephan Conrad <stephan.conrad at 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




More information about the Kimchi-devel mailing list