Commit 014c0b92 authored by DELABROYE Dimitri's avatar DELABROYE Dimitri

[lib/refapi] use Date instead of Time fix #9130

parent 29bedcdd
{
"created_at": "Thu, 22 Mar 2018 11:00:00 GMT",
"created_at": "Thu, 22 Mar 2018 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge C6420",
"priority": "201800",
......
{
"created_at": "Tue, 16 Jan 2018 15:00:00 GMT",
"created_at": "Tue, 16 Jan 2018 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R940",
"queues": [
......
{
"created_at": "Wed, 30 Nov 2016 23:00:00 GMT",
"created_at": "Thu, 01 Dec 2016 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R630",
"priority": "201650",
......
{
"created_at": "Sun, 05 Aug 2018 22:00:00 GMT",
"created_at": "Mon, 06 Aug 2018 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R7425",
"priority": "201850",
......
{
"created_at": "Wed, 30 Nov 2016 23:00:00 GMT",
"created_at": "Thu, 01 Dec 2016 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R730",
"priority": "201670",
......
{
"created_at": "Tue, 31 Jul 2018 22:00:00 GMT",
"created_at": "Wed, 01 Aug 2018 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R740",
"priority": "201870",
......
{
"created_at": "Wed, 30 Nov 2011 23:00:00 GMT",
"created_at": "Thu, 01 Dec 2011 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge 1950",
"queues": [
......
{
"created_at": "Mon, 09 Sep 2013 22:00:00 GMT",
"created_at": "Tue, 10 Sep 2013 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge M620",
"queues": [
......
{
"created_at": "Tue, 02 Oct 2012 12:00:00 GMT",
"created_at": "Tue, 02 Oct 2012 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge C6220",
"priority": "201299",
......
{
"created_at": "Thu, 01 Dec 2016 12:00:00 GMT",
"created_at": "Thu, 01 Dec 2016 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R430",
"priority": "201700",
......
{
"created_at": "Fri, 14 Sep 2012 12:00:00 GMT",
"created_at": "Fri, 14 Sep 2012 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R720",
"priority": "201299",
......
{
"created_at": "Sat, 01 Jul 2006 12:00:00 GMT",
"created_at": "Sat, 01 Jul 2006 00:00:00 GMT",
"kavlan": true,
"model": "Sun Fire V20z",
"priority": "201899",
......
{
"created_at": "Fri, 14 Sep 2012 12:00:00 GMT",
"created_at": "Fri, 14 Sep 2012 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R720",
"queues": [
......
{
"created_at": "Thu, 06 Jun 2019 22:00:00 GMT",
"created_at": "Fri, 07 Jun 2019 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge T640",
"queues": [
......
{
"created_at": "Sun, 03 Jan 2016 23:00:00 GMT",
"created_at": "Mon, 04 Jan 2016 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R630",
"queues": [
......
{
"created_at": "Tue, 12 May 2015 17:00:00 GMT",
"created_at": "Tue, 12 May 2015 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R720",
"queues": [
......
{
"created_at": "Wed, 04 Dec 2013 23:00:00 GMT",
"created_at": "Thu, 05 Dec 2013 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R720",
"queues": [
......
{
"created_at": "Mon, 08 Apr 2013 22:00:00 GMT",
"created_at": "Tue, 09 Apr 2013 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge C6220",
"queues": [
......
{
"created_at": "Sun, 25 Jun 2017 22:00:00 GMT",
"created_at": "Mon, 26 Jun 2017 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R730",
"queues": [
......
{
"created_at": "Mon, 29 Aug 2016 22:00:00 GMT",
"created_at": "Tue, 30 Aug 2016 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R730",
"queues": [
......
{
"created_at": "Thu, 21 Jan 2016 23:00:00 GMT",
"created_at": "Fri, 22 Jan 2016 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R630",
"queues": [
......
{
"created_at": "Sun, 03 Jan 2016 23:00:00 GMT",
"created_at": "Mon, 04 Jan 2016 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R630",
"priority": "201201",
......
{
"created_at": "Tue, 10 Apr 2018 22:00:00 GMT",
"created_at": "Wed, 11 Apr 2018 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge C6420",
"queues": [
......
{
"created_at": "Tue, 15 Apr 2014 22:00:00 GMT",
"created_at": "Wed, 16 Apr 2014 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge C6220",
"queues": [
......
{
"created_at": "Mon, 16 Oct 2017 17:40:55 GMT",
"created_at": "Mon, 16 Oct 2017 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R630",
"queues": [
......
{
"created_at": "Thu, 20 Feb 2014 23:00:00 GMT",
"created_at": "Fri, 21 Feb 2014 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge C6220 II",
"queues": [
......
{
"created_at": "Sun, 24 Jan 2010 23:00:00 GMT",
"created_at": "Mon, 25 Jan 2010 00:00:00 GMT",
"kavlan": true,
"model": "SUN FIRE X2270",
"queues": [
......
{
"created_at": "Mon, 01 Nov 2010 23:00:00 GMT",
"created_at": "Tue, 02 Nov 2010 00:00:00 GMT",
"kavlan": true,
"model": "HP ProLiant DL165 G7",
"queues": [
......
{
"created_at": "Mon, 12 Jan 2015 23:00:00 GMT",
"created_at": "Tue, 13 Jan 2015 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R630",
"queues": [
......
{
"created_at": "Mon, 12 Jan 2015 23:00:00 GMT",
"created_at": "Tue, 13 Jan 2015 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R630",
"queues": [
......
{
"created_at": "Tue, 26 Jan 2010 23:00:00 GMT",
"created_at": "Wed, 27 Jan 2010 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge R410",
"queues": [
......
{
"created_at": "Mon, 03 Jan 2011 23:00:00 GMT",
"created_at": "Tue, 04 Jan 2011 00:00:00 GMT",
"kavlan": true,
"model": "Dell PowerEdge C6100",
"queues": [
......
......@@ -95,7 +95,7 @@ def generate_reference_api
grid_path = Pathname.new(refapi_path)
grid_path.mkpath()
write_json(grid_path.join("#{global_hash['uid']}.json"),
write_json(grid_path.join("#{global_hash['uid']}.json"),
global_hash.reject {|k, v| k == "sites" || k == "network_equipments" || k == "disk_vendor_model_mapping"})
end
......@@ -128,7 +128,7 @@ def generate_reference_api
site_path = Pathname.new(refapi_path).join("sites", site_uid)
site_path.mkpath()
write_json(site_path.join("#{site_uid}.json"),
write_json(site_path.join("#{site_uid}.json"),
site.reject {|k, v| k == "clusters" || k == "networks" || k == "pdus" || k == "dom0" || k == "laptops" || k == "servers" })
#
......@@ -189,7 +189,7 @@ def generate_reference_api
# On the previous version of this script, cluster["created_ad"] was generated from a Ruby Time. cluster["created_ad"] is now a Ruby Date at JSON import.
# As Date.httpdate and Time.httpdate does not behave the same with timezone, it is converted here as a Ruby time.
cluster["created_at"] = Time.parse(cluster["created_at"].to_s).httpdate
cluster["created_at"] = Date.parse(cluster["created_at"].to_s).httpdate
cluster_path = Pathname.new(refapi_path).join("sites", site_uid, "clusters", cluster_uid)
cluster_path.mkpath()
......@@ -224,7 +224,7 @@ def generate_reference_api
# Delete keys
#raise 'node["storage_devices"] is nil' if node["storage_devices"].nil?
Hash(node["storage_devices"]).keys.each { |key|
Hash(node["storage_devices"]).keys.each { |key|
node["storage_devices"][key].delete("timeread") if node["storage_devices"][key].key?("timeread")
node["storage_devices"][key].delete("timewrite") if node["storage_devices"][key].key?("timewrite")
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment