lib/onceover/rake_tasks.rb in onceover-3.0.8 vs lib/onceover/rake_tasks.rb in onceover-3.0.9
- old
+ new
@@ -49,17 +49,22 @@
repo.facts.each do |fact_set|
node_name = File.basename(repo.facts_files[repo.facts.index(fact_set)],'.json')
boxname = Onceover::Beaker.facts_to_vagrant_box(fact_set)
platform = Onceover::Beaker.facts_to_platform(fact_set)
- response = Net::HTTP.get(URI.parse("https://atlas.hashicorp.com/api/v1/box/#{boxname}"))
+
+ uri = URI("https://atlas.hashicorp.com:443/api/v1/box/#{boxname}")
+ request = Net::HTTP.new(uri.host, uri.port)
+ request.use_ssl = true
+ response = request.get(uri)
+
url = 'URL goes here'
- if response =~ /Not Found/i
+ if response.code == "404"
comment_out = true
else
comment_out = false
- box_info = JSON.parse(response)
+ box_info = JSON.parse(response.body)
box_info['current_version']['providers'].each do |provider|
if provider['name'] == 'virtualbox'
url = provider['original_url']
end
end