[PATCH] Issue #369: Fix config_dir assignment

From: Aline Manera <alinefm@br.ibm.com> In proxy.py, the config_dir was only initialized in a 'if' statement and used outside it. So if the SSL certificate and key were received as parameters, config_dir was undefined. Fix it. Signed-off-by: Aline Manera <alinefm@br.ibm.com> --- src/kimchi/proxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kimchi/proxy.py b/src/kimchi/proxy.py index 7a12bfd..1ccbbcc 100644 --- a/src/kimchi/proxy.py +++ b/src/kimchi/proxy.py @@ -57,9 +57,9 @@ def _create_proxy_config(p_port, k_port, p_ssl_port, cert, key): except KeyError: user_proxy = 'www-data' + config_dir = paths.conf_dir # No certificates specified by the user if not cert or not key: - config_dir = paths.conf_dir cert = '%s/kimchi-cert.pem' % config_dir key = '%s/kimchi-key.pem' % config_dir # create cert files if they don't exist -- 1.7.10.4

Reviewed-by Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com> on 2014/05/09 03:50, Aline Manera wrote:
From: Aline Manera <alinefm@br.ibm.com>
In proxy.py, the config_dir was only initialized in a 'if' statement and used outside it. So if the SSL certificate and key were received as parameters, config_dir was undefined. Fix it.
Signed-off-by: Aline Manera <alinefm@br.ibm.com> --- src/kimchi/proxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/proxy.py b/src/kimchi/proxy.py index 7a12bfd..1ccbbcc 100644 --- a/src/kimchi/proxy.py +++ b/src/kimchi/proxy.py @@ -57,9 +57,9 @@ def _create_proxy_config(p_port, k_port, p_ssl_port, cert, key): except KeyError: user_proxy = 'www-data'
+ config_dir = paths.conf_dir # No certificates specified by the user if not cert or not key: - config_dir = paths.conf_dir cert = '%s/kimchi-cert.pem' % config_dir key = '%s/kimchi-key.pem' % config_dir # create cert files if they don't exist
-- Zhou Zheng Sheng / 周征晟 E-mail: zhshzhou@linux.vnet.ibm.com Telephone: 86-10-82454397

Reviewed-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> On 05/09/2014 03:50 AM, Aline Manera wrote:
From: Aline Manera <alinefm@br.ibm.com>
In proxy.py, the config_dir was only initialized in a 'if' statement and used outside it. So if the SSL certificate and key were received as parameters, config_dir was undefined. Fix it.
Signed-off-by: Aline Manera <alinefm@br.ibm.com> --- src/kimchi/proxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/proxy.py b/src/kimchi/proxy.py index 7a12bfd..1ccbbcc 100644 --- a/src/kimchi/proxy.py +++ b/src/kimchi/proxy.py @@ -57,9 +57,9 @@ def _create_proxy_config(p_port, k_port, p_ssl_port, cert, key): except KeyError: user_proxy = 'www-data'
+ config_dir = paths.conf_dir # No certificates specified by the user if not cert or not key: - config_dir = paths.conf_dir cert = '%s/kimchi-cert.pem' % config_dir key = '%s/kimchi-key.pem' % config_dir # create cert files if they don't exist
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center
participants (3)
-
Aline Manera
-
Sheldon
-
Zhou Zheng Sheng