| diff --git a/tests/unittests/test_datasource/test_gce.py b/tests/unittests/test_datasource/test_gce.py | |
| index 6e62a4d..9bf98a9 100644 | |
| --- a/tests/unittests/test_datasource/test_gce.py | |
| +++ b/tests/unittests/test_datasource/test_gce.py | |
| @@ -50,9 +50,9 @@ GCE_META_ENCODING = { | |
| 'instance/attributes/user-data-encoding': 'base64', | |
| } | |
| +BASE_URI = "http://metadata.google.internal/" | |
| HEADERS = {'X-Google-Metadata-Request': 'True'} | |
| -MD_URL_RE = re.compile( | |
| - r'http://metadata.google.internal/computeMetadata/v1/.*') | |
| +MD_URL_RE = re.compile(r'.*') | |
| def _set_mock_metadata(gce_meta=None): | |
| @@ -60,6 +60,9 @@ def _set_mock_metadata(gce_meta=None): | |
| gce_meta = GCE_META | |
| def _request_callback(method, uri, headers): | |
| + print("Got call for %s" % uri) | |
| + if not uri.startswith(BASE_URI): | |
| + return (404, headers, '') | |
| url_path = urlparse(uri).path | |
| if url_path.startswith('/computeMetadata/v1/'): | |
| path = url_path.split('/computeMetadata/v1/')[1:][0] | |
| (.venv) LMDV-JHARLOW:cloud-init jxharlow$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment