From 58a5ed7f6095cdf0e909a744dd070c46d0b6df36 Mon Sep 17 00:00:00 2001 From: Jonathan Pastor <jonathancmoa@gmail.com> Date: Thu, 5 Dec 2019 01:26:34 +0100 Subject: [PATCH] [oar generator] fix the URL for the jenkin test --- lib/refrepo/gen/oar-properties.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/refrepo/gen/oar-properties.rb b/lib/refrepo/gen/oar-properties.rb index a63e71041fd..2e1072d6cf3 100644 --- a/lib/refrepo/gen/oar-properties.rb +++ b/lib/refrepo/gen/oar-properties.rb @@ -598,10 +598,19 @@ end # Get all data from the OAR database def get_oar_data(site_uid, options) - if options[:api][:uri] and not options[:api][:uri].include? "api.grid5000.fr" - api_uri = URI.parse(options[:api][:uri]+'/oarapi/resources/details.json?limit=999999') - else + + # If no API URL is given, set a default URL on https://api.grid5000.fr + if not options[:api][:uri] + options[:api][:uri] = "https://api.grid5000.fr" + end + + # Preparing the URL that will be used to fetch OAR resources + if options[:api][:uri].include? "api.grid5000.fr" api_uri = URI.parse('https://api.grid5000.fr/stable/sites/' + site_uid + '/internal/oarapi/resources/details.json?limit=999999') + elsif options[:api][:uri].include? "api-ext.grid5000.fr" + api_uri = URI.parse('https://api-ext.grid5000.fr/stable/sites/' + site_uid + '/internal/oarapi/resources/details.json?limit=999999') + else + api_uri = URI.parse(options[:api][:uri]+'/oarapi/resources/details.json?limit=999999') end # Download the OAR properties from the OAR API (through G5K API) -- GitLab