Skip to content

Commit 10b7735

Browse files
committed
[GCP IMDS] Use fully qualified name
1 parent c899034 commit 10b7735

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

libcloud/common/google.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _from_utc_timestamp(timestamp):
126126

127127
def _get_gce_metadata(path="", retry_failed: Optional[bool] = None):
128128
try:
129-
url = "http://metadata/computeMetadata/v1/" + path.lstrip("/")
129+
url = "http://metadata.google.internal/computeMetadata/v1/" + path.lstrip("/")
130130
headers = {"Metadata-Flavor": "Google"}
131131
response = get_response_object(url, headers=headers, retry_failed=retry_failed)
132132
return response.status, "", response.body

libcloud/test/compute/fixtures/gce/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"key": "startup-script",
18-
"value": "#!/bin/bash\n\nAUTO_SCRIPT=$(curl -s http://metadata/computeMetadata/v1/instance/attributes/my-auto-script -H \"Metadata-Flavor: Google\")\nCHECK=${AUTO_SCRIPT:-disabled}\n\nif [ \"${CHECK}\" = \"enabled\" -a -f /etc/debian_version ]; then\n export DEBIAN_FRONTEND=noninteractive\n apt-get -q -y update\n apt-get -q -y install git vim tmux\n fi\nexit 0\n"
18+
"value": "#!/bin/bash\n\nAUTO_SCRIPT=$(curl -s http://metadata.google.internal/computeMetadata/v1/instance/attributes/my-auto-script -H \"Metadata-Flavor: Google\")\nCHECK=${AUTO_SCRIPT:-disabled}\n\nif [ \"${CHECK}\" = \"enabled\" -a -f /etc/debian_version ]; then\n export DEBIAN_FRONTEND=noninteractive\n apt-get -q -y update\n apt-get -q -y install git vim tmux\n fi\nexit 0\n"
1919
}
2020
]
2121
},

0 commit comments

Comments
 (0)