deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject git commit: CIMI: Fix created_at to report 'xmlschema' time format (DTACLOUD-349)
Date Tue, 06 Nov 2012 13:07:14 GMT
Updated Branches:
  refs/heads/master 1d5a40d5f -> 56257a27c


CIMI: Fix created_at to report 'xmlschema' time format (DTACLOUD-349)


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/56257a27
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/56257a27
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/56257a27

Branch: refs/heads/master
Commit: 56257a27c68faa220174c22e4ef03a104745ea89
Parents: 1d5a40d
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Mon Oct 22 13:06:23 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Tue Nov 6 13:48:47 2012 +0100

----------------------------------------------------------------------
 server/lib/cimi/models/cloud_entry_point.rb        |    2 +-
 server/lib/cimi/models/credential.rb               |    2 +-
 server/lib/cimi/models/disk.rb                     |    2 +-
 server/lib/cimi/models/machine.rb                  |    2 +-
 server/lib/cimi/models/machine_configuration.rb    |    2 +-
 server/lib/cimi/models/machine_image.rb            |    2 +-
 server/lib/cimi/models/machine_volume.rb           |    2 +-
 server/lib/cimi/models/network_port_collection.rb  |    4 ++--
 .../network_port_configuration_collection.rb       |    2 +-
 .../models/network_port_template_collection.rb     |    2 +-
 server/lib/cimi/models/volume.rb                   |    2 +-
 server/lib/cimi/models/volume_configuration.rb     |    2 +-
 server/lib/cimi/models/volume_image.rb             |    2 +-
 13 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/cloud_entry_point.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/cloud_entry_point.rb b/server/lib/cimi/models/cloud_entry_point.rb
index 7d11bf6..f86e5ee 100644
--- a/server/lib/cimi/models/cloud_entry_point.rb
+++ b/server/lib/cimi/models/cloud_entry_point.rb
@@ -23,7 +23,7 @@ class CIMI::Model::CloudEntryPoint < CIMI::Model::Base
       :description => "Cloud Entry Point for the Deltacloud #{context.driver.name} driver",
       :id => context.cloudEntryPoint_url,
       :base_uri => context.base_uri,
-      :created => Time.now
+      :created => DateTime.now.xmlschema
     }))
   end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/credential.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/credential.rb b/server/lib/cimi/models/credential.rb
index cf19f82..7e11a95 100644
--- a/server/lib/cimi/models/credential.rb
+++ b/server/lib/cimi/models/credential.rb
@@ -55,7 +55,7 @@ class CIMI::Model::Credential < CIMI::Model::Base
       :password => key.is_password? ? key.password : key.fingerprint,
       :key => key.is_key? ? key.pem_rsa_key : nil,
       :id => context.credential_url(key.id),
-      :created => Time.now
+      :created => DateTime.now.xmlschema
     )
   end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/disk.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/disk.rb b/server/lib/cimi/models/disk.rb
index b069207..6ca8792 100644
--- a/server/lib/cimi/models/disk.rb
+++ b/server/lib/cimi/models/disk.rb
@@ -46,7 +46,7 @@ class CIMI::Model::Disk < CIMI::Model::Base
           :id => context.machine_url(instance.id)+"/disks/#{name}",
           :name => name,
           :description => "Disk for Machine #{instance.id}",
-          :created => instance.launch_time,
+          :created => instance.launch_time.nil? ? DateTime.now.xmlschema : DateTime.parse(instance.launch_time).xmlschema,
           :capacity => capacity
         )]
       end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/machine.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/machine.rb b/server/lib/cimi/models/machine.rb
index a15fa81..876ac0b 100644
--- a/server/lib/cimi/models/machine.rb
+++ b/server/lib/cimi/models/machine.rb
@@ -119,7 +119,7 @@ class CIMI::Model::Machine < CIMI::Model::Base
     self.new(
       :name => instance.id,
       :description => instance.name,
-      :created => instance.launch_time,
+      :created => instance.launch_time.nil? ? DateTime.now.xmlschema : DateTime.parse(instance.launch_time).xmlschema,
       :id => context.machine_url(instance.id),
       :state => convert_instance_state(instance.state),
       :cpu => cpu || convert_instance_cpu(instance.instance_profile, context),

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/machine_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/machine_configuration.rb b/server/lib/cimi/models/machine_configuration.rb
index 84c966f..0296ccc 100644
--- a/server/lib/cimi/models/machine_configuration.rb
+++ b/server/lib/cimi/models/machine_configuration.rb
@@ -54,7 +54,7 @@ class CIMI::Model::MachineConfiguration < CIMI::Model::Base
       :description => "Machine Configuration with #{memory} KiB "+
         "of memory and #{cpu} CPU",
       :cpu => ( cpu if cpu ) ,
-      :created => Time.now.to_s,  # FIXME: DC hardware_profile has no mention about created_at
+      :created => DateTime.now.xmlschema,  # FIXME: DC hardware_profile has no mention
about created_at
       :memory => (memory if memory),
       :disks => (  [ { :capacity => storage  } ] if storage ),
       :id => context.machine_configuration_url(profile.name)

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/machine_image.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/machine_image.rb b/server/lib/cimi/models/machine_image.rb
index eeaff0a..64528f5 100644
--- a/server/lib/cimi/models/machine_image.rb
+++ b/server/lib/cimi/models/machine_image.rb
@@ -40,7 +40,7 @@ class CIMI::Model::MachineImage < CIMI::Model::Base
       :name => image.id,
       :id => context.machine_image_url(image.id),
       :description => image.description,
-      :created => Time.now.to_s,
+      :created => DateTime.now.xmlschema,
       :image_location => { :href => "#{context.driver.name}://#{image.id}" } # FIXME
     )
   end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/machine_volume.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/machine_volume.rb b/server/lib/cimi/models/machine_volume.rb
index 2337bdf..103a414 100644
--- a/server/lib/cimi/models/machine_volume.rb
+++ b/server/lib/cimi/models/machine_volume.rb
@@ -30,7 +30,7 @@ class CIMI::Model::MachineVolume < CIMI::Model::Base
           :id => context.machine_url(instance_id)+"/volumes/#{vol.id}",
           :name => vol.id,
           :description => "MachineVolume #{vol.id} for Machine #{instance_id}",
-          :created => vol.created,
+          :created => DateTime.parse(vol.created).xmlschema,
           :initial_location => vol.device,
           :volume => {:href=>context.volume_url(vol.id)}
           ) if vol.instance_id == instance_id

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/network_port_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network_port_collection.rb b/server/lib/cimi/models/network_port_collection.rb
index 32642cf..112e92d 100644
--- a/server/lib/cimi/models/network_port_collection.rb
+++ b/server/lib/cimi/models/network_port_collection.rb
@@ -27,7 +27,7 @@ class CIMI::Model::NetworkPortCollection < CIMI::Model::Base
     self.new(
       :id => context.network_ports_url,
       :name => 'default',
-      :created => Time.now,
+      :created => DateTime.now.xmlschema,
       :description => "#{context.driver.name.capitalize} NetworkPortCollection",
       :count => network_ports.size,
       :network_ports => network_ports
@@ -41,7 +41,7 @@ class CIMI::Model::NetworkPortCollection < CIMI::Model::Base
     self.new(
       :id => net_url+"/network_ports",
       :name => 'default',
-      :created => Time.now,
+      :created => DateTime.now.xmlschema,
       :description => "#{context.driver.name.capitalize} NetworkPortCollection",
       :count => ports_collection.size,
       :network_ports => ports_collection

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/network_port_configuration_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network_port_configuration_collection.rb b/server/lib/cimi/models/network_port_configuration_collection.rb
index eb34902..fa790d8 100644
--- a/server/lib/cimi/models/network_port_configuration_collection.rb
+++ b/server/lib/cimi/models/network_port_configuration_collection.rb
@@ -25,7 +25,7 @@ class CIMI::Model::NetworkPortConfigurationCollection < CIMI::Model::Base
     self.new(
       :id => context.network_port_configurations_url,
       :name => 'default',
-      :created => Time.now,
+      :created => DateTime.now.xmlschema,
       :description => "#{context.driver.name.capitalize} NetworkPortConfigurationCollection",
       :count => network_port_configurations.size,
       :network_port_configurations => network_port_configurations

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/network_port_template_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network_port_template_collection.rb b/server/lib/cimi/models/network_port_template_collection.rb
index 782af0d..1ab54f2 100644
--- a/server/lib/cimi/models/network_port_template_collection.rb
+++ b/server/lib/cimi/models/network_port_template_collection.rb
@@ -27,7 +27,7 @@ class CIMI::Model::NetworkPortTemplateCollection < CIMI::Model::Base
     self.new(
       :id => context.network_port_templates_url,
       :name => 'default',
-      :created => Time.now,
+      :created => DateTime.now.xmlschema,
       :description => "#{context.driver.name.capitalize} NetworkPortTemplateCollection",
       :count => network_port_templates.size,
       :network_port_templates => network_port_templates

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/volume.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/volume.rb b/server/lib/cimi/models/volume.rb
index 8a60ae8..5813cbd 100644
--- a/server/lib/cimi/models/volume.rb
+++ b/server/lib/cimi/models/volume.rb
@@ -90,7 +90,7 @@ class CIMI::Model::Volume < CIMI::Model::Base
   def self.from_storage_volume(volume, context)
     self.new( { :name => volume.id,
                 :description => volume.id,
-                :created => volume.created,
+                :created => DateTime.parse(volume.created).xmlschema,
                 :id => context.volume_url(volume.id),
                 :capacity => { :quantity=>volume.capacity, :units=>"gibibyte"  },
#FIXME... units will vary
                 :bootable => "false", #fixme ... will vary... ec2 doesn't expose this

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/volume_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/volume_configuration.rb b/server/lib/cimi/models/volume_configuration.rb
index 9721a3c..f30222d 100644
--- a/server/lib/cimi/models/volume_configuration.rb
+++ b/server/lib/cimi/models/volume_configuration.rb
@@ -52,7 +52,7 @@ class CIMI::Model::VolumeConfiguration < CIMI::Model::Base
                 :id => context.volume_configuration_url(size),
                 :name => size,
                 :description => "volume configuration with #{size} GiB",
-                :created => Time.now.to_s,
+                :created => DateTime.now.xmlschema,
                 :capacity => {:quantity=>size, :units=>"gibibytes"},
                 :supports_snapshots => "true"
                 # FIXME :guest_interface => "NFS"

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/56257a27/server/lib/cimi/models/volume_image.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/volume_image.rb b/server/lib/cimi/models/volume_image.rb
index ff65ff5..18090b0 100644
--- a/server/lib/cimi/models/volume_image.rb
+++ b/server/lib/cimi/models/volume_image.rb
@@ -41,7 +41,7 @@ class CIMI::Model::VolumeImage < CIMI::Model::Base
     self.new( {
                :name => snapshot.id,
                :description => snapshot.id,
-               :created => snapshot.created,
+               :created => DateTime.parse(snapshot.created).xmlschema,
                :id => context.volume_image_url(snapshot.id),
                :image_location => {:href=>context.volume_url(snapshot.storage_volume_id)},
                :bootable => "false"  #FIXME


Mime
View raw message