Support to verify https url
resolve the same issue as https://review.opendev.org/#/c/677954/ Change-Id: I3f11911cb5b8b0e7e21d5bf98ce208af500ba332
This commit is contained in:
parent
3c529c7c4f
commit
b22308ecf3
|
@ -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(
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue