Support to verify https url

resolve the same issue as https://review.opendev.org/#/c/677954/

Change-Id: I3f11911cb5b8b0e7e21d5bf98ce208af500ba332
This commit is contained in:
chenhb 2019-08-22 19:15:28 +08:00
parent 3c529c7c4f
commit b22308ecf3
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ class PathOrUrl(types.ResourceType):
if os.path.isfile(path):
return path
try:
head = requests.head(path)
head = requests.head(path, verify=False)
if head.status_code == 200:
return path
raise exceptions.InvalidScenarioArgument(

View File

@ -37,7 +37,7 @@ class PathOrUrlTestCase(test.TestCase):
self.assertRaises(exceptions.InvalidScenarioArgument,
types.PathOrUrl({}, {}).pre_process,
"fake_path", {})
mock_requests_head.assert_called_once_with("fake_path")
mock_requests_head.assert_called_once_with("fake_path", verify=False)
@mock.patch("os.path.isfile")
@mock.patch("requests.head")