Skip to content

Commit

Permalink
(FACT-2102) Update GCE metadata endpoint for 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
erjohnso committed Nov 22, 2019
1 parent bd4015d commit 0678144
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 0678144

Please sign in to comment.