Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 13652040 authored by POUILLOUX Laurent's avatar POUILLOUX Laurent
Browse files

Merge branch 'fix_16611' into 'master'

Fix 16611

See merge request !919
parents 9afa9808 cc7730e2
No related branches found
No related tags found
1 merge request!919Fix 16611
Pipeline #1097555 passed with warnings
Pipeline: Resources Explorer

#1097557

    ......@@ -362,10 +362,6 @@ sites:
    chassis:
    manufactured_at: 2016-11-04
    warranty_end: 2021-11-03
    nova-2:
    chassis:
    manufactured_at: 2016-10-28
    warranty_end: 2021-10-27
    nova-21:
    chassis:
    manufactured_at: 2016-11-04
    ......@@ -378,10 +374,6 @@ sites:
    chassis:
    manufactured_at: 2016-11-03
    warranty_end: 2021-11-03
    nova-3:
    chassis:
    manufactured_at: 2016-10-28
    warranty_end: 2021-10-27
    nova-4:
    chassis:
    manufactured_at: 2016-10-28
    ......@@ -614,10 +606,6 @@ sites:
    chassis:
    manufactured_at: 2017-06-07
    warranty_end: 2022-06-07
    grele-14:
    chassis:
    manufactured_at: 2017-06-07
    warranty_end: 2022-06-07
    grele-2:
    chassis:
    manufactured_at: 2017-06-07
    ......@@ -2204,5 +2192,7 @@ sites:
    chassis:
    manufactured_at: 2011-01-04
    warranty_end: 2014-01-04
    strasbourg:
    clusters: {}
    toulouse:
    clusters: {}
    ......@@ -18,11 +18,7 @@ def dell_product_data
    q.headers["Authorization"] = "Bearer #{token}"
    end
    JSON.parse(response.body).each do |product|
    begin
    set_product_data(data["sites"], product)
    rescue
    p "#{product["serviceTag"]} has not been found"
    end
    set_product_data(data["sites"], product)
    end
    }
    ......@@ -86,11 +82,18 @@ def get_api_token
    end
    def set_product_data(data, product)
    data.each do |_s, s_hash|
    s_hash['clusters'].each do |_c, c_hash|
    c_hash['nodes'].each do |_n, info|
    if info["chassis"]["serial"] == product["serviceTag"]
    info["chassis"]["manufactured_at"] = DateTime.strptime(product["shipDate"], '%Y-%m-%d').to_date
    # uvb cluster is not available on Dell API anymore
    # https://intranet.grid5000.fr/bugzilla/show_bug.cgi?id=16611
    if product['serviceTag'] == '957XY4J'
    product["shipDate"] = "2011-01-04T00:00:00Z"
    product["entitlements"][0]= {'endDate' => '2014-01-04T00:00:00Z'}
    end
    info["chassis"]["manufactured_at"] = DateTime.strptime(product["shipDate"] , '%Y-%m-%d').to_date
    info["chassis"]["warranty_end"] = DateTime.strptime(product["entitlements"].map{|e| e["endDate"] }.max, '%Y-%m-%d').to_date
    info["chassis"].delete("serial")
    end
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment