Skip to content

Commit

Permalink
Merge pull request #1847 from erjohnso/gce-v1-metadata
Browse files Browse the repository at this point in the history
(FACT-2102) Update GCE metadata endpoint for 2.x
  • Loading branch information
Gheorghe Popescu authored Dec 10, 2019
2 parents bd4015d + 0678144 commit 00f55b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/facter/gce/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Metadata
Timeout::Error,
]

METADATA_URL = "http://metadata/computeMetadata/v1beta1/?recursive=true&alt=json"
METADATA_URL = "http://metadata/computeMetadata/v1/?recursive=true&alt=json"

def initialize(url = METADATA_URL)
@url = url
Expand Down Expand Up @@ -45,7 +45,7 @@ def with_metadata_server

begin
Timeout.timeout(timeout) do
body = open(@url, :proxy => nil).read
body = open(@url, options={:proxy => nil, "Metadata-Flavor" => "Google"}).read
end
rescue *CONNECTION_ERRORS => e
attempts = attempts + 1
Expand Down

0 comments on commit 00f55b4

Please sign in to comment.