From: Marc Titinger mtitinger@baylibre.com
search_substr_from_array would return a false positive in lava_dispatcher/downloader.py when trying to match 'no_proxy' exclusion list with the download object url.
This now uses a (too?) simple substring matching rather than a greedy regex.
Signed-off-by: Marc Titinger mtitinger@baylibre.com --- lava_dispatcher/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lava_dispatcher/utils.py b/lava_dispatcher/utils.py index f2fd79a..037f6b5 100644 --- a/lava_dispatcher/utils.py +++ b/lava_dispatcher/utils.py @@ -640,7 +640,7 @@ def search_substr_from_array(string, array, sep=','): Strings in array are separated by default with ',' """ for obj in array.split(sep): - if re.search('.*' + str(obj) + '.*', str(string)): + if str(obj).find(string) is not -1: return True return False
Hi Neil,
I had to make this change to get squid3 going with our LAVA 1.0 machine. I thought this could be useful. I did not test extensively though.
BR, Marc.
On 13/04/2016 18:34, Marc Titinger wrote:
From: Marc Titinger mtitinger@baylibre.com
search_substr_from_array would return a false positive in lava_dispatcher/downloader.py when trying to match 'no_proxy' exclusion list with the download object url.
This now uses a (too?) simple substring matching rather than a greedy regex.
Signed-off-by: Marc Titinger mtitinger@baylibre.com
lava_dispatcher/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lava_dispatcher/utils.py b/lava_dispatcher/utils.py index f2fd79a..037f6b5 100644 --- a/lava_dispatcher/utils.py +++ b/lava_dispatcher/utils.py @@ -640,7 +640,7 @@ def search_substr_from_array(string, array, sep=','): Strings in array are separated by default with ',' """ for obj in array.split(sep):
if re.search('.*' + str(obj) + '.*', str(string)):
if str(obj).find(string) is not -1: return True return False
Marc Titinger mtitinger@baylibre.com writes:
I had to make this change to get squid3 going with our LAVA 1.0 machine. I thought this could be useful. I did not test extensively though.
FWIW, I had problems getting lava-dispatcher to use my local squid proxy also. Seems setting LAVA_PROXY in lava-dispatcher.conf was working for the the devices (lava set the environment variable after booting the target), but lava-dispatcher itself was not using the proxy.
I'll give this a try as well.
Kevin