From 6e3955e4cf2eaacd11adbc8df68e9d5d5e081f8f Mon Sep 17 00:00:00 2001 From: Navneet Singh Date: Tue, 22 Oct 2013 01:41:11 +0530 Subject: [PATCH] NetApp unit test fail fix for http_proxy The environment having http_proxy settings caused the unit tests to fail with 404 error. This fix handles both situations with proxy or without proxy settings. Change-Id: I791a45adff654305db9f1fb6f039e91b11ba88d8 Closes-Bug:#1223145 --- cinder/tests/test_netapp.py | 8 ++++---- cinder/tests/test_netapp_ssc.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cinder/tests/test_netapp.py b/cinder/tests/test_netapp.py index bba3a197f..fe3bb5512 100644 --- a/cinder/tests/test_netapp.py +++ b/cinder/tests/test_netapp.py @@ -97,7 +97,7 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): def do_GET(s): """Respond to a GET request.""" - if '/servlets/netapp.servlets.admin.XMLrequest_filer' != s.path: + if '/servlets/netapp.servlets.admin.XMLrequest_filer' not in s.path: s.send_response(404) s.end_headers return @@ -111,7 +111,7 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): def do_POST(s): """Respond to a POST request.""" - if '/servlets/netapp.servlets.admin.XMLrequest_filer' != s.path: + if '/servlets/netapp.servlets.admin.XMLrequest_filer' not in s.path: s.send_response(404) s.end_headers return @@ -683,7 +683,7 @@ class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler): def do_GET(s): """Respond to a GET request.""" - if '/servlets/netapp.servlets.admin.XMLrequest_filer' != s.path: + if '/servlets/netapp.servlets.admin.XMLrequest_filer' not in s.path: s.send_response(404) s.end_headers return @@ -697,7 +697,7 @@ class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler): def do_POST(s): """Respond to a POST request.""" - if '/servlets/netapp.servlets.admin.XMLrequest_filer' != s.path: + if '/servlets/netapp.servlets.admin.XMLrequest_filer' not in s.path: s.send_response(404) s.end_headers return diff --git a/cinder/tests/test_netapp_ssc.py b/cinder/tests/test_netapp_ssc.py index 4c10cac38..9d5f0b853 100644 --- a/cinder/tests/test_netapp_ssc.py +++ b/cinder/tests/test_netapp_ssc.py @@ -75,7 +75,7 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): def do_GET(s): """Respond to a GET request.""" - if '/servlets/netapp.servlets.admin.XMLrequest_filer' != s.path: + if '/servlets/netapp.servlets.admin.XMLrequest_filer' not in s.path: s.send_response(404) s.end_headers return @@ -89,7 +89,7 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): def do_POST(s): """Respond to a POST request.""" - if '/servlets/netapp.servlets.admin.XMLrequest_filer' != s.path: + if '/servlets/netapp.servlets.admin.XMLrequest_filer' not in s.path: s.send_response(404) s.end_headers return -- 2.45.2